Grace/Cumulus/AlgebraicGeometry/Coordinates/CriticalPoint.g17

Open in Workbench Download source

Imports

Grace.Cumulus.AlgebraicGeometry.Coordinates.CriticalValues · Grace.Cumulus.AlgebraicGeometry.Coordinates.Ambient · Grace.Cumulus.Algebra.Polynomial.Derivative

Declarations

Source

1-- The critical point (h, u, v, w) = (2, 0, −1/2, 1/2): there x = −1, y = 1,2-- s = 1, p = 2, F = −1, and the shifted coordinates vanish, so every3-- partial derivative of F vanishes by the ambient identity.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.CriticalPoint10import Grace.Cumulus.AlgebraicGeometry.Coordinates.CriticalValues11import Grace.Cumulus.AlgebraicGeometry.Coordinates.Ambient12import Grace.Cumulus.Algebra.Polynomial.Derivative1314-- The arithmetic of the evaluations: closed computations in ℂ, carried15-- out on real parts, where 2 · (1/2) = 1 does the work.16section Arithmetic17notation ring ℂ := (complexCarrier, complexAdd, complexZero, complexNeg, complexMul, complexOne)18notation ring R := (ℝ, realAdd, realZero, realNeg, realMul, realOne)1920-- x = u³ + hv = 0 + 2 · (−1/2) = −1.21theorem criticalArithmetic.x_is_neg_one22  shows ℂ[complexZero ^ 3 + criticalH * criticalV] = complexNeg(complexOne)23proof24  have halfReal := half.real at realOne with *25  have twoReal := realNumeral.real at (2:Nat) with *26  have negReal : Real(realNeg(half(realOne))) by typecheck27  unfold complexZero28  unfold criticalH29  unfold criticalV30  simp [realPair.add, realPair.mul, realPair.pow]31  unfold complexOne32  have negation := realPair.neg at realOne with *33  rw negation34  apply orderedPair.first_congr35  rw realNumeral.numeral36  have twice := half.add_self at realOne with *37  linear_combination (-1) * twice3839-- y = −u² + hw = 0 + 2 · (1/2) = 1.40theorem criticalArithmetic.y_is_one41  shows ℂ[-complexZero ^ 2 + criticalH * criticalW] = complexOne42proof43  have halfReal := half.real at realOne with *44  have twoReal := realNumeral.real at (2:Nat) with *45  unfold complexZero46  unfold criticalH47  unfold criticalW48  simp [realPair.add, realPair.mul, realPair.neg, realPair.pow]49  unfold complexOne50  apply orderedPair.first_congr51  rw realNumeral.numeral52  have twice := half.add_self at realOne with *53  linear_combination twice5455-- s = S(h, u, v, w) = hv² + h²w³ = 2 · 1/4 + 4 · 1/8 = 1, as u = 0 kills56-- the other terms.57theorem criticalArithmetic.s_is_one58  shows ℂ[2 * complexZero^3 * criticalV + 3 * complexZero^4 * criticalW +59    criticalH * (criticalV^2 - 3 * complexZero^2 * criticalW^2) +60    criticalH^2 * criticalW^3] = complexOne61proof62  have halfReal := half.real at realOne with *63  have twoReal := realNumeral.real at (2:Nat) with *64  have negReal : Real(realNeg(half(realOne))) by typecheck65  have reduce :66      ℂ[2 * complexZero^3 * criticalV + 3 * complexZero^4 * criticalW +67        criticalH * (criticalV^2 - 3 * complexZero^2 * criticalW^2) +68        criticalH^2 * criticalW^3] =69      ℂ[criticalH * criticalV^2 + criticalH^2 * criticalW^3]70    ring71  rw reduce72  unfold criticalH73  unfold criticalV74  unfold criticalW75  simp [realPair.add, realPair.mul, realPair.neg, realPair.pow]76  unfold complexOne77  apply orderedPair.first_congr78  rw realNumeral.numeral79  have twice := half.add_self at realOne with *80  linear_combination (2 * half(realOne)^2 + 2 * half(realOne) + 1) * twice8182end Arithmetic8384-- The values of the four variables at the critical point.85theorem criticalPoint.value_h86  shows evaluationAt(complexRing, 4, criticalPoint)(X(complexRing, 4, 0)) =87    criticalH88proof89  have function := criticalPoint.function90  have zero : 0 ∈ 4 by simp [membership.four]91  have value := evaluationAt.map_X at complexRing, 4, criticalPoint, 0 with *92  rw value93  unfold criticalPoint94  have zeroIn := complexZero.member95  exact quadrupleMap.zero with *9697theorem criticalPoint.value_u98  shows evaluationAt(complexRing, 4, criticalPoint)(X(complexRing, 4, 1)) =99    complexZero100proof101  have function := criticalPoint.function102  have one : 1 ∈ 4 by simp [membership.four]103  have value := evaluationAt.map_X at complexRing, 4, criticalPoint, 1 with *104  rw value105  unfold criticalPoint106  have zeroIn := complexZero.member107  exact quadrupleMap.one with *108109theorem criticalPoint.value_v110  shows evaluationAt(complexRing, 4, criticalPoint)(X(complexRing, 4, 2)) =111    criticalV112proof113  have function := criticalPoint.function114  have two : 2 ∈ 4 by simp [membership.four]115  have value := evaluationAt.map_X at complexRing, 4, criticalPoint, 2 with *116  rw value117  unfold criticalPoint118  have zeroIn := complexZero.member119  exact quadrupleMap.two with *120121theorem criticalPoint.value_w122  shows evaluationAt(complexRing, 4, criticalPoint)(X(complexRing, 4, 3)) =123    criticalW124proof125  have function := criticalPoint.function126  have three : 3 ∈ 4 by simp [membership.four]127  have value := evaluationAt.map_X at complexRing, 4, criticalPoint, 3 with *128  rw value129  unfold criticalPoint130  have zeroIn := complexZero.member131  exact quadrupleMap.three with *132133-- The evaluations: push the evaluation homomorphism through the134-- polynomial expressions, then compute in ℂ.135theorem criticalPoint.eval_x136  shows evaluationAt(complexRing, 4, criticalPoint)(ambientX) =137    complexNeg(complexOne)138proof139  have function := criticalPoint.function140  have ambient : CommRing(polynomialRing(complexRing, 4)) :=141    polynomialRing.comm_ring with *142  have hom := evaluationAt.hom at complexRing, 4, criticalPoint with *143  have h := criticalPoint.value_h144  have u := criticalPoint.value_u145  have v := criticalPoint.value_v146  unfold ambientX147  simp [RingHom.map_add, RingHom.map_mul, RingHom.map_pow, h, u, v]148  simp [Ring.pow.value, complexRing.addOf, complexRing.mulOf, complexRing.oneOf]149  exact criticalArithmetic.x_is_neg_one150151theorem criticalPoint.eval_y152  shows evaluationAt(complexRing, 4, criticalPoint)(ambientY) = complexOne153proof154  have function := criticalPoint.function155  have ambient : CommRing(polynomialRing(complexRing, 4)) :=156    polynomialRing.comm_ring with *157  have hom := evaluationAt.hom at complexRing, 4, criticalPoint with *158  have h := criticalPoint.value_h159  have u := criticalPoint.value_u160  have w := criticalPoint.value_w161  unfold ambientY162  simp [RingHom.map_add, RingHom.map_neg, RingHom.map_mul, RingHom.map_pow,163    h, u, w]164  simp [Ring.pow.value, complexRing.addOf, complexRing.mulOf, complexRing.negOf,165    complexRing.oneOf]166  exact criticalArithmetic.y_is_one167168theorem criticalPoint.eval_s169  shows evaluationAt(complexRing, 4, criticalPoint)(ambientS) = complexOne170proof171  have function := criticalPoint.function172  have ambient : CommRing(polynomialRing(complexRing, 4)) :=173    polynomialRing.comm_ring with *174  have hom := evaluationAt.hom at complexRing, 4, criticalPoint with *175  have h := criticalPoint.value_h176  have u := criticalPoint.value_u177  have v := criticalPoint.value_v178  have w := criticalPoint.value_w179  unfold ambientS180  unfold cuspS181  simp [RingHom.map_add, RingHom.map_sub, RingHom.map_mul, RingHom.map_pow,182    RingHom.map_numeral, h, u, v, w]183  unfold Ring.sub184  simp [Ring.pow.value, complexRing.addOf, complexRing.mulOf, complexRing.negOf,185    complexRing.zeroOf, complexRing.oneOf]186  exact criticalArithmetic.s_is_one187188theorem criticalPoint.eval_p189  shows evaluationAt(complexRing, 4, criticalPoint)(ambientP) =190    ringNat(complexAdd, complexZero, complexOne, 2)191proof192  have function := criticalPoint.function193  have ambient : CommRing(polynomialRing(complexRing, 4)) :=194    polynomialRing.comm_ring with *195  have hom := evaluationAt.hom at complexRing, 4, criticalPoint with *196  have x := criticalPoint.eval_x197  have y := criticalPoint.eval_y198  have s := criticalPoint.eval_s199  unfold ambientP200  unfold shiftP201  rw RingHom.map_sub with *202  rw RingHom.map_add with *203  rw RingHom.map_mul with *204  rw RingHom.map_mul with *205  rw RingHom.map_neg with *206  rw RingHom.map_pow with *207  rw RingHom.map_numeral with *208  rw [x, y, s]209  rw [← complexRing.addOf, ← complexRing.zeroOf, ← complexRing.negOf,210    ← complexRing.oneOf]211  ring212213theorem criticalPoint.eval_F214  shows evaluationAt(complexRing, 4, criticalPoint)(ambientF) =215    complexNeg(complexOne)216proof217  have function := criticalPoint.function218  have ambient : CommRing(polynomialRing(complexRing, 4)) :=219    polynomialRing.comm_ring with *220  have hom := evaluationAt.hom at complexRing, 4, criticalPoint with *221  have h := criticalPoint.value_h222  have p := criticalPoint.eval_p223  unfold ambientF224  rw RingHom.map_sub with *225  rw RingHom.map_sub with *226  rw RingHom.map_one with *227  rw [h, p, criticalH.numeral]228  rw [← complexRing.addOf, ← complexRing.zeroOf, ← complexRing.negOf,229    ← complexRing.oneOf]230  unfold Ring.sub231  ring232233theorem criticalPoint.eval_shiftX234  shows evaluationAt(complexRing, 4, criticalPoint)(shiftX) = complexZero235proof236  have function := criticalPoint.function237  have ambient : CommRing(polynomialRing(complexRing, 4)) :=238    polynomialRing.comm_ring with *239  have hom := evaluationAt.hom at complexRing, 4, criticalPoint with *240  have x := criticalPoint.eval_x241  have s := criticalPoint.eval_s242  unfold shiftX243  rw RingHom.map_add with *244  rw RingHom.map_pow with *245  rw [x, s]246  rw [← complexRing.zeroOf, ← complexRing.negOf, ← complexRing.oneOf]247  ring248249theorem criticalPoint.eval_shiftY250  shows evaluationAt(complexRing, 4, criticalPoint)(shiftY) = complexZero251proof252  have function := criticalPoint.function253  have ambient : CommRing(polynomialRing(complexRing, 4)) :=254    polynomialRing.comm_ring with *255  have hom := evaluationAt.hom at complexRing, 4, criticalPoint with *256  have y := criticalPoint.eval_y257  have s := criticalPoint.eval_s258  unfold shiftY259  rw RingHom.map_sub with *260  rw RingHom.map_pow with *261  rw [y, s]262  rw [← complexRing.zeroOf, ← complexRing.oneOf]263  unfold Ring.sub264  ring265266-- The partial derivatives: from the ambient identity A² + D³ = E(1 + f)267-- to the vanishing of every ∂ᵢf at the point.268section AmbientIdentity269variable (R I point : Set)270hypothesis ring : CommRing(R)271hypothesis polynomials : CommRing(polynomialRing(R, I))272hypothesis values : point : I → Ring.carrier(R)273274-- If A² + D³ = E(1 + f) and at a point A, D vanish, E is 1, and f is −1,275-- then every partial derivative of f vanishes at the point.276theorem critical_of_ambient_identity (A D E f i : Set)277  requires aIn : A ∈ Ring.carrier(polynomialRing(R, I))278  requires dIn : D ∈ Ring.carrier(polynomialRing(R, I))279  requires eIn : E ∈ Ring.carrier(polynomialRing(R, I))280  requires fIn : f ∈ Ring.carrier(polynomialRing(R, I))281  requires identity : A^2 + D^3 = E * (Ring.one(polynomialRing(R, I)) + f)282  requires evalA : evaluationAt(R, I, point)(A) = R[0]283  requires evalD : evaluationAt(R, I, point)(D) = R[0]284  requires evalE : evaluationAt(R, I, point)(E) = R[1]285  requires evalF : evaluationAt(R, I, point)(f) = -R[1]286  requires index : i ∈ I287  shows evaluationAt(R, I, point)(partialDerivative(R, I, i)(f)) = R[0]288proof289  have evaluation := evaluationAt.hom at R, I, point with ring, values290  have oneIn : R[1] ∈ R := Ring.one_mem with *291  have constants := polynomialConstant.hom at R, I with ring292  have oneConstant := RingHom.map_one with constants293  have derivativeOne := partialDerivative.constant at R, I, i, R[1] with *294  rw oneConstant at derivativeOne295  have two : (1:Nat) + 1 = 2 by arith296  have three : (2:Nat) + 1 = 3 by arith297  have powA := partialDerivative.pow at R, I, i, A, 1 with *298  have powD := partialDerivative.pow at R, I, i, D, 2 with *299  rw two at powA300  rw three at powD301  -- Differentiate the identity and evaluate: 2A·∂A + 3D²·∂D =302  -- ∂E·(1 + f) + E·∂f becomes 0 = ∂f at the point.303  have evaluated :304      evaluationAt(R, I, point)(partialDerivative(R, I, i)(A^2 + D^3)) =305      evaluationAt(R, I, point)(partialDerivative(R, I, i)(E *306        (Ring.one(polynomialRing(R, I)) + f)))307    rw identity308  clear identity309  simp [partialDerivative.add, partialDerivative.mul, powA, powD, derivativeOne,310    RingHom.map_add, RingHom.map_mul, RingHom.map_pow, RingHom.map_numeral,311    RingHom.map_one, RingHom.map_zero, evalA, evalD, evalE, evalF] at evaluated312  linear_combination (-R[1]) * evaluated313314end AmbientIdentity315316theorem criticalPoint.derivatives (i : Set)317  requires index : i ∈ 4318  shows evaluationAt(complexRing, 4, criticalPoint)(319      partialDerivative(complexRing, 4, i)(ambientF)) =320    complexZero321proof322  have ambient : CommRing(polynomialRing(complexRing, 4)) :=323    polynomialRing.comm_ring with *324  have function := criticalPoint.function325  have identity := ambient.identity with *326  have aIn := shiftX.mem with *327  have dIn := shiftY.mem with *328  have eIn := ambientS.mem with *329  have fIn := ambientF.mem with *330  have evalA := criticalPoint.eval_shiftX331  have evalD := criticalPoint.eval_shiftY332  have evalE := criticalPoint.eval_s333  have evalF := criticalPoint.eval_F334  rw ← complexRing.zeroOf at evalA, evalD335  rw ← complexRing.oneOf at evalE, evalF336  rw ← complexRing.negOf at evalF337  have result := critical_of_ambient_identity at complexRing, 4, criticalPoint,338    shiftX, shiftY, ambientS, ambientF, i with *339  rw complexRing.zeroOf at result340  exact result341