Download data/lean/OAI/NumberTheory/Ostmann/Tree/CycleLocalMajorantsBasic.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 5.79 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/Ostmann/Tree/CycleLocalMajorantsBasic.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/NumberTheory/Ostmann/Tree/CycleLocalMajorantsBasic.lean
-
curl -L -o CycleLocalMajorantsBasic.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/Ostmann/Tree/CycleLocalMajorantsBasic.lean
5.79 kB
| import OAI.NumberTheory.Ostmann.Tree.CycleQuartetActionsClassification | |
| import OAI.NumberTheory.Ostmann.Tree.QuartetLocal | |
| import OAI.NumberTheory.Ostmann.Tree.QuartetRemainingMeans | |
| namespace OAI | |
| noncomputable section | |
| open scoped BigOperators | |
| namespace Ostmann.Tree.CycleQuartet | |
| open Quartet Ostmann.FiniteField | |
| variable {p : β} [Fact p.Prime] | |
| local instance cycleLocalMajorantCharDecEq : DecidableEq (MulChar (ZMod p) β) := Classical.decEq _ | |
| def bottomSign (P : Parameters (ZMod p) 2) (side freeRight : Bool) : Bool := | |
| match P with | |
| | .branch _ _ _ _ L R => parameterSign (if side then R else L) freeRight | |
| def orientedCharacter (inverse : Bool) (Ο : MulChar (ZMod p) β) : MulChar (ZMod p) β := | |
| if inverse then Οβ»ΒΉ else Ο | |
| def selectedMajorant (P : Parameters (ZMod p) 2) (g : ZMod p β β) | |
| (ΞΊ : Kind) (Ο : MulChar (ZMod p) β) (y : ZMod p) : β := | |
| match ΞΊ with | |
| | .same side inverse => FiniteField.sameLocalMajorant g | |
| (bottomSign P side false) (bottomSign P (!side) false) side (orientedCharacter inverse Ο) y | |
| | .cross a b inverse => FiniteField.crossLocalMajorant g | |
| (bottomSign P false a) (bottomSign P true b) a b (orientedCharacter inverse Ο) y | |
| def unselectedMajorant (P : Parameters (ZMod p) 2) (g : ZMod p β β) | |
| (Ο : MulChar (ZMod p) β) (y : ZMod p) : β := | |
| if Ο=1 then FiniteField.untouchedLocalMajorant g (bottomSign P false false) | |
| (bottomSign P true false) y else 0 | |
| theorem selectedMajorant_nonneg (P : Parameters (ZMod p) 2) (g : ZMod p β β) | |
| (ΞΊ : Kind) (Ο : MulChar (ZMod p) β) (y : ZMod p) : | |
| 0β€ selectedMajorant P g ΞΊ Ο y := by | |
| cases ΞΊ with | |
| | same side inverse => exact FiniteField.sameLocalMajorant_nonneg _ _ _ _ _ _ | |
| | cross a b inverse => exact FiniteField.crossLocalMajorant_nonneg _ _ _ _ _ _ _ | |
| theorem unselectedMajorant_nonneg (P : Parameters (ZMod p) 2) (g : ZMod p β β) | |
| (Ο : MulChar (ZMod p) β) (y : ZMod p) : 0β€ unselectedMajorant P g Ο y := by | |
| unfold unselectedMajorant | |
| split_ifs | |
| Β· exact FiniteField.untouchedLocalMajorant_nonneg _ _ _ _ | |
| Β· exact le_rfl | |
| theorem selectedMajorant_mean_small (P : Parameters (ZMod p) 2) (g : ZMod p β β) | |
| (ΞΊ : Kind) (Ο : MulChar (ZMod p) β) (hg0 : g 0=0) (hg : l2Sq gβ€1) : | |
| unitMean (selectedMajorant P g ΞΊ Ο)β€25600*treeError g := by | |
| cases ΞΊ with | |
| | same side inverse => | |
| exact (FiniteField.sameLocalMajorant_mean_small _ _ _ _ _ hg0 hg).trans | |
| (mul_le_mul_of_nonneg_right (by norm_num) (treeError_nonneg g)) | |
| | cross a b inverse => exact FiniteField.crossLocalMajorant_mean_small _ _ _ _ _ _ hg0 hg | |
| omit [Fact p.Prime] in | |
| theorem sum_orientedCharacter (inverse : Bool) (H : MulChar (ZMod p) β β β) : | |
| (β Ο : MulChar (ZMod p) β,H (orientedCharacter inverse Ο)) = β Ο : MulChar (ZMod p) β,H Ο := by | |
| cases inverse | |
| Β· rfl | |
| Β· exact (Equiv.inv (MulChar (ZMod p) β)).bijective.sum_comp H | |
| theorem selectedMajorant_mean_total (P : Parameters (ZMod p) 2) (g : ZMod p β β) | |
| (ΞΊ : Kind) (hg0 : g 0=0) (hg : l2Sq gβ€1) : | |
| (β Ο : MulChar (ZMod p) β,unitMean (selectedMajorant P g ΞΊ Ο))β€256 := by | |
| cases ΞΊ with | |
| | same side inverse => | |
| change (β Ο : MulChar (ZMod p) β,unitMean (FiniteField.sameLocalMajorant g | |
| (bottomSign P side false) (bottomSign P (!side) false) side (orientedCharacter inverse Ο)))β€256 | |
| rw [sum_orientedCharacter inverse (fun Ο => unitMean (FiniteField.sameLocalMajorant g | |
| (bottomSign P side false) (bottomSign P (!side) false) side Ο))] | |
| exact FiniteField.sameLocalMajorant_mean_total _ _ _ _ hg0 hg | |
| | cross a b inverse => | |
| change (β Ο : MulChar (ZMod p) β,unitMean (FiniteField.crossLocalMajorant g | |
| (bottomSign P false a) (bottomSign P true b) a b (orientedCharacter inverse Ο)))β€256 | |
| rw [sum_orientedCharacter inverse (fun Ο => unitMean (FiniteField.crossLocalMajorant g | |
| (bottomSign P false a) (bottomSign P true b) a b Ο))] | |
| exact (FiniteField.crossLocalMajorant_mean_total _ _ _ _ _ hg0 hg).trans (by norm_num) | |
| theorem unselectedMajorant_mean_total (P : Parameters (ZMod p) 2) (g : ZMod p β β) | |
| (hg0 : g 0=0) (hg : l2Sq gβ€1) : | |
| (β Ο : MulChar (ZMod p) β,unitMean (unselectedMajorant P g Ο))β€256 := by | |
| classical | |
| have he (Ο : MulChar (ZMod p) β) : unitMean (unselectedMajorant P g Ο) = | |
| if Ο=1 then unitMean (FiniteField.untouchedLocalMajorant g (bottomSign P false false) | |
| (bottomSign P true false)) else 0 := by | |
| by_cases hΟ : Ο=1 <;> simp [unselectedMajorant,hΟ,unitMean] | |
| simp_rw [he] | |
| simp only [Finset.sum_ite_eq',Finset.mem_univ,ite_true] | |
| exact (FiniteField.untouchedLocalMajorant_mean _ _ _ hg0 hg).trans (by norm_num) | |
| theorem selectedMajorant_same_node (N : NodeInput (ZMod p) 1) (g : ZMod p β β) | |
| (side inverse : Bool) (Ο : MulChar (ZMod p) β) (y : ZMod p) : | |
| selectedMajorant N.parameters g (.same side inverse) Ο y = | |
| N.sameLocalMajorant g side (orientedCharacter inverse Ο) y := by | |
| cases side <;> rfl | |
| theorem selectedMajorant_cross_node (N : NodeInput (ZMod p) 1) (g : ZMod p β β) | |
| (a b inverse : Bool) (Ο : MulChar (ZMod p) β) (y : ZMod p) : | |
| selectedMajorant N.parameters g (.cross a b inverse) Ο y = | |
| N.crossLocalMajorant g a b (orientedCharacter inverse Ο) y := by | |
| simp only [selectedMajorant, bottomSign, NodeInput.parameters, Bool.false_eq_true, | |
| βreduceIte, FiniteField.crossLocalMajorant, NodeInput.crossLocalMajorant, | |
| norm_div, Complex.norm_natCast] | |
| theorem unselectedMajorant_node (N : NodeInput (ZMod p) 1) (g : ZMod p β β) | |
| (Ο : MulChar (ZMod p) β) (y : ZMod p) : | |
| unselectedMajorant N.parameters g Ο y = if Ο=1 then N.untouchedLocalMajorant g y else 0 := rfl | |
| end Ostmann.Tree.CycleQuartet | |
| end | |
| end OAI | |