1-- A maximal polynomial ideal has a common zero exactly when its coefficient map is onto.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.Polynomial.ResidueCriterion8import Residue9import PointIdeal1011section Residues12variable (I A add zero neg mul one J : Set)13notationring R := (A, add, zero, neg, mul, one)14notationring P := R[I]15notationring Q := P ⧸ J16hypothesis field : IsField(R)17hypothesis maximal : IsMaximalIdeal(P, J)1819theorem polynomialResidueCoefficients.surjective_of_common_zero (v : Set)20requires common : PolynomialCommonZero(I, R, J, v)21shows SurjectiveBetween(polynomialResidueCoefficients(I, R, J), R, Q)22proof23havering:= IsField.comm_ring with field24have polynomialRing := polynomials.comm_ring at I, A, add, zero, neg, mul, one with*25have ordinary := IsCommRing.ring withring26have zeroIn := IsRing.zero_in_carrier with ordinary27have ideal := IsMaximalIdeal.ideal with maximal28have equivalence := idealRelation.equivalence with polynomialRing, ideal29have data := common30have assignment := data.left31have evaluation := polynomialAt.hom with*32have equalIdeal := IsMaximalIdeal.common_zero_iff_point.forward with*33have hom := polynomialResidueCoefficients.hom with*34have function := IsRingHom.function with hom35constructor36 . exact function37 . intros X hX38obtain⟨p, hp, shape⟩:= quotient.representative with hX39have value := IsRingHom.closed with evaluation, hp40have constant := polynomialConstant.member at I, A, zero, polynomialAt(I, R, v)(p) with*41have constantValue := polynomialAt.constant at I, A, add, zero, neg, mul, one, v, polynomialAt(I, R, v)(p) with*42have congruent := IsRingHom.kernel_congruent.backward with polynomialRing, ring, evaluation, constant, hp, constantValue43unfold pointIdeal at equalIdeal44rw← equalIdeal at congruent45have equalClass := idealClass.eq_iff_congruent.backward with*46have residueValue := polynomialResidueCoefficients.value at I, A, add, zero, neg, mul, one, J, polynomialAt(I, R, v)(p) with*47have projectionValue := quotientProjection.value at P, idealRelation(P, J), polynomialConstant(I, R, polynomialAt(I, R, v)(p)) with*48have output : polynomialResidueCoefficients(I, R, J)(polynomialAt(I, R, v)(p)) = X bycc49have edge := FunctionBetween.relates_apply with function, value50witness polynomialAt(I, R, v)(p)51constructor52 . exact value53 . rw output at edge54exact edge5556theorem polynomialResidueCoefficients.surjective_iff_common_zero57shows SurjectiveBetween(polynomialResidueCoefficients(I, R, J), R, Q) ↔∃ v, PolynomialCommonZero(I, R, J, v)58proof59constructor60 . intro onto61exact polynomialResidueCoefficients.common_zero_of_surjective with*62 . intro exists63obtain⟨v, common⟩:= exists64exact polynomialResidueCoefficients.surjective_of_common_zero with*6566end Residues67