Download data/lean/OAI/Algebra/Divisor/Normalization.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 2.8 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Algebra/Divisor/Normalization.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Algebra/Divisor/Normalization.lean
-
curl -L -o Normalization.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Algebra/Divisor/Normalization.lean
2.8 kB
| import Mathlib | |
| namespace OAI | |
| noncomputable section | |
| open scoped BigOperators | |
| namespace ControlledBoundary.FormalDivisor | |
| variable {Prime : Type*} | |
| def positivePart (D : Prime ββ β) : Prime ββ β := | |
| D.mapRange (fun x => max x 0) (by simp) | |
| def negativePart (D : Prime ββ β) : Prime ββ β := | |
| D.mapRange (fun x => max (-x) 0) (by simp) | |
| lemma positivePart_nonneg (D : Prime ββ β) : 0 β€ positivePart D := | |
| fun _ => le_max_right _ _ | |
| lemma negativePart_nonneg (D : Prime ββ β) : 0 β€ negativePart D := | |
| fun _ => le_max_right _ _ | |
| lemma signed_decomposition (D : Prime ββ β) : | |
| positivePart D - negativePart D = D := by | |
| ext p | |
| change max (D p) 0 - max (-D p) 0 = D p | |
| rcases le_total 0 (D p) with h | h | |
| Β· rw [max_eq_left h, max_eq_right (neg_nonpos.mpr h), sub_zero] | |
| Β· rw [max_eq_right h, max_eq_left (neg_nonneg.mpr h)] | |
| ring | |
| lemma positivePart_coeff_lt_one (D : Prime ββ β) (h : β p, D p < 1) : | |
| β p, positivePart D p < 1 := by | |
| intro p | |
| exact max_lt (h p) zero_lt_one | |
| lemma negativePart_support_subset (D : Prime ββ β) (S : Finset Prime) | |
| (h : β p, p β S β 0 β€ D p) : (negativePart D).support β S := by | |
| intro p hp | |
| by_contra hn | |
| have hz : negativePart D p = 0 := max_eq_right (neg_nonpos.mpr (h p hn)) | |
| exact (Finsupp.mem_support_iff.mp hp) hz | |
| lemma negativePart_signed_support [DecidableEq Prime] (G J K : Prime ββ β) | |
| (s : β) (hs : 0 β€ s) (hG : 0 β€ G) : | |
| (negativePart (s β’ G - J - K)).support β J.support βͺ K.support := by | |
| classical | |
| apply negativePart_support_subset | |
| intro p hp | |
| have hJ : J p = 0 := Finsupp.notMem_support_iff.mp (fun h => | |
| hp (Finset.mem_union_left _ h)) | |
| have hK : K p = 0 := Finsupp.notMem_support_iff.mp (fun h => | |
| hp (Finset.mem_union_right _ h)) | |
| simpa only [Finsupp.sub_apply, Finsupp.smul_apply, smul_eq_mul, hJ, hK, sub_zero] | |
| using mul_nonneg hs (hG p) | |
| theorem normalize_correction {n : β} | |
| (M F E C : Prime ββ β) (P : Fin n β Prime ββ β) (a : Fin n β β) | |
| (t : β) (ht : 0 < t) (hF : 0 β€ F) (hE : 0 β€ E) | |
| (hSupp : F.support β C.support) | |
| (hrep : E = t β’ M + F + β j, a j β’ P j) : | |
| β Cβ Eβ : Prime ββ β, | |
| 0 β€ Cβ β§ Cβ.support β C.support β§ 0 β€ Eβ β§ | |
| Eβ = M + Cβ + β j, (tβ»ΒΉ * a j) β’ P j := by | |
| refine β¨tβ»ΒΉ β’ F, tβ»ΒΉ β’ E, ?_, ?_, ?_, ?_β© | |
| Β· intro p | |
| exact mul_nonneg (inv_nonneg.mpr ht.le) (hF p) | |
| Β· exact (Finsupp.support_smul).trans hSupp | |
| Β· intro p | |
| exact mul_nonneg (inv_nonneg.mpr ht.le) (hE p) | |
| Β· rw [hrep, smul_add, smul_add, smul_smul, inv_mul_cancelβ (ne_of_gt ht), | |
| one_smul, Finset.smul_sum] | |
| simp only [smul_smul] | |
| end ControlledBoundary.FormalDivisor | |
| end | |
| end OAI | |