-- Elimination: the fibre algebra D = ℂ[h, u, v, w] ⧸ (F) is the lifted -- algebra L = B[U, V, W] ⧸ (relX, relY, relS) over the plane presentation -- B = ℂ[h, x, y, s] ⧸ (relH, relCusp), as ℂ-algebras: h, x, y, s go to the -- classes of h, u³ + hv, −u² + hw, S(h, u, v, w), and U, V, W to u, v, w. -- Part of Cumulus, the Grace17 mathematics library. -- Copyright (c) 2026 Grant Passmore. -- Released under the Apache License 2.0. See LICENSE in the repository root. -- Authors: Grant Passmore module Grace.Cumulus.AlgebraicGeometry.Coordinates.Elimination import Grace.Cumulus.AlgebraicGeometry.Coordinates.Ambient import Grace.Cumulus.AlgebraicGeometry.Coordinates.Plane import Grace.Cumulus.AlgebraicGeometry.Coordinates.Lifting -- The fibre algebra D = ℂ[4] ⧸ (F) and its projection. def fibreIdeal : Set := generatedIdeal(polynomialRing(complexRing, 4), {ambientF}) def fibreAlgebra : Set := quotientAlgebra(ambientAlgebra, fibreIdeal) def fibreProjection : Set := algebraProjection(ambientAlgebra, fibreIdeal) -- The plane presentation over ℂ as the base B, with its classes h, x, y, s. def baseAlgebra : Set := planeAlgebra(complexRing) def baseRing : Set := Algebra.ring(baseAlgebra) def baseH : Set := planeVariable(complexRing, 0) def baseX : Set := planeVariable(complexRing, 1) def baseY : Set := planeVariable(complexRing, 2) def baseS : Set := planeVariable(complexRing, 3) -- The lifted algebra L over B, as an algebra over ℂ. def liftedAlgebra : Set := restrictScalars(liftingAlgebra(baseRing, baseH, baseX, baseY, baseS), complexRing, Algebra.map(baseAlgebra)) def liftedConstant : Set := Algebra.map(liftingAlgebra(baseRing, baseH, baseX, baseY, baseS)) def liftedVariable (i : Set) : Set := liftingVariable(baseRing, baseH, baseX, baseY, baseS, i) -- B → D: h, x, y, s to the classes of h, x, y, s in D. def auxValues : Set := quadrupleMap(algebraCarrier(fibreAlgebra), fibreProjection(X(complexRing, 4, 0)), fibreProjection(ambientX), fibreProjection(ambientY), fibreProjection(ambientS)) def auxEval : Set := evaluationHom(complexRing, Algebra.ring(fibreAlgebra), 4, Algebra.map(fibreAlgebra), auxValues) def auxToD : Set := algebraLift(auxEval, ambientAlgebra, fibreAlgebra, planeIdeal(complexRing)) -- B[U, V, W] → D: constants by auxToD, and U, V, W to the classes of u, v, w. def liftValues : Set := tripleMap(algebraCarrier(fibreAlgebra), fibreProjection(X(complexRing, 4, 1)), fibreProjection(X(complexRing, 4, 2)), fibreProjection(X(complexRing, 4, 3))) def liftEval : Set := evaluationHom(baseRing, Algebra.ring(fibreAlgebra), 3, auxToD, liftValues) def toOriginal : Set := quotientMap(liftEval, Ring.carrier(polynomialRing(baseRing, 3)), algebraCarrier(fibreAlgebra), quotientRelation(polynomialRing(baseRing, 3), liftingIdeal(baseRing, baseH, baseX, baseY, baseS))) -- ℂ[h, u, v, w] → L: h to the constant h, and u, v, w to U, V, W. def originalValues : Set := quadrupleMap(algebraCarrier(liftedAlgebra), liftedConstant(baseH), liftedVariable(0), liftedVariable(1), liftedVariable(2)) def originalEval : Set := evaluationHom(complexRing, Algebra.ring(liftedAlgebra), 4, Algebra.map(liftedAlgebra), originalValues) def fromOriginal : Set := algebraLift(originalEval, ambientAlgebra, liftedAlgebra, fibreIdeal) -- The ambient algebra ℂ[h, u, v, w] and the fibre algebra D: their rings -- and structure maps, and the projection onto D, which kills F. theorem ambientAlgebra.algebra shows Algebra(ambientAlgebra) proof unfold ambientAlgebra exact polynomialAlgebra.algebra at complexRing, 4 with * theorem ambientAlgebra.ring shows Algebra.ring(ambientAlgebra) = polynomialRing(complexRing, 4) proof unfold ambientAlgebra exact polynomialAlgebra.ring theorem fibreIdeal.ideal shows Ideal(Algebra.ring(ambientAlgebra), fibreIdeal) proof rw ambientAlgebra.ring unfold fibreIdeal exact generatedIdeal.ideal at polynomialRing(complexRing, 4), {ambientF} with * theorem fibreAlgebra.algebra shows Algebra(fibreAlgebra) proof have ambient := ambientAlgebra.algebra have ideal := fibreIdeal.ideal unfold fibreAlgebra exact quotientAlgebra.algebra with ambient, ideal theorem fibreAlgebra.base shows Algebra.base(fibreAlgebra) = complexRing proof unfold fibreAlgebra rw quotientAlgebra.baseOf unfold ambientAlgebra exact polynomialAlgebra.base theorem fibreAlgebra.ring shows Algebra.ring(fibreAlgebra) = quotientRing(polynomialRing(complexRing, 4), fibreIdeal) proof unfold fibreAlgebra rw quotientAlgebra.ringOf unfold ambientAlgebra rw polynomialAlgebra.ring instance fibreRing.comm_ring shows CommRing(Algebra.ring(fibreAlgebra)) proof have fibre := fibreAlgebra.algebra exact Algebra.comm_ring with fibre theorem fibreAlgebra.structure_map shows Algebra.map(fibreAlgebra) : complexRing →+* Algebra.ring(fibreAlgebra) proof have fibre := fibreAlgebra.algebra have map := fibre.right.right.right rw fibreAlgebra.base at map exact map theorem fibreProjection.ring_hom shows fibreProjection : polynomialRing(complexRing, 4) →+* Algebra.ring(fibreAlgebra) proof have ambient := ambientAlgebra.algebra have ideal := fibreIdeal.ideal have projection := algebraProjection.ring_hom with ambient, ideal rw fibreAlgebra.ring unfold fibreProjection rw ambientAlgebra.ring at projection exact projection theorem fibreProjection.algebra_hom shows fibreProjection : ambientAlgebra →ₐ fibreAlgebra proof have ambient := ambientAlgebra.algebra have ideal := fibreIdeal.ideal unfold fibreProjection unfold fibreAlgebra exact algebraProjection.hom with ambient, ideal instance fibreProjection.mem (p : Set) requires member : p ∈ Ring.carrier(polynomialRing(complexRing, 4)) shows fibreProjection(p) ∈ Ring.carrier(Algebra.ring(fibreAlgebra)) proof have projection := fibreProjection.ring_hom exact RingHom.map_mem with projection, member theorem fibreGenerators.subset shows {ambientF} ⊆ algebraCarrier(ambientAlgebra) proof unfold algebraCarrier rw ambientAlgebra.ring intros g hg rw singleton.membership at hg rw hg exact ambientF.mem with * theorem fibreProjection.F shows fibreProjection(ambientF) = Ring.zero(Algebra.ring(fibreAlgebra)) proof have ambient := ambientAlgebra.algebra have generators := fibreGenerators.subset have member : ambientF ∈ {ambientF} := singleton.self have killed := algebraProjection.kills_generator with ambient, generators, member rw fibreAlgebra.ring unfold fibreProjection unfold fibreIdeal rw ambientAlgebra.ring at killed unfold ambientAlgebra at killed unfold ambientAlgebra exact killed -- Every element of D is the class of a polynomial. theorem fibreAlgebra.representative (d : Set) requires member : d ∈ algebraCarrier(fibreAlgebra) shows ∃ x ∈ Ring.carrier(polynomialRing(complexRing, 4)), d = fibreProjection(x) proof have ambient := ambientAlgebra.algebra have ideal := fibreIdeal.ideal have ambientRing := Algebra.comm_ring with ambient unfold fibreAlgebra at member rw quotientAlgebra.carrierOf at member obtain ⟨x, hx, shape⟩ := quotientRing.representative with ambientRing, ideal, member have inAmbient : x ∈ algebraCarrier(ambientAlgebra) unfold algebraCarrier exact hx have projected := algebraProjection.value with ambient, ideal, inAmbient rw ambientAlgebra.ring at hx refine ⟨x, hx, ?_⟩ unfold fibreProjection rw projected unfold algebraCarrier exact shape -- The base B = ℂ[h, x, y, s] ⧸ (relH, relCusp): its ring and structure map, -- the classes h, x, y, s, and the three relations among them that the -- lifting needs. theorem baseAlgebra.algebra shows Algebra(baseAlgebra) proof unfold baseAlgebra exact planeAlgebra.algebra at complexRing with * theorem baseAlgebra.base shows Algebra.base(baseAlgebra) = complexRing proof unfold baseAlgebra unfold planeAlgebra rw quotientAlgebra.baseOf exact polynomialAlgebra.base instance baseRing.comm_ring shows CommRing(baseRing) proof have base := baseAlgebra.algebra unfold baseRing exact Algebra.comm_ring with base theorem baseAlgebra.structure_map shows Algebra.map(baseAlgebra) : complexRing →+* baseRing proof have base := baseAlgebra.algebra have map := base.right.right.right rw baseAlgebra.base at map unfold baseRing exact map instance baseH.mem shows baseH ∈ Ring.carrier(baseRing) proof unfold baseH unfold baseRing unfold baseAlgebra exact planeH.class_mem at complexRing with * instance baseX.mem shows baseX ∈ Ring.carrier(baseRing) proof unfold baseX unfold baseRing unfold baseAlgebra exact planeX.class_mem at complexRing with * instance baseY.mem shows baseY ∈ Ring.carrier(baseRing) proof unfold baseY unfold baseRing unfold baseAlgebra exact planeY.class_mem at complexRing with * instance baseS.mem shows baseS ∈ Ring.carrier(baseRing) proof unfold baseS unfold baseRing unfold baseAlgebra exact planeS.class_mem at complexRing with * -- The relation h = 1 + P(x, y, s) in B. theorem baseAlgebra.relation_h shows baseH = Ring.one(baseRing) + shiftP(baseRing, baseX, baseY, baseS) proof have complexes := complexRing.comm_ring have quotient := planeAlgebra.comm_ring at complexRing with complexes have plane := polynomialRing.comm_ring at complexRing, 2 with complexes unfold baseH unfold baseX unfold baseY unfold baseS unfold baseRing unfold baseAlgebra exact planeAlgebra.relation_h at complexRing with complexes, quotient, plane -- The cusp relation x² + y³ = hs in B. theorem baseAlgebra.relation_cusp shows baseX^2 + baseY^3 = baseH * baseS proof have complexes := complexRing.comm_ring have quotient := planeAlgebra.comm_ring at complexRing with complexes have plane := polynomialRing.comm_ring at complexRing, 2 with complexes unfold baseH unfold baseX unfold baseY unfold baseS unfold baseRing unfold baseAlgebra exact planeAlgebra.relation_cusp at complexRing with complexes, quotient, plane -- The Bézout relation αh + βy = 1 in B. theorem baseAlgebra.bezout shows bezoutAlpha(baseRing, baseX, baseS) * baseH + bezoutBeta(baseRing, baseX, baseY, baseS) * baseY = baseRing[1] proof have complexes := complexRing.comm_ring have quotient := planeAlgebra.comm_ring at complexRing with complexes have plane := polynomialRing.comm_ring at complexRing, 2 with complexes unfold baseH unfold baseX unfold baseY unfold baseS unfold baseRing unfold baseAlgebra exact planeAlgebra.bezout at complexRing with complexes, quotient, plane -- The lifted algebra L = B[U, V, W] ⧸ (relX, relY, relS): over B, and over -- ℂ by restriction of scalars; its ring, constants, variables, and the -- relations among them. theorem liftingAlgebra.over_base shows Algebra(liftingAlgebra(baseRing, baseH, baseX, baseY, baseS)) proof exact liftingAlgebra.algebra at baseRing, baseH, baseX, baseY, baseS with * theorem liftingAlgebra.base_of shows Algebra.base(liftingAlgebra(baseRing, baseH, baseX, baseY, baseS)) = baseRing proof unfold liftingAlgebra rw quotientAlgebra.baseOf exact polynomialAlgebra.base theorem liftedAlgebra.algebra shows Algebra(liftedAlgebra) proof have complexes := complexRing.comm_ring have lifting := liftingAlgebra.over_base have scalars := baseAlgebra.structure_map rw ← liftingAlgebra.base_of at scalars unfold liftedAlgebra exact restrictScalars.algebra with lifting, complexes, scalars theorem liftedAlgebra.base shows Algebra.base(liftedAlgebra) = complexRing proof unfold liftedAlgebra exact restrictScalars.base theorem liftedAlgebra.ring shows Algebra.ring(liftedAlgebra) = Algebra.ring(liftingAlgebra(baseRing, baseH, baseX, baseY, baseS)) proof unfold liftedAlgebra exact restrictScalars.ring instance liftedRing.comm_ring shows CommRing(Algebra.ring(liftedAlgebra)) proof rw liftedAlgebra.ring exact liftingAlgebra.comm_ring at baseRing, baseH, baseX, baseY, baseS with * theorem liftedConstant.ring_hom shows liftedConstant : baseRing →+* Algebra.ring(liftedAlgebra) proof rw liftedAlgebra.ring unfold liftedConstant exact liftingAlgebra.structure_hom at baseRing, baseH, baseX, baseY, baseS with * instance liftedConstant.mem (a : Set) requires member : a ∈ Ring.carrier(baseRing) shows liftedConstant(a) ∈ Ring.carrier(Algebra.ring(liftedAlgebra)) proof have hom := liftedConstant.ring_hom exact RingHom.map_mem with hom, member instance liftedU.mem shows liftedVariable(0) ∈ Ring.carrier(Algebra.ring(liftedAlgebra)) proof rw liftedAlgebra.ring unfold liftedVariable exact liftingU.mem at baseRing, baseH, baseX, baseY, baseS with * instance liftedV.mem shows liftedVariable(1) ∈ Ring.carrier(Algebra.ring(liftedAlgebra)) proof rw liftedAlgebra.ring unfold liftedVariable exact liftingV.mem at baseRing, baseH, baseX, baseY, baseS with * instance liftedW.mem shows liftedVariable(2) ∈ Ring.carrier(Algebra.ring(liftedAlgebra)) proof rw liftedAlgebra.ring unfold liftedVariable exact liftingW.mem at baseRing, baseH, baseX, baseY, baseS with * -- The structure map of L over ℂ factors through the constants of B. theorem liftedAlgebra.map_value (a : Set) requires member : a ∈ Ring.carrier(complexRing) shows Algebra.map(liftedAlgebra)(a) = liftedConstant(Algebra.map(baseAlgebra)(a)) proof have structureMap := baseAlgebra.structure_map have constantHom := liftedConstant.ring_hom have iota := structureMap.right.right.left have inner : Algebra.map(liftingAlgebra(baseRing, baseH, baseX, baseY, baseS)) : Ring.carrier(baseRing) → algebraCarrier(liftingAlgebra(baseRing, baseH, baseX, baseY, baseS)) unfold algebraCarrier rw ← liftedAlgebra.ring unfold liftedConstant at constantHom exact constantHom.right.right.left unfold liftedAlgebra rw restrictScalars.map rw liftingAlgebra.base_of rw compose.apply with iota, inner, member unfold liftedConstant rfl -- The constants B → L as a ℂ-algebra homomorphism. theorem liftedConstant.hom shows liftedConstant : baseAlgebra →ₐ liftedAlgebra proof have base := baseAlgebra.algebra have lifted := liftedAlgebra.algebra have ringHom := liftedConstant.ring_hom unfold baseRing at ringHom unfold AlgebraHom refine ⟨base, lifted, ?_, ringHom, ?_⟩ . rw [baseAlgebra.base, liftedAlgebra.base] . intros a aIn rw baseAlgebra.base at aIn symm exact liftedAlgebra.map_value with aIn -- The relations of L, with the plane relations of B supplied. theorem liftedAlgebra.relations shows liftedVariable(0)^3 + liftedConstant(baseH) * liftedVariable(1) = liftedConstant(baseX) ∧ -liftedVariable(0)^2 + liftedConstant(baseH) * liftedVariable(2) = liftedConstant(baseY) ∧ cuspS(Algebra.ring(liftedAlgebra), liftedConstant(baseH), liftedVariable(0), liftedVariable(1), liftedVariable(2)) = liftedConstant(baseS) proof have αIn : bezoutAlpha(baseRing, baseX, baseS) ∈ Ring.carrier(baseRing) by typecheck have βIn : bezoutBeta(baseRing, baseX, baseY, baseS) ∈ Ring.carrier(baseRing) by typecheck have cusp := baseAlgebra.relation_cusp have bezout := baseAlgebra.bezout have quotient := liftedRing.comm_ring rw liftedAlgebra.ring at quotient have relations := liftingAlgebra.relations at baseRing, baseH, baseX, baseY, baseS, bezoutAlpha(baseRing, baseX, baseS), bezoutBeta(baseRing, baseX, baseY, baseS) with * rw liftedAlgebra.ring unfold liftedVariable unfold liftedConstant exact relations -- The relation h = 1 + P(x, y, s) of B, read in L through the constants. theorem liftedConstant.relation_h shows liftedConstant(baseH) = Ring.one(Algebra.ring(liftedAlgebra)) + shiftP(Algebra.ring(liftedAlgebra), liftedConstant(baseX), liftedConstant(baseY), liftedConstant(baseS)) proof have constantHom := liftedConstant.ring_hom have relation := baseAlgebra.relation_h have shiftIn : shiftP(baseRing, baseX, baseY, baseS) ∈ Ring.carrier(baseRing) by typecheck have add := RingHom.map_add at liftedConstant, baseRing, Algebra.ring(liftedAlgebra), Ring.one(baseRing), shiftP(baseRing, baseX, baseY, baseS) with * have one := RingHom.map_one at liftedConstant, baseRing, Algebra.ring(liftedAlgebra) with * have shift := RingHom.map_shiftP at baseRing, Algebra.ring(liftedAlgebra), liftedConstant, baseX, baseY, baseS with * rw [relation, add, one, shift] -- Every element of L is the class of a polynomial over B. theorem liftedAlgebra.representative (l : Set) requires member : l ∈ algebraCarrier(liftedAlgebra) shows ∃ q ∈ Ring.carrier(polynomialRing(baseRing, 3)), l = algebraProjection(polynomialAlgebra(baseRing, 3), liftingIdeal(baseRing, baseH, baseX, baseY, baseS))(q) proof have polynomial := polynomialAlgebra.algebra at baseRing, 3 with * have ideal := liftingIdeal.ideal at baseRing, baseH, baseX, baseY, baseS with * have polynomials := Algebra.comm_ring with polynomial unfold algebraCarrier at member rw liftedAlgebra.ring at member unfold liftingAlgebra at member rw quotientAlgebra.ringOf at member obtain ⟨q, hq, shape⟩ := quotientRing.representative with polynomials, ideal, member have inPolynomial : q ∈ algebraCarrier(polynomialAlgebra(baseRing, 3)) unfold algebraCarrier exact hq have projected := algebraProjection.value with polynomial, ideal, inPolynomial rw polynomialAlgebra.ring at hq refine ⟨q, hq, ?_⟩ rw projected unfold algebraCarrier exact shape -- The ambient elements x, y, s, F under a ring homomorphism out of -- ℂ[h, u, v, w]: their shapes in terms of the images of the variables. section AmbientTransport variable (S f : Set) hypothesis target : CommRing(S) hypothesis hom : f : polynomialRing(complexRing, 4) →+* S theorem ambientX.map shows f(ambientX) = f(X(complexRing, 4, 1))^3 + f(X(complexRing, 4, 0)) * f(X(complexRing, 4, 2)) proof unfold ambientX simp [RingHom.map_add, RingHom.map_mul, RingHom.map_pow] theorem ambientY.map shows f(ambientY) = -f(X(complexRing, 4, 1))^2 + f(X(complexRing, 4, 0)) * f(X(complexRing, 4, 3)) proof unfold ambientY simp [RingHom.map_add, RingHom.map_mul, RingHom.map_neg, RingHom.map_pow] theorem ambientS.map shows f(ambientS) = cuspS(S, f(X(complexRing, 4, 0)), f(X(complexRing, 4, 1)), f(X(complexRing, 4, 2)), f(X(complexRing, 4, 3))) proof unfold ambientS exact cuspS.map with * theorem ambientF.map shows f(ambientF) = f(X(complexRing, 4, 0)) - shiftP(S, f(ambientX), f(ambientY), f(ambientS)) - Ring.one(S) proof have shift := RingHom.map_shiftP at polynomialRing(complexRing, 4), S, f, ambientX, ambientY, ambientS with * unfold ambientF unfold ambientP simp [RingHom.map_sub, RingHom.map_one, shift] end AmbientTransport -- The lifting relations of B[U, V, W] under a ring homomorphism out of it. section LiftingTransport variable (B S f : Set) hypothesis base : CommRing(B) hypothesis target : CommRing(S) hypothesis hom : f : polynomialRing(B, 3) →+* S theorem relX.map (h x : B) shows f(relX(B, h, x)) = f(X(B, 3, 0))^3 + f(polynomialConstant(B, 3)(h)) * f(X(B, 3, 1)) - f(polynomialConstant(B, 3)(x)) proof unfold relX simp [RingHom.map_add, RingHom.map_sub, RingHom.map_mul, RingHom.map_pow] theorem relY.map (h y : B) shows f(relY(B, h, y)) = -f(X(B, 3, 0))^2 + f(polynomialConstant(B, 3)(h)) * f(X(B, 3, 2)) - f(polynomialConstant(B, 3)(y)) proof unfold relY simp [RingHom.map_add, RingHom.map_sub, RingHom.map_mul, RingHom.map_neg, RingHom.map_pow] theorem relS.map (h s : B) shows f(relS(B, h, s)) = cuspS(S, f(polynomialConstant(B, 3)(h)), f(X(B, 3, 0)), f(X(B, 3, 1)), f(X(B, 3, 2))) - f(polynomialConstant(B, 3)(s)) proof have image := cuspS.map at polynomialRing(B, 3), S, f, polynomialConstant(B, 3)(h), X(B, 3, 0), X(B, 3, 1), X(B, 3, 2) with * unfold relS simp [RingHom.map_sub, image] end LiftingTransport -- B → D. The evaluation auxEval : ℂ[h, x, y, s] → D sends the variables to -- the classes of h, x, y, s; the plane relations hold among those classes, -- so auxEval descends to auxToD : B → D. theorem auxValues.function shows auxValues : 4 → algebraCarrier(fibreAlgebra) proof unfold auxValues unfold algebraCarrier exact quadrupleMap.function with * theorem auxValues.values shows auxValues(0) = fibreProjection(X(complexRing, 4, 0)) ∧ auxValues(1) = fibreProjection(ambientX) ∧ auxValues(2) = fibreProjection(ambientY) ∧ auxValues(3) = fibreProjection(ambientS) proof unfold auxValues unfold algebraCarrier refine ⟨?_, ?_, ?_, ?_⟩ . exact quadrupleMap.zero with * . exact quadrupleMap.one with * . exact quadrupleMap.two with * . exact quadrupleMap.three with * theorem auxEval.algebra_hom shows auxEval : ambientAlgebra →ₐ fibreAlgebra proof have complexes := complexRing.comm_ring have fibre := fibreAlgebra.algebra have over := fibreAlgebra.base have values := auxValues.function unfold auxEval unfold ambientAlgebra exact evaluationHom.algebra_hom at complexRing, 4, fibreAlgebra, auxValues with complexes, fibre, over, values theorem auxEval.hom shows auxEval : polynomialRing(complexRing, 4) →+* Algebra.ring(fibreAlgebra) proof have hom := auxEval.algebra_hom have ringHom := AlgebraHom.ring_hom with hom rw ambientAlgebra.ring at ringHom exact ringHom theorem auxEval.variable (i : Set) requires index : i ∈ 4 shows auxEval(X(complexRing, 4, i)) = auxValues(i) proof have complexes := complexRing.comm_ring have fibre := fibreAlgebra.algebra have over := fibreAlgebra.base have values := auxValues.function unfold auxEval exact evaluationHom.algebra_X at complexRing, 4, fibreAlgebra, auxValues, i with complexes, fibre, over, values, index theorem auxEval.H shows auxEval(X(complexRing, 4, 0)) = fibreProjection(X(complexRing, 4, 0)) proof have zero : 0 ∈ 4 by simp [membership.four] have values := auxValues.values rw auxEval.variable with zero exact values.left theorem auxEval.X shows auxEval(X(complexRing, 4, 1)) = fibreProjection(ambientX) proof have one : 1 ∈ 4 by simp [membership.four] have values := auxValues.values rw auxEval.variable with one exact values.right.left theorem auxEval.Y shows auxEval(X(complexRing, 4, 2)) = fibreProjection(ambientY) proof have two : 2 ∈ 4 by simp [membership.four] have values := auxValues.values rw auxEval.variable with two exact values.right.right.left theorem auxEval.S shows auxEval(X(complexRing, 4, 3)) = fibreProjection(ambientS) proof have three : 3 ∈ 4 by simp [membership.four] have values := auxValues.values rw auxEval.variable with three exact values.right.right.right -- The relation h = 1 + P(x, y, s) among the classes in D, from F = 0. theorem fibreProjection.relation shows fibreProjection(X(complexRing, 4, 0)) = Ring.one(Algebra.ring(fibreAlgebra)) + shiftP(Algebra.ring(fibreAlgebra), fibreProjection(ambientX), fibreProjection(ambientY), fibreProjection(ambientS)) proof have fibre := fibreRing.comm_ring have projection := fibreProjection.ring_hom have vanish := fibreProjection.F have mapped := ambientF.map with fibre, projection rw mapped at vanish linear_combination vanish -- The cusp relation among the classes in D, from the cusp identity. theorem fibreProjection.cusp shows fibreProjection(ambientX)^2 + fibreProjection(ambientY)^3 = fibreProjection(X(complexRing, 4, 0)) * fibreProjection(ambientS) proof have ambient := polynomialRing.comm_ring at complexRing, 4 with * have projection := fibreProjection.ring_hom have mapped : fibreProjection(ambientX^2 + ambientY^3) = fibreProjection(X(complexRing, 4, 0) * ambientS) have cusp := ambient.cusp with * rw cusp simp [RingHom.map_add, RingHom.map_mul, RingHom.map_pow] at mapped exact mapped theorem auxEval.relH shows auxEval(relH(complexRing)) = Ring.zero(Algebra.ring(fibreAlgebra)) proof have complexes := complexRing.comm_ring have fibre := fibreRing.comm_ring have hom := auxEval.hom have relation := fibreProjection.relation have mapped := RingHom.map_relH with complexes, fibre, hom rw [mapped, auxEval.H, auxEval.X, auxEval.Y, auxEval.S] linear_combination relation theorem auxEval.relCusp shows auxEval(relCusp(complexRing)) = Ring.zero(Algebra.ring(fibreAlgebra)) proof have complexes := complexRing.comm_ring have fibre := fibreRing.comm_ring have hom := auxEval.hom have cusp := fibreProjection.cusp have mapped := RingHom.map_relCusp with complexes, fibre, hom rw [mapped, auxEval.H, auxEval.X, auxEval.Y, auxEval.S] linear_combination cusp theorem planeRelations.generators shows planeRelations(complexRing) ⊆ algebraCarrier(ambientAlgebra) proof unfold algebraCarrier rw ambientAlgebra.ring intros g hg unfold planeRelations at hg simp [pair.membership] at hg rcases hg with rfl | rfl . unfold relH typecheck . unfold relCusp typecheck theorem auxEval.kills shows ∀ g ∈ planeRelations(complexRing), auxEval(g) = Ring.zero(Algebra.ring(fibreAlgebra)) proof intros g hg unfold planeRelations at hg simp [pair.membership] at hg rcases hg with rfl | rfl . exact auxEval.relH . exact auxEval.relCusp theorem auxToD.hom shows auxToD : baseAlgebra →ₐ fibreAlgebra proof have ambient := ambientAlgebra.algebra have generators := planeRelations.generators have hom := auxEval.algebra_hom have killed := auxEval.kills have lifted := AlgebraHom.lift_generated at ambientAlgebra, planeRelations(complexRing), auxEval, fibreAlgebra with ambient, generators, hom, killed rw ambientAlgebra.ring at lifted unfold ambientAlgebra at lifted unfold auxToD unfold baseAlgebra unfold planeAlgebra unfold planeIdeal unfold ambientAlgebra exact lifted theorem auxToD.ring_hom shows auxToD : baseRing →+* Algebra.ring(fibreAlgebra) proof have hom := auxToD.hom unfold baseRing exact AlgebraHom.ring_hom with hom -- auxToD on the classes of h, x, y, s. theorem auxToD.variable (i : Set) requires index : i ∈ 4 shows auxToD(planeVariable(complexRing, i)) = auxEval(X(complexRing, 4, i)) proof have ambient := ambientAlgebra.algebra have generators := planeRelations.generators have hom := auxEval.algebra_hom have killed := auxEval.kills have member : X(complexRing, 4, i) ∈ algebraCarrier(ambientAlgebra) unfold algebraCarrier rw ambientAlgebra.ring exact X.mem at complexRing, 4, i with * have factors := AlgebraHom.lift_generated_factors at ambientAlgebra, planeRelations(complexRing), auxEval, fibreAlgebra, X(complexRing, 4, i) with ambient, generators, hom, killed, member rw ambientAlgebra.ring at factors unfold ambientAlgebra at factors unfold auxToD unfold planeVariable unfold planeIdeal unfold ambientAlgebra exact factors theorem auxToD.H shows auxToD(baseH) = fibreProjection(X(complexRing, 4, 0)) proof have zero : 0 ∈ 4 by simp [membership.four] unfold baseH rw auxToD.variable with zero exact auxEval.H theorem auxToD.X shows auxToD(baseX) = fibreProjection(ambientX) proof have one : 1 ∈ 4 by simp [membership.four] unfold baseX rw auxToD.variable with one exact auxEval.X theorem auxToD.Y shows auxToD(baseY) = fibreProjection(ambientY) proof have two : 2 ∈ 4 by simp [membership.four] unfold baseY rw auxToD.variable with two exact auxEval.Y theorem auxToD.S shows auxToD(baseS) = fibreProjection(ambientS) proof have three : 3 ∈ 4 by simp [membership.four] unfold baseS rw auxToD.variable with three exact auxEval.S -- B[U, V, W] → D. The evaluation liftEval over auxToD sends U, V, W to the -- classes of u, v, w; the lifting relations hold among those classes, so -- liftEval descends to toOriginal : L → D, first over B and then over ℂ. theorem liftValues.function shows liftValues : 3 → Ring.carrier(Algebra.ring(fibreAlgebra)) proof unfold liftValues unfold algebraCarrier exact tripleMap.function with * theorem liftValues.values shows liftValues(0) = fibreProjection(X(complexRing, 4, 1)) ∧ liftValues(1) = fibreProjection(X(complexRing, 4, 2)) ∧ liftValues(2) = fibreProjection(X(complexRing, 4, 3)) proof unfold liftValues unfold algebraCarrier exact tripleMap.value with * theorem liftEval.hom shows liftEval : polynomialRing(baseRing, 3) →+* Algebra.ring(fibreAlgebra) proof have baseRing := baseRing.comm_ring have fibre := fibreRing.comm_ring have hom := auxToD.ring_hom have values := liftValues.function unfold liftEval exact evaluationHom.hom at baseRing, Algebra.ring(fibreAlgebra), 3, auxToD, liftValues with baseRing, fibre, hom, values theorem liftEval.variable (j : Set) requires index : j ∈ 3 shows liftEval(X(baseRing, 3, j)) = liftValues(j) proof have baseRing := baseRing.comm_ring have fibre := fibreRing.comm_ring have hom := auxToD.ring_hom have values := liftValues.function unfold liftEval exact evaluationHom.map_X at baseRing, Algebra.ring(fibreAlgebra), 3, auxToD, liftValues, j with baseRing, fibre, hom, values, index theorem liftEval.constant (a : Set) requires member : a ∈ Ring.carrier(baseRing) shows liftEval(polynomialConstant(baseRing, 3)(a)) = auxToD(a) proof have baseRing := baseRing.comm_ring have fibre := fibreRing.comm_ring have hom := auxToD.ring_hom have values := liftValues.function unfold liftEval exact evaluationHom.map_constant at baseRing, Algebra.ring(fibreAlgebra), 3, auxToD, liftValues, a with baseRing, fibre, hom, values theorem liftEval.U shows liftEval(X(baseRing, 3, 0)) = fibreProjection(X(complexRing, 4, 1)) proof have zero : 0 ∈ 3 by simp [membership.three] have values := liftValues.values rw liftEval.variable with zero exact values.left theorem liftEval.V shows liftEval(X(baseRing, 3, 1)) = fibreProjection(X(complexRing, 4, 2)) proof have one : 1 ∈ 3 by simp [membership.three] have values := liftValues.values rw liftEval.variable with one exact values.right.left theorem liftEval.W shows liftEval(X(baseRing, 3, 2)) = fibreProjection(X(complexRing, 4, 3)) proof have two : 2 ∈ 3 by simp [membership.three] have values := liftValues.values rw liftEval.variable with two exact values.right.right -- The lifting relations hold among the classes of u, v, w in D: each is -- the image under the projection of a definition in ℂ[h, u, v, w]. theorem liftEval.relX shows liftEval(relX(baseRing, baseH, baseX)) = Ring.zero(Algebra.ring(fibreAlgebra)) proof have fibre := fibreRing.comm_ring have hom := liftEval.hom have projection := fibreProjection.ring_hom have mapped := relX.map at baseRing, Algebra.ring(fibreAlgebra), liftEval, baseH, baseX with * have h := liftEval.constant at baseH with * have x := liftEval.constant at baseX with * have image := ambientX.map with fibre, projection rw [mapped, h, x, liftEval.U, liftEval.V, auxToD.H, auxToD.X, image] ring theorem liftEval.relY shows liftEval(relY(baseRing, baseH, baseY)) = Ring.zero(Algebra.ring(fibreAlgebra)) proof have fibre := fibreRing.comm_ring have hom := liftEval.hom have projection := fibreProjection.ring_hom have mapped := relY.map at baseRing, Algebra.ring(fibreAlgebra), liftEval, baseH, baseY with * have h := liftEval.constant at baseH with * have y := liftEval.constant at baseY with * have image := ambientY.map with fibre, projection rw [mapped, h, y, liftEval.U, liftEval.W, auxToD.H, auxToD.Y, image] ring theorem liftEval.relS shows liftEval(relS(baseRing, baseH, baseS)) = Ring.zero(Algebra.ring(fibreAlgebra)) proof have fibre := fibreRing.comm_ring have hom := liftEval.hom have projection := fibreProjection.ring_hom have mapped := relS.map at baseRing, Algebra.ring(fibreAlgebra), liftEval, baseH, baseS with * have h := liftEval.constant at baseH with * have s := liftEval.constant at baseS with * have image := ambientS.map with fibre, projection rw [mapped, h, s, liftEval.U, liftEval.V, liftEval.W, auxToD.H, auxToD.S, image] unfold cuspS ring -- D as an algebra over B through auxToD; liftEval is the evaluation over -- B, and toOriginal its lift to L over B. def fibreOverBase : Set := Algebra.mk(baseRing, Algebra.ring(fibreAlgebra), auxToD) theorem fibreOverBase.base shows Algebra.base(fibreOverBase) = baseRing proof unfold fibreOverBase rw Algebra.mk.base theorem fibreOverBase.ring shows Algebra.ring(fibreOverBase) = Algebra.ring(fibreAlgebra) proof unfold fibreOverBase rw Algebra.mk.ring theorem fibreOverBase.map shows Algebra.map(fibreOverBase) = auxToD proof unfold fibreOverBase rw Algebra.mk.map theorem fibreOverBase.carrier shows algebraCarrier(fibreOverBase) = algebraCarrier(fibreAlgebra) proof unfold algebraCarrier rw fibreOverBase.ring theorem fibreOverBase.algebra shows Algebra(fibreOverBase) proof have baseRing := baseRing.comm_ring have fibre := fibreRing.comm_ring have hom := auxToD.ring_hom unfold fibreOverBase exact Algebra.intro with baseRing, fibre, hom theorem liftEval.algebra_hom shows liftEval : polynomialAlgebra(baseRing, 3) →ₐ fibreOverBase proof have baseRing := baseRing.comm_ring have algebra := fibreOverBase.algebra have over := fibreOverBase.base have values : liftValues : 3 → algebraCarrier(fibreOverBase) rw fibreOverBase.carrier unfold algebraCarrier exact liftValues.function have hom := evaluationHom.algebra_hom at baseRing, 3, fibreOverBase, liftValues with baseRing, algebra, over, values rw [fibreOverBase.ring, fibreOverBase.map] at hom unfold liftEval exact hom theorem liftingRelations.generators shows liftingRelations(baseRing, baseH, baseX, baseY, baseS) ⊆ algebraCarrier(polynomialAlgebra(baseRing, 3)) proof unfold algebraCarrier rw polynomialAlgebra.ring intros g hg unfold liftingRelations at hg simp [pair.membership] at hg rcases hg with rfl | rfl | rfl . unfold relX typecheck . unfold relY typecheck . unfold relS typecheck theorem liftEval.kills shows ∀ g ∈ liftingRelations(baseRing, baseH, baseX, baseY, baseS), liftEval(g) = Ring.zero(Algebra.ring(fibreOverBase)) proof rw fibreOverBase.ring intros g hg unfold liftingRelations at hg simp [pair.membership] at hg rcases hg with rfl | rfl | rfl . exact liftEval.relX . exact liftEval.relY . exact liftEval.relS theorem toOriginal.over_base shows toOriginal : liftingAlgebra(baseRing, baseH, baseX, baseY, baseS) →ₐ fibreOverBase proof have polynomial := polynomialAlgebra.algebra at baseRing, 3 with * have generators := liftingRelations.generators have hom := liftEval.algebra_hom have killed := liftEval.kills have lifted := AlgebraHom.lift_generated at polynomialAlgebra(baseRing, 3), liftingRelations(baseRing, baseH, baseX, baseY, baseS), liftEval, fibreOverBase with polynomial, generators, hom, killed rw polynomialAlgebra.ring at lifted unfold algebraLift at lifted rw fibreOverBase.carrier at lifted unfold algebraCarrier at lifted rw polynomialAlgebra.ring at lifted unfold toOriginal unfold algebraCarrier unfold liftingAlgebra unfold liftingIdeal exact lifted theorem toOriginal.hom shows toOriginal : liftedAlgebra →ₐ fibreAlgebra proof have complexes := complexRing.comm_ring have over := toOriginal.over_base have scalars := baseAlgebra.structure_map rw ← liftingAlgebra.base_of at scalars have restricted := AlgebraHom.restrict with over, complexes, scalars have fibre := fibreAlgebra.algebra have base : Algebra.base(restrictScalars(fibreOverBase, complexRing, Algebra.map(baseAlgebra))) = Algebra.base(fibreAlgebra) rw [restrictScalars.base, fibreAlgebra.base] have ring : Algebra.ring(restrictScalars(fibreOverBase, complexRing, Algebra.map(baseAlgebra))) = Algebra.ring(fibreAlgebra) rw [restrictScalars.ring, fibreOverBase.ring] have map : ∀ a ∈ Ring.carrier(Algebra.base(fibreAlgebra)), Algebra.map(restrictScalars(fibreOverBase, complexRing, Algebra.map(baseAlgebra)))(a) = Algebra.map(fibreAlgebra)(a) intros a aIn rw fibreAlgebra.base at aIn have structureMap := baseAlgebra.structure_map have iota := structureMap.right.right.left have auxRingHom := auxToD.ring_hom have inner : Algebra.map(fibreOverBase) : Ring.carrier(baseRing) → algebraCarrier(fibreOverBase) rw [fibreOverBase.carrier, fibreOverBase.map] unfold algebraCarrier exact auxRingHom.right.right.left rw restrictScalars.map rw fibreOverBase.base rw compose.apply with iota, inner, aIn rw fibreOverBase.map have auxHom := auxToD.hom have member : a ∈ Ring.carrier(Algebra.base(baseAlgebra)) rw baseAlgebra.base exact aIn exact AlgebraHom.map_base with auxHom, member unfold liftedAlgebra exact AlgebraHom.transfer with restricted, fibre, base, ring, map -- toOriginal on the classes of L: the variables and the constants. theorem toOriginal.class (q : Set) requires member : q ∈ Ring.carrier(polynomialRing(baseRing, 3)) shows toOriginal(algebraProjection(polynomialAlgebra(baseRing, 3), liftingIdeal(baseRing, baseH, baseX, baseY, baseS))(q)) = liftEval(q) proof have polynomial := polynomialAlgebra.algebra at baseRing, 3 with * have generators := liftingRelations.generators have hom := liftEval.algebra_hom have killed := liftEval.kills have inPolynomial : q ∈ algebraCarrier(polynomialAlgebra(baseRing, 3)) unfold algebraCarrier rw polynomialAlgebra.ring exact member have factors := AlgebraHom.lift_generated_factors at polynomialAlgebra(baseRing, 3), liftingRelations(baseRing, baseH, baseX, baseY, baseS), liftEval, fibreOverBase, q with polynomial, generators, hom, killed, inPolynomial rw polynomialAlgebra.ring at factors unfold algebraLift at factors rw fibreOverBase.carrier at factors unfold algebraCarrier at factors rw polynomialAlgebra.ring at factors unfold toOriginal unfold algebraCarrier unfold liftingIdeal exact factors theorem toOriginal.U shows toOriginal(liftedVariable(0)) = fibreProjection(X(complexRing, 4, 1)) proof have member := X.mem at baseRing, 3, 0 with * unfold liftedVariable unfold liftingVariable rw toOriginal.class with member exact liftEval.U theorem toOriginal.V shows toOriginal(liftedVariable(1)) = fibreProjection(X(complexRing, 4, 2)) proof have member := X.mem at baseRing, 3, 1 with * unfold liftedVariable unfold liftingVariable rw toOriginal.class with member exact liftEval.V theorem toOriginal.W shows toOriginal(liftedVariable(2)) = fibreProjection(X(complexRing, 4, 3)) proof have member := X.mem at baseRing, 3, 2 with * unfold liftedVariable unfold liftingVariable rw toOriginal.class with member exact liftEval.W theorem toOriginal.constant (b : Set) requires member : b ∈ Ring.carrier(baseRing) shows toOriginal(liftedConstant(b)) = auxToD(b) proof have constant := liftingProjection.constant at baseRing, baseH, baseX, baseY, baseS, b with * have inPolynomial := polynomialConstant.mem at baseRing, 3, b with * unfold liftedConstant rw ← constant rw toOriginal.class with inPolynomial exact liftEval.constant with member -- ℂ[h, u, v, w] → L. The evaluation originalEval sends h to the constant h -- and u, v, w to U, V, W; it kills F, so it descends to -- fromOriginal : D → L. theorem originalValues.function shows originalValues : 4 → algebraCarrier(liftedAlgebra) proof unfold originalValues unfold algebraCarrier exact quadrupleMap.function with * theorem originalValues.values shows originalValues(0) = liftedConstant(baseH) ∧ originalValues(1) = liftedVariable(0) ∧ originalValues(2) = liftedVariable(1) ∧ originalValues(3) = liftedVariable(2) proof unfold originalValues unfold algebraCarrier refine ⟨?_, ?_, ?_, ?_⟩ . exact quadrupleMap.zero with * . exact quadrupleMap.one with * . exact quadrupleMap.two with * . exact quadrupleMap.three with * theorem originalEval.algebra_hom shows originalEval : ambientAlgebra →ₐ liftedAlgebra proof have complexes := complexRing.comm_ring have lifted := liftedAlgebra.algebra have over := liftedAlgebra.base have values := originalValues.function unfold originalEval unfold ambientAlgebra exact evaluationHom.algebra_hom at complexRing, 4, liftedAlgebra, originalValues with complexes, lifted, over, values theorem originalEval.hom shows originalEval : polynomialRing(complexRing, 4) →+* Algebra.ring(liftedAlgebra) proof have hom := originalEval.algebra_hom have ringHom := AlgebraHom.ring_hom with hom rw ambientAlgebra.ring at ringHom exact ringHom theorem originalEval.variable (i : Set) requires index : i ∈ 4 shows originalEval(X(complexRing, 4, i)) = originalValues(i) proof have complexes := complexRing.comm_ring have lifted := liftedAlgebra.algebra have over := liftedAlgebra.base have values := originalValues.function unfold originalEval exact evaluationHom.algebra_X at complexRing, 4, liftedAlgebra, originalValues, i with complexes, lifted, over, values, index theorem originalEval.H shows originalEval(X(complexRing, 4, 0)) = liftedConstant(baseH) proof have zero : 0 ∈ 4 by simp [membership.four] have values := originalValues.values rw originalEval.variable with zero exact values.left theorem originalEval.U shows originalEval(X(complexRing, 4, 1)) = liftedVariable(0) proof have one : 1 ∈ 4 by simp [membership.four] have values := originalValues.values rw originalEval.variable with one exact values.right.left theorem originalEval.V shows originalEval(X(complexRing, 4, 2)) = liftedVariable(1) proof have two : 2 ∈ 4 by simp [membership.four] have values := originalValues.values rw originalEval.variable with two exact values.right.right.left theorem originalEval.W shows originalEval(X(complexRing, 4, 3)) = liftedVariable(2) proof have three : 3 ∈ 4 by simp [membership.four] have values := originalValues.values rw originalEval.variable with three exact values.right.right.right -- The elements x, y, s of ℂ[h, u, v, w] go to the constants x, y, s of L, -- by the relations of L. theorem originalEval.ambientX shows originalEval(ambientX) = liftedConstant(baseX) proof have lifted := liftedRing.comm_ring have hom := originalEval.hom have relations := liftedAlgebra.relations have mapped := ambientX.map with lifted, hom rw [mapped, originalEval.H, originalEval.U, originalEval.V] exact relations.left theorem originalEval.ambientY shows originalEval(ambientY) = liftedConstant(baseY) proof have lifted := liftedRing.comm_ring have hom := originalEval.hom have relations := liftedAlgebra.relations have mapped := ambientY.map with lifted, hom rw [mapped, originalEval.H, originalEval.U, originalEval.W] exact relations.right.left theorem originalEval.ambientS shows originalEval(ambientS) = liftedConstant(baseS) proof have lifted := liftedRing.comm_ring have hom := originalEval.hom have relations := liftedAlgebra.relations have mapped := ambientS.map with lifted, hom rw [mapped, originalEval.H, originalEval.U, originalEval.V, originalEval.W] exact relations.right.right -- F vanishes under h ↦ h, u ↦ U, v ↦ V, w ↦ W in L. theorem originalEval.F shows originalEval(ambientF) = Ring.zero(Algebra.ring(liftedAlgebra)) proof have lifted := liftedRing.comm_ring have hom := originalEval.hom have mapped := ambientF.map with lifted, hom have relation := liftedConstant.relation_h rw [mapped, originalEval.ambientX, originalEval.ambientY, originalEval.ambientS, originalEval.H, relation] ring theorem originalEval.kills shows ∀ g ∈ {ambientF}, originalEval(g) = Ring.zero(Algebra.ring(liftedAlgebra)) proof intros g hg rw singleton.membership at hg rw hg exact originalEval.F theorem fromOriginal.hom shows fromOriginal : fibreAlgebra →ₐ liftedAlgebra proof have ambient := ambientAlgebra.algebra have generators := fibreGenerators.subset have hom := originalEval.algebra_hom have killed := originalEval.kills have lifted := AlgebraHom.lift_generated at ambientAlgebra, {ambientF}, originalEval, liftedAlgebra with ambient, generators, hom, killed rw ambientAlgebra.ring at lifted unfold fromOriginal unfold fibreAlgebra unfold fibreIdeal exact lifted theorem fromOriginal.ring_hom shows fromOriginal : Algebra.ring(fibreAlgebra) →+* Algebra.ring(liftedAlgebra) proof have hom := fromOriginal.hom exact AlgebraHom.ring_hom with hom theorem fromOriginal.class (x : Set) requires member : x ∈ Ring.carrier(polynomialRing(complexRing, 4)) shows fromOriginal(fibreProjection(x)) = originalEval(x) proof have ambient := ambientAlgebra.algebra have generators := fibreGenerators.subset have hom := originalEval.algebra_hom have killed := originalEval.kills have inAmbient : x ∈ algebraCarrier(ambientAlgebra) unfold algebraCarrier rw ambientAlgebra.ring exact member have factors := AlgebraHom.lift_generated_factors at ambientAlgebra, {ambientF}, originalEval, liftedAlgebra, x with ambient, generators, hom, killed, inAmbient rw ambientAlgebra.ring at factors unfold fromOriginal unfold fibreProjection unfold fibreIdeal exact factors -- The two composites are the identities. Each is checked on generators: -- toOriginal ∘ originalEval is the projection onto D, and -- fromOriginal ∘ liftEval is the projection onto L. theorem toOriginal.after_original (x : Set) requires member : x ∈ Ring.carrier(polynomialRing(complexRing, 4)) shows toOriginal(originalEval(x)) = fibreProjection(x) proof have complexes := complexRing.comm_ring have hIn := baseH.mem have originalHom := originalEval.algebra_hom have toHom := toOriginal.hom have first := AlgebraHom.compose with originalHom, toHom have second := fibreProjection.algebra_hom have originalFunction := AlgebraHom.function with originalHom have toFunction := AlgebraHom.function with toHom unfold ambientAlgebra at first unfold ambientAlgebra at second unfold ambientAlgebra at originalFunction have agree : ∀ j ∈ 4, compose(toOriginal, originalEval, algebraCarrier(polynomialAlgebra(complexRing, 4)), algebraCarrier(liftedAlgebra), algebraCarrier(fibreAlgebra))( X(complexRing, 4, j)) = fibreProjection(X(complexRing, 4, j)) intros j hj have inPolynomial : X(complexRing, 4, j) ∈ algebraCarrier(polynomialAlgebra(complexRing, 4)) rw polynomialAlgebra.carrierOf exact X.mem at complexRing, 4, j with complexes rw compose.apply with originalFunction, toFunction, inPolynomial have index := membership.four.forward with hj rcases index with rfl | rfl | rfl | rfl . rw [originalEval.H, toOriginal.constant with hIn, auxToD.H] . rw [originalEval.U, toOriginal.U] . rw [originalEval.V, toOriginal.V] . rw [originalEval.W, toOriginal.W] have equal := AlgebraHom.polynomial_ext at complexRing, 4, fibreAlgebra, compose(toOriginal, originalEval, algebraCarrier(polynomialAlgebra(complexRing, 4)), algebraCarrier(liftedAlgebra), algebraCarrier(fibreAlgebra)), fibreProjection with complexes, first, second, agree have inPolynomial : x ∈ algebraCarrier(polynomialAlgebra(complexRing, 4)) rw polynomialAlgebra.carrierOf exact member rw ← equal rw compose.apply with originalFunction, toFunction, inPolynomial theorem toOriginal.after_from (d : Set) requires member : d ∈ algebraCarrier(fibreAlgebra) shows toOriginal(fromOriginal(d)) = d proof obtain ⟨x, hx, shape⟩ := fibreAlgebra.representative with member rw shape rw fromOriginal.class with hx exact toOriginal.after_original with hx -- fromOriginal after auxToD is the constants map B → L. theorem fromOriginal.after_aux (b : Set) requires member : b ∈ Ring.carrier(baseRing) shows fromOriginal(auxToD(b)) = liftedConstant(b) proof have complexes := complexRing.comm_ring have auxHom := auxToD.hom have fromHom := fromOriginal.hom have first := AlgebraHom.compose with auxHom, fromHom have second := liftedConstant.hom have auxFunction := AlgebraHom.function with auxHom have fromFunction := AlgebraHom.function with fromHom unfold baseAlgebra at first unfold baseAlgebra at second unfold baseAlgebra at auxFunction have agree : ∀ i ∈ 4, compose(fromOriginal, auxToD, algebraCarrier(planeAlgebra(complexRing)), algebraCarrier(fibreAlgebra), algebraCarrier(liftedAlgebra))(planeVariable(complexRing, i)) = liftedConstant(planeVariable(complexRing, i)) intros i hi have inBase : planeVariable(complexRing, i) ∈ algebraCarrier(planeAlgebra(complexRing)) unfold algebraCarrier exact planeVariable.mem at complexRing, i with complexes, hi rw compose.apply with auxFunction, fromFunction, inBase have index := membership.four.forward with hi rcases index with rfl | rfl | rfl | rfl . have value := auxToD.H have result := originalEval.H unfold baseH at value unfold baseH at result rw value rw fromOriginal.class with * exact result . have value := auxToD.X have result := originalEval.ambientX unfold baseX at value unfold baseX at result rw value rw fromOriginal.class with * exact result . have value := auxToD.Y have result := originalEval.ambientY unfold baseY at value unfold baseY at result rw value rw fromOriginal.class with * exact result . have value := auxToD.S have result := originalEval.ambientS unfold baseS at value unfold baseS at result rw value rw fromOriginal.class with * exact result have equal := planeAlgebra.hom_ext at complexRing, compose(fromOriginal, auxToD, algebraCarrier(planeAlgebra(complexRing)), algebraCarrier(fibreAlgebra), algebraCarrier(liftedAlgebra)), liftedConstant, liftedAlgebra with complexes, first, second, agree have inBase : b ∈ algebraCarrier(planeAlgebra(complexRing)) unfold algebraCarrier unfold baseRing at member unfold baseAlgebra at member exact member rw ← equal rw compose.apply with auxFunction, fromFunction, inBase -- fromOriginal after liftEval is the projection onto L. theorem fromOriginal.after_lift (q : Set) requires member : q ∈ Ring.carrier(polynomialRing(baseRing, 3)) shows fromOriginal(liftEval(q)) = algebraProjection(polynomialAlgebra(baseRing, 3), liftingIdeal(baseRing, baseH, baseX, baseY, baseS))(q) proof have baseRing := baseRing.comm_ring have polynomials := polynomialRing.comm_ring at baseRing, 3 with * have liftHom := liftEval.hom have fromHom := fromOriginal.ring_hom have first := RingHom.comp with polynomials, liftHom, fromHom have second := liftingProjection.ring_hom at baseRing, baseH, baseX, baseY, baseS with * rw ← liftedAlgebra.ring at second have liftFunction := liftHom.right.right.left have fromFunction := fromHom.right.right.left have constants : ∀ b ∈ Ring.carrier(baseRing), compose(fromOriginal, liftEval, Ring.carrier(polynomialRing(baseRing, 3)), Ring.carrier(Algebra.ring(fibreAlgebra)), Ring.carrier(Algebra.ring(liftedAlgebra)))( polynomialConstant(baseRing, 3)(b)) = algebraProjection(polynomialAlgebra(baseRing, 3), liftingIdeal(baseRing, baseH, baseX, baseY, baseS))( polynomialConstant(baseRing, 3)(b)) intros b bIn have inPolynomial := polynomialConstant.mem at baseRing, 3, b with * have constant := liftingProjection.constant at baseRing, baseH, baseX, baseY, baseS, b with * rw compose.apply with liftFunction, fromFunction, inPolynomial rw liftEval.constant with bIn rw fromOriginal.after_aux with bIn rw constant unfold liftedConstant rfl have variables : ∀ j ∈ 3, compose(fromOriginal, liftEval, Ring.carrier(polynomialRing(baseRing, 3)), Ring.carrier(Algebra.ring(fibreAlgebra)), Ring.carrier(Algebra.ring(liftedAlgebra)))(X(baseRing, 3, j)) = algebraProjection(polynomialAlgebra(baseRing, 3), liftingIdeal(baseRing, baseH, baseX, baseY, baseS))(X(baseRing, 3, j)) intros j hj have inPolynomial := X.mem at baseRing, 3, j with * rw compose.apply with liftFunction, fromFunction, inPolynomial rw liftingProjection.variable have index := membership.three.forward with hj rcases index with rfl | rfl | rfl . have result := originalEval.U unfold liftedVariable at result rw liftEval.U rw fromOriginal.class with * exact result . have result := originalEval.V unfold liftedVariable at result rw liftEval.V rw fromOriginal.class with * exact result . have result := originalEval.W unfold liftedVariable at result rw liftEval.W rw fromOriginal.class with * exact result have equal := polynomialRing.hom_ext at baseRing, 3, Algebra.ring(liftedAlgebra), compose(fromOriginal, liftEval, Ring.carrier(polynomialRing(baseRing, 3)), Ring.carrier(Algebra.ring(fibreAlgebra)), Ring.carrier(Algebra.ring(liftedAlgebra))), algebraProjection(polynomialAlgebra(baseRing, 3), liftingIdeal(baseRing, baseH, baseX, baseY, baseS)) with baseRing, first, second, constants, variables rw ← equal rw compose.apply with liftFunction, fromFunction, member theorem fromOriginal.after_to (l : Set) requires member : l ∈ algebraCarrier(liftedAlgebra) shows fromOriginal(toOriginal(l)) = l proof obtain ⟨q, hq, shape⟩ := liftedAlgebra.representative with member rw shape rw toOriginal.class with hq exact fromOriginal.after_lift with hq -- The main theorem: L ≅ D as ℂ-algebras, by toOriginal and fromOriginal. theorem elimination_equivalence shows toOriginal : liftedAlgebra ≃ₐ fibreAlgebra proof have forward := toOriginal.hom have backward := fromOriginal.hom have left : ∀ l ∈ algebraCarrier(liftedAlgebra), fromOriginal(toOriginal(l)) = l intros l hl exact fromOriginal.after_to with hl have right : ∀ d ∈ algebraCarrier(fibreAlgebra), toOriginal(fromOriginal(d)) = d intros d hd exact toOriginal.after_from with hd exact AlgebraIso.of_inverse with forward, backward, left, right