File size: 5,789 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | 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
|