Download data/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/PolygonArithmetic.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 5.59 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/PolygonArithmetic.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/PolygonArithmetic.lean
-
curl -L -o PolygonArithmetic.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/PolygonArithmetic.lean
5.59 kB
| import Mathlib | |
| namespace OAI | |
| section | |
| section | |
| open scoped symmDiff | |
| namespace SimpleAmenable | |
| section PolygonArithmetic | |
| abbrev CutRing := QuadraticAlgebra β€ 1 1 | |
| noncomputable def ordinary : CutRing ββ[β€] β := | |
| QuadraticAlgebra.lift β¨Real.goldenRatio, by | |
| simp only [one_smul, β sq] | |
| linarith [Real.goldenRatio_sq]β© | |
| noncomputable def conjugate : CutRing ββ[β€] β := | |
| QuadraticAlgebra.lift β¨Real.goldenConj, by | |
| simp only [one_smul, β sq] | |
| linarith [Real.goldenConj_sq]β© | |
| theorem ordinary_apply (z : CutRing) : | |
| ordinary z = (z.re : β) + (z.im : β) * Real.goldenRatio := by | |
| simp [ordinary, QuadraticAlgebra.lift] | |
| theorem conjugate_apply (z : CutRing) : | |
| conjugate z = (z.re : β) + (z.im : β) * Real.goldenConj := by | |
| simp [conjugate, QuadraticAlgebra.lift] | |
| private theorem golden_coefficients_unique {p q : β€} | |
| (h : (p : β) + (q : β) * Real.goldenRatio = 0) : p = 0 β§ q = 0 := by | |
| have hq : q = 0 := by | |
| by_contra hq | |
| have hir := (Real.goldenRatio_irrational.intCast_mul hq).intCast_add p | |
| exact hir.ne_int 0 (by simpa using h) | |
| exact β¨by simpa [hq] using h, hqβ© | |
| theorem ordinary_injective : Function.Injective ordinary := by | |
| intro x y h | |
| have hz : ordinary (x - y) = 0 := by simp [h] | |
| obtain β¨hre, himβ© := golden_coefficients_unique ((ordinary_apply (x - y)).symm.trans hz) | |
| apply QuadraticAlgebra.ext | |
| Β· exact sub_eq_zero.mp hre | |
| Β· exact sub_eq_zero.mp him | |
| theorem conjugate_eq_ordinary_star (z : CutRing) : conjugate z = ordinary (star z) := by | |
| simp only [conjugate_apply, ordinary_apply, QuadraticAlgebra.re_star, | |
| QuadraticAlgebra.im_star, Int.cast_add, Int.cast_neg, one_mul] | |
| rw [β Real.one_sub_goldenConj] | |
| ring | |
| theorem conjugate_injective : Function.Injective conjugate := by | |
| intro x y h | |
| have : star x = star y := ordinary_injective (by simpa only [conjugate_eq_ordinary_star] using h) | |
| simpa using congrArg star this | |
| theorem cut_norm_identity (z : CutRing) : | |
| ordinary z * conjugate z = ((QuadraticAlgebra.norm z : β€) : β) := by | |
| rw [conjugate_eq_ordinary_star, β map_mul, | |
| β QuadraticAlgebra.algebraMap_norm_eq_mul_star] | |
| simp | |
| theorem cut_norm_nonzero {z : CutRing} (hz : z β 0) : QuadraticAlgebra.norm z β 0 := by | |
| intro h | |
| have hx : ordinary z β 0 := by simpa using ordinary_injective.ne hz | |
| have hy : conjugate z β 0 := by simpa using conjugate_injective.ne hz | |
| exact mul_ne_zero hx hy (by simp [cut_norm_identity, h]) | |
| theorem one_le_abs_cut_norm {z : CutRing} (hz : z β 0) : | |
| 1 β€ |ordinary z * conjugate z| := by | |
| rw [cut_norm_identity, β Int.cast_abs] | |
| exact_mod_cast Int.one_le_abs (cut_norm_nonzero hz) | |
| def endpointLabel (z : CutRing) : β€ := z.im | |
| theorem endpointLabel_embedding (z : CutRing) : | |
| (endpointLabel z : β) = (ordinary z - conjugate z) / Real.sqrt 5 := by | |
| have hs : Real.sqrt 5 β 0 := ne_of_gt (Real.sqrt_pos.mpr (by norm_num)) | |
| apply (eq_div_iff hs).mpr | |
| simp only [ordinary_apply, conjugate_apply, endpointLabel] | |
| rw [β Real.goldenRatio_sub_goldenConj] | |
| ring | |
| noncomputable abbrev cutTau : CutRing := QuadraticAlgebra.omega | |
| @[simp] theorem ordinary_cutTau : ordinary cutTau = Real.goldenRatio := by simp [cutTau, ordinary_apply] | |
| @[simp] theorem conjugate_cutTau : conjugate cutTau = Real.goldenConj := by simp [cutTau, conjugate_apply] | |
| theorem cutTau_isUnit : IsUnit cutTau := by | |
| apply QuadraticAlgebra.isUnit_iff_norm_isUnit.mpr | |
| norm_num [cutTau, QuadraticAlgebra.norm_def] | |
| noncomputable def cutForm (a : β) (j : Fin 4) (p : β Γ β) : β := | |
| ![p.1, p.2, p.2 - Real.goldenRatio ^ a * p.1, | |
| p.1 - Real.goldenRatio ^ a * p.2] j | |
| noncomputable def integralCutForm (a : β) (j : Fin 4) (p : CutRing Γ CutRing) : CutRing := | |
| ![p.1, p.2, p.2 - cutTau ^ a * p.1, p.1 - cutTau ^ a * p.2] j | |
| theorem cutForm_ordinary (a : β) (j : Fin 4) (p : CutRing Γ CutRing) : | |
| cutForm a j (ordinary p.1, ordinary p.2) = ordinary (integralCutForm a j p) := by | |
| fin_cases j <;> simp [cutForm, integralCutForm] | |
| theorem cutForm_add (a : β) (j : Fin 4) (p q : β Γ β) : | |
| cutForm a j (p + q) = cutForm a j p + cutForm a j q := by | |
| fin_cases j <;> simp [cutForm] <;> ring | |
| def AvoidsCuts (a : β) (p : β Γ β) : Prop := | |
| β (j : Fin 4) (z : CutRing), cutForm a j p β ordinary z | |
| theorem avoidsCuts_translate {a : β} {p : β Γ β} (hp : AvoidsCuts a p) | |
| (u : CutRing Γ CutRing) : AvoidsCuts a (p + (ordinary u.1, ordinary u.2)) := by | |
| intro j z hz | |
| apply hp j (z - integralCutForm a j u) | |
| rw [cutForm_add, cutForm_ordinary] at hz | |
| simpa only [map_sub] using eq_sub_of_add_eq hz | |
| def GenericSquare (a : β) := | |
| {p : β Γ β // p.1 β Set.Ico 0 1 β§ p.2 β Set.Ico 0 1 β§ AvoidsCuts a p} | |
| def halfPlane (a : β) (j : Fin 4) (z : CutRing) : Set (GenericSquare a) := | |
| {p | cutForm a j p.val < ordinary z} | |
| def polygonAlgebra (a : β) : BooleanSubalgebra (Set (GenericSquare a)) := | |
| BooleanSubalgebra.closure {U | β j z, U = halfPlane a j z} | |
| theorem polygon_induction {a : β} {P : Set (GenericSquare a) β Prop} | |
| (hcut : β j z, P (halfPlane a j z)) (hbot : P β ) | |
| (hsup : β U V, P U β P V β P (U βͺ V)) | |
| (hcompl : β U, P U β P UαΆ) {U : Set (GenericSquare a)} | |
| (hU : U β polygonAlgebra a) : P U := by | |
| induction hU using BooleanSubalgebra.closure_bot_sup_induction with | |
| | mem U h => obtain β¨j, z, rflβ© := h; exact hcut j z | |
| | bot => exact hbot | |
| | sup U hU V hV ihU ihV => exact hsup U V ihU ihV | |
| | compl U hU ih => exact hcompl U ih | |
| end PolygonArithmetic | |
| end SimpleAmenable | |
| end | |
| end | |
| end OAI | |