-- The plane presentation: over a commutative ring K, the algebra -- K[h, x, y, s] ⧸ (h − 1 − P(x, y, s), x² + y³ − sh) is the polynomial -- algebra K[2], by x ↦ X₀ − S³, y ↦ X₁ + S², s ↦ S = X₀² + X₁³, -- h ↦ 1 + P, with the inverse X₀ ↦ x + s³, X₁ ↦ y − s². -- 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.Plane import Grace.Cumulus.AlgebraicGeometry.Coordinates.Identities import Grace.Cumulus.Algebra.Algebras import Grace.Cumulus.Set.Function.Quadruples -- The relations. section Relations variable (K : Set) hypothesis base : CommRing(K) hypothesis polynomials : CommRing(polynomialRing(K, 4)) -- The relations in K[h, x, y, s], with h, x, y, s the variables 0, 1, 2, 3. def relH : Set := X(K, 4, 0) - Ring.one(polynomialRing(K, 4)) - shiftP(polynomialRing(K, 4), X(K, 4, 1), X(K, 4, 2), X(K, 4, 3)) def relCusp : Set := X(K, 4, 1)^2 + X(K, 4, 2)^3 - X(K, 4, 3)*X(K, 4, 0) instance relH.mem shows relH(K) ∈ Ring.carrier(polynomialRing(K, 4)) proof unfold relH typecheck instance relCusp.mem shows relCusp(K) ∈ Ring.carrier(polynomialRing(K, 4)) proof unfold relCusp typecheck end Relations -- The images of the relations under a ring homomorphism out of K[4]. section RelationTransport variable (K S f : Set) hypothesis base : CommRing(K) hypothesis target : CommRing(S) hypothesis hom : f : polynomialRing(K, 4) →+* S theorem RingHom.map_relH shows f(relH(K)) = f(X(K, 4, 0)) - Ring.one(S) - shiftP(S, f(X(K, 4, 1)), f(X(K, 4, 2)), f(X(K, 4, 3))) proof have polynomials := polynomialRing.comm_ring at K, 4 with base have shift := RingHom.map_shiftP at polynomialRing(K, 4), S, f, X(K, 4, 1), X(K, 4, 2), X(K, 4, 3) with * have one := RingHom.map_one with hom unfold relH simp [RingHom.map_sub, one, shift] theorem RingHom.map_relCusp shows f(relCusp(K)) = f(X(K, 4, 1))^2 + f(X(K, 4, 2))^3 - f(X(K, 4, 3))*f(X(K, 4, 0)) proof have polynomials := polynomialRing.comm_ring at K, 4 with base unfold relCusp simp [RingHom.map_sub, RingHom.map_add, RingHom.map_mul, RingHom.map_pow] end RelationTransport -- The presented algebra and the forward map. def planeRelations (K : Set) : Set := {relH(K), relCusp(K)} def planeIdeal (K : Set) : Set := generatedIdeal(polynomialRing(K, 4), planeRelations(K)) -- The presented algebra K[h, x, y, s] ⧸ (relH, relCusp). def planeAlgebra (K : Set) : Set := quotientAlgebra(polynomialAlgebra(K, 4), planeIdeal(K)) -- The classes of h, x, y, s. def planeVariable (K i : Set) : Set := algebraProjection(polynomialAlgebra(K, 4), planeIdeal(K))(X(K, 4, i)) section Values variable (K : Set) hypothesis base : CommRing(K) hypothesis plane : CommRing(polynomialRing(K, 2)) -- The images of s, x, y, h in K[2]. def planeS : Set := X(K, 2, 0)^2 + X(K, 2, 1)^3 instance planeS.mem shows planeS(K) ∈ Ring.carrier(polynomialRing(K, 2)) proof unfold planeS typecheck def planeX : Set := X(K, 2, 0) - planeS(K)^3 instance planeX.mem shows planeX(K) ∈ Ring.carrier(polynomialRing(K, 2)) proof unfold planeX typecheck def planeY : Set := X(K, 2, 1) + planeS(K)^2 instance planeY.mem shows planeY(K) ∈ Ring.carrier(polynomialRing(K, 2)) proof unfold planeY typecheck def planeH : Set := Ring.one(polynomialRing(K, 2)) + shiftP(polynomialRing(K, 2), planeX(K), planeY(K), planeS(K)) instance planeH.mem shows planeH(K) ∈ Ring.carrier(polynomialRing(K, 2)) proof unfold planeH typecheck end Values -- The values of h, x, y, s, as a function on 4. def planeValues (K : Set) : Set := quadrupleMap(Ring.carrier(polynomialRing(K, 2)), planeH(K), planeX(K), planeY(K), planeS(K)) -- Forward: the presented algebra to K[2], the evaluation at the values, -- lifted. def planeForward (K : Set) : Set := algebraLift( evaluationHom(K, polynomialRing(K, 2), 4, polynomialConstant(K, 2), planeValues(K)), polynomialAlgebra(K, 4), polynomialAlgebra(K, 2), planeIdeal(K)) -- The members and instances. section Members variable (K : Set) hypothesis base : CommRing(K) -- The relations lie in K[4], and the plane ideal is the ideal of the -- polynomial algebra they generate. theorem planeRelations.subset shows planeRelations(K) ⊆ algebraCarrier(polynomialAlgebra(K, 4)) proof have relH := relH.mem with * have relCusp := relCusp.mem with * rw polynomialAlgebra.carrierOf unfold planeRelations intros g hg simp [pair.membership] at hg rcases hg with rfl | rfl . exact relH . exact relCusp theorem planeIdeal.generated shows planeIdeal(K) = generatedIdeal(Algebra.ring(polynomialAlgebra(K, 4)), planeRelations(K)) proof unfold planeIdeal rw polynomialAlgebra.ring theorem planeIdeal.ideal shows Ideal(Algebra.ring(polynomialAlgebra(K, 4)), planeIdeal(K)) proof have ring := polynomialRing.comm_ring at K, 4 with base rw polynomialAlgebra.ring unfold planeIdeal exact generatedIdeal.ideal with ring -- The presented algebra is an algebra over K with a commutative ring. theorem planeAlgebra.algebra shows Algebra(planeAlgebra(K)) proof have polynomial := polynomialAlgebra.algebra at K, 4 with base have ideal := planeIdeal.ideal with base unfold planeAlgebra exact quotientAlgebra.algebra with polynomial, ideal theorem planeAlgebra.over shows Algebra.base(planeAlgebra(K)) = K proof unfold planeAlgebra rw quotientAlgebra.baseOf exact polynomialAlgebra.base at K, 4 instance planeAlgebra.comm_ring shows CommRing(Algebra.ring(planeAlgebra(K))) proof have algebra := planeAlgebra.algebra with base exact Algebra.comm_ring with algebra -- The four classes lie in the presented algebra. theorem planeVariable.mem (i : Set) requires index : i ∈ 4 shows planeVariable(K, i) ∈ Ring.carrier(Algebra.ring(planeAlgebra(K))) proof have polynomial := polynomialAlgebra.algebra at K, 4 with base have ideal := planeIdeal.ideal with base have function := algebraProjection.function with polynomial, ideal have member : X(K, 4, i) ∈ algebraCarrier(polynomialAlgebra(K, 4)) rw polynomialAlgebra.carrierOf exact X.mem at K, 4, i with base unfold planeAlgebra rw quotientAlgebra.ringOf unfold planeVariable exact FunctionBetween.apply_closed with function, member instance planeH.class_mem shows planeVariable(K, 0) ∈ Ring.carrier(Algebra.ring(planeAlgebra(K))) proof have zero : 0 ∈ 4 by simp [membership.four] exact planeVariable.mem with base, zero instance planeX.class_mem shows planeVariable(K, 1) ∈ Ring.carrier(Algebra.ring(planeAlgebra(K))) proof have one : 1 ∈ 4 by simp [membership.four] exact planeVariable.mem with base, one instance planeY.class_mem shows planeVariable(K, 2) ∈ Ring.carrier(Algebra.ring(planeAlgebra(K))) proof have two : 2 ∈ 4 by simp [membership.four] exact planeVariable.mem with base, two instance planeS.class_mem shows planeVariable(K, 3) ∈ Ring.carrier(Algebra.ring(planeAlgebra(K))) proof have three : 3 ∈ 4 by simp [membership.four] exact planeVariable.mem with base, three end Members -- The projection onto the presented algebra. section Projection variable (K : Set) hypothesis base : CommRing(K) -- The projection of K[4] onto the presented algebra is a ring -- homomorphism killing the relations. theorem planeProjection.hom shows algebraProjection(polynomialAlgebra(K, 4), planeIdeal(K)) : polynomialRing(K, 4) →+* Algebra.ring(planeAlgebra(K)) proof have polynomial := polynomialAlgebra.algebra at K, 4 with base have ideal := planeIdeal.ideal with base have projection := algebraProjection.ring_hom with polynomial, ideal unfold planeAlgebra rw quotientAlgebra.ringOf rw polynomialAlgebra.ring at projection rw polynomialAlgebra.ring exact projection theorem planeProjection.kills_h shows algebraProjection(polynomialAlgebra(K, 4), planeIdeal(K))(relH(K)) = Ring.zero(Algebra.ring(planeAlgebra(K))) proof have polynomial := polynomialAlgebra.algebra at K, 4 with base have generators := planeRelations.subset with base have member : relH(K) ∈ planeRelations(K) unfold planeRelations exact pair.left at relH(K), relCusp(K) have killed := algebraProjection.kills_generator with polynomial, generators, member unfold planeAlgebra rw quotientAlgebra.ringOf rw planeIdeal.generated exact killed theorem planeProjection.kills_cusp shows algebraProjection(polynomialAlgebra(K, 4), planeIdeal(K))(relCusp(K)) = Ring.zero(Algebra.ring(planeAlgebra(K))) proof have polynomial := polynomialAlgebra.algebra at K, 4 with base have generators := planeRelations.subset with base have member : relCusp(K) ∈ planeRelations(K) unfold planeRelations exact pair.right at relH(K), relCusp(K) have killed := algebraProjection.kills_generator with polynomial, generators, member unfold planeAlgebra rw quotientAlgebra.ringOf rw planeIdeal.generated exact killed -- Homomorphisms out of the presented algebra agreeing on the four classes -- are equal. theorem planeAlgebra.hom_ext (g h B : Set) requires first : g : planeAlgebra(K) →ₐ B requires second : h : planeAlgebra(K) →ₐ B requires agree : ∀ i ∈ 4, g(planeVariable(K, i)) = h(planeVariable(K, i)) shows g = h proof have polynomial := polynomialAlgebra.algebra at K, 4 with base have ideal := planeIdeal.ideal with base have projection := algebraProjection.hom with polynomial, ideal have carrierQ := quotientAlgebra.carrierOf at polynomialAlgebra(K, 4), planeIdeal(K) have projectionFunction := algebraProjection.function with polynomial, ideal rw ← carrierQ at projectionFunction unfold planeAlgebra at first unfold planeAlgebra at second have gFunction := AlgebraHom.function with first have hFunction := AlgebraHom.function with second have gComposite := AlgebraHom.compose with projection, first have hComposite := AlgebraHom.compose with projection, second -- The composites with the projection agree on the variables of K[4], -- hence everywhere, and the projection is onto. have agreeX : ∀ i ∈ 4, compose(g, algebraProjection(polynomialAlgebra(K, 4), planeIdeal(K)), algebraCarrier(polynomialAlgebra(K, 4)), algebraCarrier(quotientAlgebra(polynomialAlgebra(K, 4), planeIdeal(K))), algebraCarrier(B))(X(K, 4, i)) = compose(h, algebraProjection(polynomialAlgebra(K, 4), planeIdeal(K)), algebraCarrier(polynomialAlgebra(K, 4)), algebraCarrier(quotientAlgebra(polynomialAlgebra(K, 4), planeIdeal(K))), algebraCarrier(B))(X(K, 4, i)) intros i hi have xIn : X(K, 4, i) ∈ algebraCarrier(polynomialAlgebra(K, 4)) rw polynomialAlgebra.carrierOf exact X.mem at K, 4, i with base have left := compose.apply with projectionFunction, gFunction, xIn have right := compose.apply with projectionFunction, hFunction, xIn have same := agree with i, hi unfold planeVariable at same rw [left, right] exact same have equal := AlgebraHom.polynomial_ext with gComposite, hComposite, agreeX have agreeAll : ∀ x ∈ algebraCarrier(polynomialAlgebra(K, 4)), g(algebraProjection(polynomialAlgebra(K, 4), planeIdeal(K))(x)) = h(algebraProjection(polynomialAlgebra(K, 4), planeIdeal(K))(x)) intros x hx have left := compose.apply with projectionFunction, gFunction, hx have right := compose.apply with projectionFunction, hFunction, hx rw equal at left cc exact AlgebraHom.quotient_ext with polynomial, ideal, first, second, agreeAll end Projection -- The evaluation at the values. section Evaluation variable (K : Set) hypothesis base : CommRing(K) hypothesis plane : CommRing(polynomialRing(K, 2)) -- The values form a function on 4, and the evaluation at them is a ring -- homomorphism K[4] → K[2] sending the variables to the values. theorem planeValues.function shows planeValues(K) : 4 → Ring.carrier(polynomialRing(K, 2)) proof unfold planeValues exact quadrupleMap.function with * theorem planeEvaluation.hom shows evaluationHom(K, polynomialRing(K, 2), 4, polynomialConstant(K, 2), planeValues(K)) : polynomialRing(K, 4) →+* polynomialRing(K, 2) proof have constants := polynomialConstant.hom at K, 2 with base have values := planeValues.function with * exact evaluationHom.hom with base, plane, constants, values theorem planeEvaluation.X (i : Set) requires index : i ∈ 4 shows evaluationHom(K, polynomialRing(K, 2), 4, polynomialConstant(K, 2), planeValues(K))(X(K, 4, i)) = planeValues(K)(i) proof have constants := polynomialConstant.hom at K, 2 with base have values := planeValues.function with * exact evaluationHom.map_X with base, plane, constants, values, index -- The values, by name. theorem planeValues.zero shows planeValues(K)(0) = planeH(K) proof unfold planeValues exact quadrupleMap.zero with * theorem planeValues.one shows planeValues(K)(1) = planeX(K) proof unfold planeValues exact quadrupleMap.one with * theorem planeValues.two shows planeValues(K)(2) = planeY(K) proof unfold planeValues exact quadrupleMap.two with * theorem planeValues.three shows planeValues(K)(3) = planeS(K) proof unfold planeValues exact quadrupleMap.three with * -- The evaluation on the variables, by name. theorem planeEvaluation.H shows evaluationHom(K, polynomialRing(K, 2), 4, polynomialConstant(K, 2), planeValues(K))(X(K, 4, 0)) = planeH(K) proof have zero : 0 ∈ 4 by simp [membership.four] have value := planeEvaluation.X with base, plane, zero have named := planeValues.zero with * rw [value, named] theorem planeEvaluation.X1 shows evaluationHom(K, polynomialRing(K, 2), 4, polynomialConstant(K, 2), planeValues(K))(X(K, 4, 1)) = planeX(K) proof have one : 1 ∈ 4 by simp [membership.four] have value := planeEvaluation.X with base, plane, one have named := planeValues.one with * rw [value, named] theorem planeEvaluation.Y shows evaluationHom(K, polynomialRing(K, 2), 4, polynomialConstant(K, 2), planeValues(K))(X(K, 4, 2)) = planeY(K) proof have two : 2 ∈ 4 by simp [membership.four] have value := planeEvaluation.X with base, plane, two have named := planeValues.two with * rw [value, named] theorem planeEvaluation.S shows evaluationHom(K, polynomialRing(K, 2), 4, polynomialConstant(K, 2), planeValues(K))(X(K, 4, 3)) = planeS(K) proof have three : 3 ∈ 4 by simp [membership.four] have value := planeEvaluation.X with base, plane, three have named := planeValues.three with * rw [value, named] -- The values satisfy the cusp relation in K[2]. theorem plane_cusp shows planeX(K)^2 + planeY(K)^3 = planeH(K) * planeS(K) proof have shift := shift_universal at polynomialRing(K, 2), planeX(K), planeY(K), planeS(K) with * have value : X(K, 2, 0)^2 + X(K, 2, 1)^3 = planeS(K) unfold planeS rfl have collapse : (planeX(K) + planeS(K)^3)^2 + (planeY(K) - planeS(K)^2)^3 = planeS(K) unfold planeX unfold planeY linear_combination value unfold planeH linear_combination collapse - shift end Evaluation -- The backward map, on the variables of K[2]. section Backward variable (K : Set) hypothesis base : CommRing(K) hypothesis quotient : CommRing(Algebra.ring(planeAlgebra(K))) -- Backward: K[2] to the presented algebra, X₀ ↦ x + s³ and X₁ ↦ y − s². def planeBackward : Set := evaluationHom(K, Algebra.ring(planeAlgebra(K)), 2, Algebra.map(planeAlgebra(K)), pairMap(Ring.carrier(Algebra.ring(planeAlgebra(K))), planeVariable(K, 1) + planeVariable(K, 3)^3, planeVariable(K, 2) - planeVariable(K, 3)^2)) -- The assigned values of X₀ and X₁ lie in the presented algebra. theorem planeBackward.first_mem shows planeVariable(K, 1) + planeVariable(K, 3)^3 ∈ Ring.carrier(Algebra.ring(planeAlgebra(K))) proof typecheck theorem planeBackward.second_mem shows planeVariable(K, 2) - planeVariable(K, 3)^2 ∈ Ring.carrier(Algebra.ring(planeAlgebra(K))) proof typecheck theorem planeBackward.values shows pairMap(Ring.carrier(Algebra.ring(planeAlgebra(K))), planeVariable(K, 1) + planeVariable(K, 3)^3, planeVariable(K, 2) - planeVariable(K, 3)^2) : 2 → algebraCarrier(planeAlgebra(K)) proof have first := planeBackward.first_mem with * have second := planeBackward.second_mem with * unfold algebraCarrier exact pairMap.function with first, second theorem planeBackward.X0 shows planeBackward(K)(X(K, 2, 0)) = planeVariable(K, 1) + planeVariable(K, 3)^3 proof have algebra := planeAlgebra.algebra with base have over := planeAlgebra.over at K with base have values := planeBackward.values with * have first := planeBackward.first_mem with * have second := planeBackward.second_mem with * have zero : 0 ∈ 2 by simp [membership.two] have value := evaluationHom.algebra_X at K, 2, planeAlgebra(K), pairMap( Ring.carrier(Algebra.ring(planeAlgebra(K))), planeVariable(K, 1) + planeVariable(K, 3)^3, planeVariable(K, 2) - planeVariable(K, 3)^2), 0 with base, algebra, over, values, zero have named := pairMap.zero with first, second unfold planeBackward rw [value, named] theorem planeBackward.X1 shows planeBackward(K)(X(K, 2, 1)) = planeVariable(K, 2) - planeVariable(K, 3)^2 proof have algebra := planeAlgebra.algebra with base have over := planeAlgebra.over at K with base have values := planeBackward.values with * have first := planeBackward.first_mem with * have second := planeBackward.second_mem with * have one : 1 ∈ 2 by simp [membership.two] have value := evaluationHom.algebra_X at K, 2, planeAlgebra(K), pairMap( Ring.carrier(Algebra.ring(planeAlgebra(K))), planeVariable(K, 1) + planeVariable(K, 3)^3, planeVariable(K, 2) - planeVariable(K, 3)^2), 1 with base, algebra, over, values, one have named := pairMap.one with first, second unfold planeBackward rw [value, named] theorem planeBackward.hom shows planeBackward(K) : polynomialAlgebra(K, 2) →ₐ planeAlgebra(K) proof have algebra := planeAlgebra.algebra with base have over := planeAlgebra.over at K with base have values := planeBackward.values with * unfold planeBackward exact evaluationHom.algebra_hom at K, 2, planeAlgebra(K), pairMap( Ring.carrier(Algebra.ring(planeAlgebra(K))), planeVariable(K, 1) + planeVariable(K, 3)^3, planeVariable(K, 2) - planeVariable(K, 3)^2) with base, algebra, over, values theorem planeBackward.ring_hom shows planeBackward(K) : polynomialRing(K, 2) →+* Algebra.ring(planeAlgebra(K)) proof have hom := planeBackward.hom with * have ringHom := AlgebraHom.ring_hom with hom rw polynomialAlgebra.ring at ringHom exact ringHom end Backward -- The laws in the presented algebra, the two maps, and the equivalence. section Plane variable (K : Set) hypothesis base : CommRing(K) hypothesis quotient : CommRing(Algebra.ring(planeAlgebra(K))) hypothesis plane : CommRing(polynomialRing(K, 2)) -- The two relations, read in the presented algebra. theorem planeAlgebra.relation_h shows planeVariable(K, 0) = Ring.one(Algebra.ring(planeAlgebra(K))) + shiftP(Algebra.ring(planeAlgebra(K)), planeVariable(K, 1), planeVariable(K, 2), planeVariable(K, 3)) proof have hom := planeProjection.hom with base have killed := planeProjection.kills_h with base have mapped := RingHom.map_relH with base, quotient, hom rw mapped at killed unfold planeVariable linear_combination killed theorem planeAlgebra.relation_cusp shows planeVariable(K, 1)^2 + planeVariable(K, 2)^3 = planeVariable(K, 0) * planeVariable(K, 3) proof have hom := planeProjection.hom with base have killed := planeProjection.kills_cusp with base have mapped := RingHom.map_relCusp with base, quotient, hom rw mapped at killed unfold planeVariable linear_combination killed -- Their consequences: the shifted cusp is s, and h, y are coprime. theorem planeAlgebra.shift_s shows (planeVariable(K, 1) + planeVariable(K, 3)^3)^2 + (planeVariable(K, 2) - planeVariable(K, 3)^2)^3 = planeVariable(K, 3) proof have cusp := planeAlgebra.relation_cusp with * have relation := planeAlgebra.relation_h with * have shift := shift_universal at Algebra.ring(planeAlgebra(K)), planeVariable(K, 1), planeVariable(K, 2), planeVariable(K, 3) with * linear_combination shift + cusp + planeVariable(K, 3) * relation theorem planeAlgebra.bezout shows bezoutAlpha(Algebra.ring(planeAlgebra(K)), planeVariable(K, 1), planeVariable(K, 3)) * planeVariable(K, 0) + bezoutBeta(Algebra.ring(planeAlgebra(K)), planeVariable(K, 1), planeVariable(K, 2), planeVariable(K, 3)) * planeVariable(K, 2) = Ring.one(Algebra.ring(planeAlgebra(K))) proof have cusp := planeAlgebra.relation_cusp with * have relation := planeAlgebra.relation_h with * have certificate := bezout_certificate at Algebra.ring(planeAlgebra(K)), planeVariable(K, 0), planeVariable(K, 1), planeVariable(K, 2), planeVariable(K, 3) with * -- Both factors on the right of the certificate are the relations. have relationH : planeVariable(K, 0) - Ring.one(Algebra.ring(planeAlgebra(K))) - shiftP(Algebra.ring(planeAlgebra(K)), planeVariable(K, 1), planeVariable(K, 2), planeVariable(K, 3)) = Ring.zero(Algebra.ring(planeAlgebra(K))) linear_combination relation have relationCusp : planeVariable(K, 1)^2 + planeVariable(K, 2)^3 - planeVariable(K, 3) * planeVariable(K, 0) = Ring.zero(Algebra.ring(planeAlgebra(K))) linear_combination cusp rw [relationH, relationCusp] at certificate linear_combination certificate -- The evaluation kills both relations, so it is an algebra homomorphism -- out of K[4] that lifts to the presented algebra. theorem planeValues.relations shows evaluationHom(K, polynomialRing(K, 2), 4, polynomialConstant(K, 2), planeValues(K))(relH(K)) = Ring.zero(polynomialRing(K, 2)) ∧ evaluationHom(K, polynomialRing(K, 2), 4, polynomialConstant(K, 2), planeValues(K))(relCusp(K)) = Ring.zero(polynomialRing(K, 2)) proof have hom := planeEvaluation.hom with * have mapH := RingHom.map_relH with base, plane, hom have mapCusp := RingHom.map_relCusp with base, plane, hom have h := planeEvaluation.H with * have x := planeEvaluation.X1 with * have y := planeEvaluation.Y with * have s := planeEvaluation.S with * have cusp := plane_cusp with * constructor . rw [mapH, h, x, y, s] unfold planeH ring . rw [mapCusp, h, x, y, s] linear_combination cusp theorem planeEvaluation.algebra_hom shows evaluationHom(K, polynomialRing(K, 2), 4, polynomialConstant(K, 2), planeValues(K)) : polynomialAlgebra(K, 4) →ₐ polynomialAlgebra(K, 2) proof have algebra2 := polynomialAlgebra.algebra at K, 2 with base have values : planeValues(K) : 4 → algebraCarrier(polynomialAlgebra(K, 2)) rw polynomialAlgebra.carrierOf exact planeValues.function with * have over := polynomialAlgebra.base at K, 2 have hom := evaluationHom.algebra_hom at K, 4, polynomialAlgebra(K, 2), planeValues(K) with base, algebra2, over, values rw [polynomialAlgebra.ring, polynomialAlgebra.map] at hom exact hom theorem planeEvaluation.kills shows ∀ g ∈ planeRelations(K), evaluationHom(K, polynomialRing(K, 2), 4, polynomialConstant(K, 2), planeValues(K))(g) = Ring.zero(Algebra.ring(polynomialAlgebra(K, 2))) proof have relations := planeValues.relations with * intros g hg unfold planeRelations at hg simp [pair.membership] at hg rw polynomialAlgebra.ring rcases hg with rfl | rfl . exact relations.left . exact relations.right theorem planeForward.hom shows planeForward(K) : planeAlgebra(K) →ₐ polynomialAlgebra(K, 2) proof have polynomial := polynomialAlgebra.algebra at K, 4 with base have generators := planeRelations.subset with base have hom := planeEvaluation.algebra_hom with * have killed := planeEvaluation.kills with * have lifted := AlgebraHom.lift_generated with polynomial, generators, hom, killed unfold planeForward unfold planeAlgebra rw planeIdeal.generated exact lifted theorem planeForward.variable (i : Set) requires index : i ∈ 4 shows planeForward(K)(planeVariable(K, i)) = planeValues(K)(i) proof have polynomial := polynomialAlgebra.algebra at K, 4 with base have generators := planeRelations.subset with base have hom := planeEvaluation.algebra_hom with * have killed := planeEvaluation.kills with * have member : X(K, 4, i) ∈ algebraCarrier(polynomialAlgebra(K, 4)) rw polynomialAlgebra.carrierOf exact X.mem at K, 4, i with base have factors := AlgebraHom.lift_generated_factors with polynomial, generators, hom, killed, member unfold planeForward unfold planeVariable rw planeIdeal.generated rw factors exact planeEvaluation.X with base, plane, index -- The forward map as a ring homomorphism, and on the four classes. theorem planeForward.ring_hom shows planeForward(K) : Algebra.ring(planeAlgebra(K)) →+* polynomialRing(K, 2) proof have hom := planeForward.hom with * have ringHom := AlgebraHom.ring_hom with hom rw polynomialAlgebra.ring at ringHom exact ringHom theorem planeForward.H shows planeForward(K)(planeVariable(K, 0)) = planeH(K) proof have zero : 0 ∈ 4 by simp [membership.four] have value := planeForward.variable with base, quotient, plane, zero have named := planeValues.zero with * rw [value, named] theorem planeForward.X shows planeForward(K)(planeVariable(K, 1)) = planeX(K) proof have one : 1 ∈ 4 by simp [membership.four] have value := planeForward.variable with base, quotient, plane, one have named := planeValues.one with * rw [value, named] theorem planeForward.Y shows planeForward(K)(planeVariable(K, 2)) = planeY(K) proof have two : 2 ∈ 4 by simp [membership.four] have value := planeForward.variable with base, quotient, plane, two have named := planeValues.two with * rw [value, named] theorem planeForward.S shows planeForward(K)(planeVariable(K, 3)) = planeS(K) proof have three : 3 ∈ 4 by simp [membership.four] have value := planeForward.variable with base, quotient, plane, three have named := planeValues.three with * rw [value, named] -- The forward map sends the assigned values of X₀ and X₁ back to them. theorem planeForward.X0 shows planeForward(K)(planeVariable(K, 1) + planeVariable(K, 3)^3) = X(K, 2, 0) proof have hom := planeForward.ring_hom with * have fX := planeForward.X with * have fS := planeForward.S with * have mapped : planeForward(K)(planeVariable(K, 1) + planeVariable(K, 3)^3) = planeForward(K)(planeVariable(K, 1)) + planeForward(K)(planeVariable(K, 3))^3 simp [RingHom.map_add, RingHom.map_pow] rw [mapped, fX, fS] unfold planeX ring theorem planeForward.X1 shows planeForward(K)(planeVariable(K, 2) - planeVariable(K, 3)^2) = X(K, 2, 1) proof have hom := planeForward.ring_hom with * have fY := planeForward.Y with * have fS := planeForward.S with * have mapped : planeForward(K)(planeVariable(K, 2) - planeVariable(K, 3)^2) = planeForward(K)(planeVariable(K, 2)) - planeForward(K)(planeVariable(K, 3))^2 simp [RingHom.map_sub, RingHom.map_pow] rw [mapped, fY, fS] unfold planeY ring -- The backward map on the values s, x, y, h. theorem planeBackward.S shows planeBackward(K)(planeS(K)) = planeVariable(K, 3) proof have hom := planeBackward.ring_hom with * have x0 := planeBackward.X0 with * have x1 := planeBackward.X1 with * have shift := planeAlgebra.shift_s with * have mapped : planeBackward(K)(X(K, 2, 0)^2 + X(K, 2, 1)^3) = planeBackward(K)(X(K, 2, 0))^2 + planeBackward(K)(X(K, 2, 1))^3 simp [RingHom.map_add, RingHom.map_pow] unfold planeS rw [mapped, x0, x1] exact shift theorem planeBackward.X shows planeBackward(K)(planeX(K)) = planeVariable(K, 1) proof have hom := planeBackward.ring_hom with * have x0 := planeBackward.X0 with * have s := planeBackward.S with * have sIn := planeS.mem with * have mapped : planeBackward(K)(X(K, 2, 0) - planeS(K)^3) = planeBackward(K)(X(K, 2, 0)) - planeBackward(K)(planeS(K))^3 simp [RingHom.map_sub, RingHom.map_pow] unfold planeX rw [mapped, x0, s] ring theorem planeBackward.Y shows planeBackward(K)(planeY(K)) = planeVariable(K, 2) proof have hom := planeBackward.ring_hom with * have x1 := planeBackward.X1 with * have s := planeBackward.S with * have sIn := planeS.mem with * have mapped : planeBackward(K)(X(K, 2, 1) + planeS(K)^2) = planeBackward(K)(X(K, 2, 1)) + planeBackward(K)(planeS(K))^2 simp [RingHom.map_add, RingHom.map_pow] unfold planeY rw [mapped, x1, s] ring theorem planeBackward.H shows planeBackward(K)(planeH(K)) = planeVariable(K, 0) proof have hom := planeBackward.ring_hom with * have x := planeBackward.X with * have y := planeBackward.Y with * have s := planeBackward.S with * have xIn := planeX.mem with * have yIn := planeY.mem with * have sIn := planeS.mem with * have relation := planeAlgebra.relation_h with * have mapped : planeBackward(K)(Ring.one(polynomialRing(K, 2)) + shiftP(polynomialRing(K, 2), planeX(K), planeY(K), planeS(K))) = Ring.one(Algebra.ring(planeAlgebra(K))) + shiftP(Algebra.ring(planeAlgebra(K)), planeBackward(K)(planeX(K)), planeBackward(K)(planeY(K)), planeBackward(K)(planeS(K))) simp [RingHom.map_add, RingHom.map_one, RingHom.map_shiftP] unfold planeH rw [mapped, x, y, s] symm exact relation -- The two composites are the identities, by extensionality on generators. theorem planeForward.after_backward (p : Set) requires member : p ∈ Ring.carrier(polynomialRing(K, 2)) shows planeForward(K)(planeBackward(K)(p)) = p proof have forward := planeForward.hom with * have backward := planeBackward.hom with * have forwardFunction := AlgebraHom.function with forward have backwardFunction := AlgebraHom.function with backward have algebra2 := polynomialAlgebra.algebra at K, 2 with base have carrier := polynomialAlgebra.carrierOf at K, 2 have composite := AlgebraHom.compose with backward, forward have identity2 := AlgebraHom.identity with algebra2 have f0 := planeForward.X0 with * have f1 := planeForward.X1 with * have x0 := planeBackward.X0 with * have x1 := planeBackward.X1 with * -- Going to the presented algebra and back fixes each variable of K[2]. have agree : ∀ j ∈ 2, compose(planeForward(K), planeBackward(K), algebraCarrier(polynomialAlgebra(K, 2)), algebraCarrier(planeAlgebra(K)), algebraCarrier(polynomialAlgebra(K, 2)))(X(K, 2, j)) = identity(algebraCarrier(polynomialAlgebra(K, 2)))(X(K, 2, j)) intros j hj have xIn : X(K, 2, j) ∈ algebraCarrier(polynomialAlgebra(K, 2)) rw carrier exact X.mem at K, 2, j with base have step := compose.apply with backwardFunction, forwardFunction, xIn have fixed := identity.apply with xIn rw [step, fixed] have cases := membership.two.forward with hj rcases cases with rfl | rfl . rw x0 exact f0 . rw x1 exact f1 have equal := AlgebraHom.polynomial_ext with composite, identity2, agree have pIn : p ∈ algebraCarrier(polynomialAlgebra(K, 2)) rw carrier exact member have step := compose.apply with backwardFunction, forwardFunction, pIn have fixed := identity.apply with pIn rw equal at step cc theorem planeBackward.after_forward (q : Set) requires member : q ∈ algebraCarrier(planeAlgebra(K)) shows planeBackward(K)(planeForward(K)(q)) = q proof have forward := planeForward.hom with * have backward := planeBackward.hom with * have forwardFunction := AlgebraHom.function with forward have backwardFunction := AlgebraHom.function with backward have algebra := planeAlgebra.algebra with base have composite := AlgebraHom.compose with forward, backward have identityQ := AlgebraHom.identity with algebra have fH := planeForward.H with * have fX := planeForward.X with * have fY := planeForward.Y with * have fS := planeForward.S with * have bH := planeBackward.H with * have bX := planeBackward.X with * have bY := planeBackward.Y with * have bS := planeBackward.S with * -- Going to K[2] and back fixes each of the four classes. have agree : ∀ i ∈ 4, compose(planeBackward(K), planeForward(K), algebraCarrier(planeAlgebra(K)), algebraCarrier(polynomialAlgebra(K, 2)), algebraCarrier(planeAlgebra(K)))(planeVariable(K, i)) = identity(algebraCarrier(planeAlgebra(K)))(planeVariable(K, i)) intros i hi have vIn : planeVariable(K, i) ∈ algebraCarrier(planeAlgebra(K)) unfold algebraCarrier exact planeVariable.mem with base, hi have step := compose.apply with forwardFunction, backwardFunction, vIn have fixed := identity.apply with vIn rw [step, fixed] have cases := membership.four.forward with hi rcases cases with rfl | rfl | rfl | rfl . rw [fH, bH] . rw [fX, bX] . rw [fY, bY] . rw [fS, bS] have equal := planeAlgebra.hom_ext with base, composite, identityQ, agree have step := compose.apply with forwardFunction, backwardFunction, member have fixed := identity.apply with member rw equal at step cc theorem plane_equivalence shows planeForward(K) : planeAlgebra(K) ≃ₐ polynomialAlgebra(K, 2) proof have forward := planeForward.hom with * have backward := planeBackward.hom with * have carrier := polynomialAlgebra.carrierOf at K, 2 have left : ∀ x ∈ algebraCarrier(planeAlgebra(K)), planeBackward(K)(planeForward(K)(x)) = x intros x hx exact planeBackward.after_forward with base, quotient, plane, hx have right : ∀ y ∈ algebraCarrier(polynomialAlgebra(K, 2)), planeForward(K)(planeBackward(K)(y)) = y intros y hy rw carrier at hy exact planeForward.after_backward with base, quotient, plane, hy exact AlgebraIso.of_inverse with forward, backward, left, right end Plane