Download data/lean/OAI/NumberTheory/PiExponent/Geometry/CurveContact.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 7.58 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/PiExponent/Geometry/CurveContact.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/NumberTheory/PiExponent/Geometry/CurveContact.lean
-
curl -L -o CurveContact.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/PiExponent/Geometry/CurveContact.lean
7.58 kB
| import Mathlib.RingTheory.Ideal.Span | |
| import Mathlib.Tactic.Linarith | |
| import OAI.NumberTheory.PiExponent.Approximation.PersistentComponents | |
| import OAI.NumberTheory.PiExponent.Polynomials.PolynomialFrame | |
| namespace OAI | |
| namespace PiExponentApprox | |
| noncomputable section | |
| def frameWordCost {m : β} (cost : Fin (m + 1) β β) | |
| (word : List (Fin (m + 1))) : β := (word.map cost).sum | |
| @[simp] theorem frameWordCost_nil {m : β} (cost : Fin (m + 1) β β) : | |
| frameWordCost cost [] = 0 := rfl | |
| @[simp] theorem frameWordCost_cons {m : β} (cost : Fin (m + 1) β β) | |
| (i : Fin (m + 1)) (word : List (Fin (m + 1))) : | |
| frameWordCost cost (i :: word) = cost i + frameWordCost cost word := rfl | |
| theorem frameWordCost_nonneg {m : β} (cost : Fin (m + 1) β β) | |
| (hcost : β i, 0 β€ cost i) (word : List (Fin (m + 1))) : | |
| 0 β€ frameWordCost cost word := by | |
| induction word with | |
| | nil => exact le_refl 0 | |
| | cons i word ih => exact add_nonneg (hcost i) ih | |
| def frameDerivativeIdeal {m : β} (cost : Fin (m + 1) β β) | |
| (bound : β) (F : FramePolynomial m) : Ideal (FramePolynomial m) := | |
| Ideal.span {g | β word, frameWordCost cost word β€ bound β§ | |
| polynomialFrameWord m word F = g} | |
| theorem frameWord_mem_derivativeIdeal {m : β} (cost : Fin (m + 1) β β) | |
| (bound : β) (F : FramePolynomial m) (word : List (Fin (m + 1))) | |
| (hword : frameWordCost cost word β€ bound) : | |
| polynomialFrameWord m word F β frameDerivativeIdeal cost bound F := | |
| Ideal.subset_span β¨word, hword, rflβ© | |
| theorem frameDerivativeIdeal_mono {m : β} (cost : Fin (m + 1) β β) | |
| (F : FramePolynomial m) {a b : β} (hab : a β€ b) : | |
| frameDerivativeIdeal cost a F β€ frameDerivativeIdeal cost b F := by | |
| apply Ideal.span_mono | |
| intro g hg | |
| obtain β¨word, hword, rflβ© := hg | |
| exact β¨word, hword.trans hab, rflβ© | |
| theorem polynomial_mem_frameDerivativeIdeal {m : β} | |
| (cost : Fin (m + 1) β β) (bound : β) (F : FramePolynomial m) | |
| (hbound : 0 β€ bound) : F β frameDerivativeIdeal cost bound F := | |
| frameWord_mem_derivativeIdeal cost bound F [] hbound | |
| def polynomialDerivativeCore {m : β} | |
| (D : Derivation β (FramePolynomial m) (FramePolynomial m)) | |
| (I : Ideal (FramePolynomial m)) : Ideal (FramePolynomial m) where | |
| carrier := {p | p β I β§ D p β I} | |
| zero_mem' := by simp only [Set.mem_ofPred_eq, D.map_zero]; exact β¨I.zero_mem, I.zero_memβ© | |
| add_mem' := by | |
| intro p q hp hq | |
| refine β¨I.add_mem hp.1 hq.1, ?_β© | |
| rw [map_add] | |
| exact I.add_mem hp.2 hq.2 | |
| smul_mem' := by | |
| intro r p hp | |
| change r * p β I β§ D (r * p) β I | |
| refine β¨I.mul_mem_left r hp.1, ?_β© | |
| rw [Derivation.leibniz] | |
| exact I.add_mem (I.mul_mem_left r hp.2) (by | |
| simpa only [smul_eq_mul, mul_comm] using I.mul_mem_left (D r) hp.1) | |
| theorem polynomialFrame_mem_derivativeIdeal {m : β} | |
| (cost : Fin (m + 1) β β) (hcost : β i, 0 β€ cost i) | |
| (bound : β) (F p : FramePolynomial m) (i : Fin (m + 1)) | |
| (hp : p β frameDerivativeIdeal cost bound F) : | |
| polynomialFrame m i p β frameDerivativeIdeal cost (bound + cost i) F := by | |
| let I := frameDerivativeIdeal cost (bound + cost i) F | |
| have hle : frameDerivativeIdeal cost bound F β€ | |
| polynomialDerivativeCore (polynomialFrame m i) I := by | |
| apply Ideal.span_le.mpr | |
| intro g hg | |
| obtain β¨word, hword, rflβ© := hg | |
| refine β¨?_, ?_β© | |
| Β· exact frameWord_mem_derivativeIdeal cost (bound + cost i) F word | |
| (hword.trans (le_add_of_nonneg_right (hcost i))) | |
| Β· exact frameWord_mem_derivativeIdeal cost (bound + cost i) F (i :: word) | |
| (by simpa only [frameWordCost_cons, add_comm] using add_le_add_left hword (cost i)) | |
| exact (hle hp).2 | |
| theorem polynomialFrameWord_mem_derivativeIdeal {m : β} | |
| (cost : Fin (m + 1) β β) (hcost : β i, 0 β€ cost i) | |
| (bound : β) (F p : FramePolynomial m) (word : List (Fin (m + 1))) | |
| (hp : p β frameDerivativeIdeal cost bound F) : | |
| polynomialFrameWord m word p β | |
| frameDerivativeIdeal cost (bound + frameWordCost cost word) F := by | |
| induction word with | |
| | nil => simpa only [polynomialFrameWord_nil, frameWordCost_nil, add_zero] using hp | |
| | cons i word ih => | |
| have h := polynomialFrame_mem_derivativeIdeal cost hcost | |
| (bound + frameWordCost cost word) F (polynomialFrameWord m word p) i ih | |
| simpa only [polynomialFrameWord_cons, frameWordCost_cons, add_assoc, | |
| add_comm (frameWordCost cost word) (cost i)] using h | |
| theorem derivative_vanishes_on_persistent_ideal {m : β} | |
| (cost : Fin (m + 1) β β) (hcost : β i, 0 β€ cost i) | |
| (bound delta : β) (F p : FramePolynomial m) | |
| (P : Ideal (FramePolynomial m)) | |
| (hp : p β frameDerivativeIdeal cost bound F) | |
| (hpersist : frameDerivativeIdeal cost (bound + delta) F β€ P) | |
| (word : List (Fin (m + 1))) (hword : frameWordCost cost word β€ delta) : | |
| polynomialFrameWord m word p β P := by | |
| apply hpersist | |
| have hbound : bound + frameWordCost cost word β€ bound + delta := by linarith | |
| exact frameDerivativeIdeal_mono cost F hbound | |
| (polynomialFrameWord_mem_derivativeIdeal cost hcost bound F p word hp) | |
| theorem frameDerivativeIdeal_levels_monotone {m : β} | |
| (cost : Fin (m + 1) β β) (delta : β) (hdelta : 0 β€ delta) | |
| (F : FramePolynomial m) : | |
| Monotone (fun r : β => frameDerivativeIdeal cost ((r : β) * delta) F) := by | |
| intro a b hab | |
| apply frameDerivativeIdeal_mono | |
| exact mul_le_mul_of_nonneg_right (Nat.cast_le.mpr hab) hdelta | |
| theorem exists_persistent_frame_component {m : β} | |
| (cost : Fin (m + 1) β β) (hcost : β i, 0 β€ cost i) | |
| (delta : β) (hdelta : 0 β€ delta) (F : FramePolynomial m) (hF : F β 0) | |
| (P : Ideal (FramePolynomial m)) (hP : P.IsPrime) (hheight : P.height β€ m) | |
| (hvanish : β word : List (Fin (m + 1)), | |
| frameWordCost cost word β€ ((m : β) + 2) * delta β | |
| polynomialFrameWord m word F β P) : | |
| β r < m + 2, β Q : Ideal (FramePolynomial m), | |
| Q β (frameDerivativeIdeal cost ((r : β) * delta) F).minimalPrimes β§ | |
| Q β (frameDerivativeIdeal cost (((r : β) + 1) * delta) F).minimalPrimes β§ | |
| Q β€ P β§ 1 β€ Q.height β§ Q.height β€ m β§ | |
| β p β frameDerivativeIdeal cost ((r : β) * delta) F, | |
| β word : List (Fin (m + 1)), frameWordCost cost word β€ delta β | |
| polynomialFrameWord m word p β Q := by | |
| let I : β β Ideal (FramePolynomial m) := | |
| fun r => frameDerivativeIdeal cost ((r : β) * delta) F | |
| have hI : Monotone I := frameDerivativeIdeal_levels_monotone cost delta hdelta F | |
| have htop : I (m + 2) β€ P := by | |
| apply Ideal.span_le.mpr | |
| intro g hg | |
| obtain β¨word, hword, rflβ© := hg | |
| apply hvanish word | |
| simpa only [Nat.cast_add, Nat.cast_ofNat] using hword | |
| have hinitial : F β I 0 := by | |
| simpa only [I, Nat.cast_zero, zero_mul] using | |
| polynomial_mem_frameDerivativeIdeal cost 0 F (le_refl 0) | |
| obtain β¨r, hr, Q, hQr, hQnext, hQP, hQlo, hQhiβ© := | |
| PiExponent.PersistentComponents.exists_persistent_component_positive_height | |
| I hI m P hP htop hheight hF hinitial | |
| refine β¨r, hr, Q, hQr, ?_, hQP, hQlo, hQhi, ?_β© | |
| Β· simpa only [I, Nat.cast_add, Nat.cast_one] using hQnext | |
| Β· intro p hp word hword | |
| apply derivative_vanishes_on_persistent_ideal cost hcost | |
| ((r : β) * delta) delta F p Q hp | |
| Β· have hb : (r : β) * delta + delta = ((r + 1 : β) : β) * delta := by | |
| push_cast | |
| ring | |
| rw [hb] | |
| exact hQnext.le | |
| Β· exact hword | |
| end | |
| end PiExponentApprox | |
| end OAI | |