1-- Unital homomorphisms from a field into a nontrivial ring are injective (ZF).2-- Part of Cumulus, the Grace17 mathematics library.3-- Copyright (c) 2026 Grant Passmore.4-- Released under the Apache License 2.0. See LICENSE in the repository root.5-- Authors: Grant Passmore67module Grace.Cumulus.Algebra.Field.Embedding8import Homomorphism910section Fields11variable (A add zero neg mul one B plus z minus times unit f : Set)12notationring R := (A, add, zero, neg, mul, one)13notationring S := (B, plus, z, minus, times, unit)14hypothesis field : IsField(R)15hypothesis target : IsCommRing(S)16hypothesis nontrivial : Nontrivial(S)17hypothesis hom : IsRingHom(f, R, S)1819theorem IsRingHom.field_reflects_zero (x : Set)20requires member : x ∈ R21requires vanishes : f(x) = S[0]22shows x = R[0]23proof24by_contra nonzero25obtain⟨y, inverse⟩:= IsField.inverse_exists at A, add, zero, neg, mul, one, x with*26unfold IsInverse at inverse27have yIn := inverse.right.left28have product := inverse.right.right.left29have mapped := IsRingHom.mul with hom, member, yIn30have oneValue := IsRingHom.one with hom31have imageY := IsRingHom.closed with hom, yIn32have annihilate : S[0* f(y)] = S[0] byring33have impossible : S[0] = S[1] bycc34have distinct := Nontrivial.distinct with nontrivial35exact distinct with impossible3637theorem IsRingHom.field_injective38shows InjectiveBetween(f, R, S)39proof40have source := IsField.comm_ring with field41have ordinary := IsCommRing.ring with source42have function := IsRingHom.function with hom43constructor44 . exact function45 . intros x hx y hy b hb first second46have valueX := FunctionBetween.apply_value with function, hx, first47have valueY := FunctionBetween.apply_value with function, hy, second48have negative := IsRing.neg_closed with ordinary, hy49have difference := IsRing.add_closed with ordinary, hx, negative50have mapped := IsRingHom.sub with source, hom, hx, hy51have zero : S[f(x) - f(y)] = S[0]52rw [valueX, valueY]53ring54have vanishes : f(R[x - y]) = S[0] bycc55have equal := IsRingHom.field_reflects_zero with*56have recover : R[(x - y) + y] = x byring57have remove : R[0+ y] = y byring58cc5960theorem IsRingHom.field_iso_of_surjective61requires onto : SurjectiveBetween(f, R, S)62shows IsRingIso(f, R, S)63proof64have injective := IsRingHom.field_injective with*65have bijective : BijectiveBetween(f, R, S)66unfold BijectiveBetween67refine⟨injective, onto⟩68unfold IsRingIso69refine⟨hom, bijective⟩7071end Fields72