Grace/Cumulus/AlgebraicGeometry/Coordinates/Identities.g17

Open in Workbench Download source

Imports

Grace.Cumulus.Algebra.Ring

Declarations

Source

1-- The polynomial identities behind the explicit hypersurface: the cusp2-- identity (u³ + hv)² + (−u² + hw)³ = h·S, the shift identity, and the3-- Bézout certificate, over every commutative ring.4-- Part of Cumulus, the Grace17 mathematics library.5-- Copyright (c) 2026 Grant Passmore.6-- Released under the Apache License 2.0. See LICENSE in the repository root.7-- Authors: Grant Passmore89module Grace.Cumulus.AlgebraicGeometry.Coordinates.Identities10import Grace.Cumulus.Algebra.Ring1112section Identities13variable (R : Set)14hypothesis ring : CommRing(R)1516-- The four polynomials.1718-- S(h, u, v, w), with h·S the cusp x² + y³ of x = u³ + hv, y = −u² + hw.19def cuspS (h u v w : Set) : Set :=20  R[2]*u^3*v + R[3]*u^4*w + h*(v^2 - R[3]*u^2*w^2) + h^2*w^32122-- P(x, y, s), the correction in the shift identity.23def shiftP (x y s : Set) : Set := -R[2]*s^2*x + R[3]*s*y^2 - R[3]*s^3*y2425-- The Bézout coefficients of h and y.26def bezoutAlpha (x s : Set) : Set := R[1] + R[2]*s^2*x + R[4]*s^52728def bezoutBeta (x y s : Set) : Set :=29  (R[3]*s^3 - R[3]*s*y)*(R[1] + R[2]*s^2*x) - R[4]*s^4*y^23031-- Each is a member of R.3233instance cuspS.mem (h u v w : R)34  shows cuspS(R, h, u, v, w) ∈ R35proof36  unfold cuspS37  typecheck3839instance shiftP.mem (x y s : R)40  shows shiftP(R, x, y, s) ∈ R41proof42  unfold shiftP43  typecheck4445instance bezoutAlpha.mem (x s : R)46  shows bezoutAlpha(R, x, s) ∈ R47proof48  unfold bezoutAlpha49  typecheck5051instance bezoutBeta.mem (x y s : R)52  shows bezoutBeta(R, x, y, s) ∈ R53proof54  unfold bezoutBeta55  typecheck5657-- The three identities, each a ring identity once the names are opened.5859theorem cusp_universal (h u v w : R)60  shows (u^3 + h*v)^2 + (-u^2 + h*w)^3 = h * cuspS(R, h, u, v, w)61proof62  unfold cuspS63  ring6465theorem shift_universal (x y s : R)66  shows (x + s^3)^2 + (y - s^2)^3 = x^2 + y^3 - s * shiftP(R, x, y, s)67proof68  unfold shiftP69  ring7071theorem bezout_certificate (h x y s : R)72  shows bezoutAlpha(R, x, s)*h + bezoutBeta(R, x, y, s)*y - R[1] =73    (R[1] + R[2]*s^2*x)*(h - R[1] - shiftP(R, x, y, s)) -74      R[4]*s^4*(x^2 + y^3 - s*h)75proof76  unfold bezoutAlpha77  unfold bezoutBeta78  unfold shiftP79  ring8081end Identities8283-- Ring homomorphisms carry S and P along, and with them the cusp and84-- Bézout relations.85section Transport86variable (R S f : Set)87hypothesis source : CommRing(R)88hypothesis target : CommRing(S)89hypothesis hom : f : R →+* S9091theorem cuspS.map (h u v w : R)92  shows f(cuspS(R, h, u, v, w)) = cuspS(S, f(h), f(u), f(v), f(w))93proof94  have two := RingHom.map_two with *95  have three := RingHom.map_three with *96  unfold cuspS97  simp [RingHom.map_add, RingHom.map_mul, RingHom.map_sub, RingHom.map_pow,98    two, three]99100theorem RingHom.map_shiftP (x y s : R)101  shows f(shiftP(R, x, y, s)) = shiftP(S, f(x), f(y), f(s))102proof103  have two := RingHom.map_two with *104  have three := RingHom.map_three with *105  unfold shiftP106  simp [RingHom.map_sub, RingHom.map_add, RingHom.map_mul, RingHom.map_neg,107    RingHom.map_pow, two, three]108109theorem RingHom.map_cusp (h x y s : R)110  requires cusp : x^2 + y^3 = h*s111  shows f(x)^2 + f(y)^3 = f(h)*f(s)112proof113  have mapped : f(x^2 + y^3) = f(h*s)114    rw cusp115  have sum := RingHom.map_add at f, R, S, x^2, y^3 with hom116  have powerX := RingHom.map_pow at R, S, f, x, 2 with *117  have powerY := RingHom.map_pow at R, S, f, y, 3 with *118  have product := RingHom.map_mul at f, R, S, h, s with hom119  rw [sum, powerX, powerY, product] at mapped120  exact mapped121122theorem RingHom.map_bezout (h y α β : R)123  requires bezout : α*h + β*y = R[1]124  shows f(α)*f(h) + f(β)*f(y) = S[1]125proof126  have mapped : f(α*h + β*y) = f(R[1])127    rw bezout128  have sum := RingHom.map_add at f, R, S, α*h, β*y with hom129  have productα := RingHom.map_mul at f, R, S, α, h with hom130  have productβ := RingHom.map_mul at f, R, S, β, y with hom131  have one := RingHom.map_one at f, R, S with hom132  rw [sum, productα, productβ, one] at mapped133  exact mapped134135end Transport136