File size: 3,663 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 | import OAI.LinearAlgebra.MatrixMultiplication.FieldParameters.HalfLaws
namespace OAI
/-! Fixed rational distributions and their entropy and capacity formulas. -/
namespace MatrixMultiplication.AllFieldParameters
open scoped BigOperators
theorem normalized_singleton_law {A : Type*} [Fintype A] [DecidableEq A]
(p : A β β) (a : A) (hp : β i, p i = 1)
(hs : β i, i β a β p i = 0) (i : A) : p i = if i = a then 1 else 0 := by
have ha : p a = 1 := by
have hsum : (β i, p i) = p a := by
apply Finset.sum_eq_single a
Β· intro i _ hi
exact hs i hi
Β· simp
exact hsum.symm.trans hp
by_cases hi : i = a
Β· simp [hi, ha]
Β· simp [hi, hs i hi]
theorem pairWeight_zero : β ij : PairSlot,
statisticWeight ij.1 + statisticWeight ij.2 = 0 β ij = (0,0) := by decide +kernel
theorem pairWeight_eight : β ij : PairSlot,
statisticWeight ij.1 + statisticWeight ij.2 = 8 β ij = (5,5) := by decide +kernel
theorem pairKappa_zero : β ij : PairSlot,
(kappa ij.1, kappa ij.2) = (0,0) β ij = (5,5) := by decide +kernel
theorem pairKappa_eight : β ij : PairSlot,
(kappa ij.1, kappa ij.2) = (5,5) β ij = (0,0) := by decide +kernel
theorem halfLaw_weight_zero (t : Shape) (ht : t β shapes 8) (w : Fin 3)
(hw : t w = 0) (ij : PairSlot) :
halfLaw t w ij = if ij = (0,0) then 1 else 0 := by
apply normalized_singleton_law (halfLaw t w) (0,0) (halfLaw_normalized t ht w)
intro pair hpair
apply halfLaw_outside_support t ht w pair
rw [hw]
exact fun h => hpair ((pairWeight_zero pair).mp h)
theorem halfLaw_weight_eight (t : Shape) (ht : t β shapes 8) (w : Fin 3)
(hw : t w = 8) (ij : PairSlot) :
halfLaw t w ij = if ij = (5,5) then 1 else 0 := by
apply normalized_singleton_law (halfLaw t w) (5,5) (halfLaw_normalized t ht w)
intro pair hpair
apply halfLaw_outside_support t ht w pair
rw [hw]
exact fun h => hpair ((pairWeight_eight pair).mp h)
theorem complementary_half_sides_zero_parent : β t β shapes 8, β w v : Fin 3,
w β v β t w + t v = 8 β t β zeroSecond := by decide +kernel
theorem halfLaw_complementary_sides (t : Shape) (ht : t β shapes 8)
(w v : Fin 3) (hwv : w β v) (hsum : t w + t v = 8) (ij : PairSlot) :
halfLaw t w (kappa ij.1, kappa ij.2) = halfLaw t v ij := by
by_cases hw : t w = 0
Β· have hv : t v = 8 := by omega
rw [halfLaw_weight_zero t ht w hw, halfLaw_weight_eight t ht v hv]
simp only [pairKappa_zero]
Β· by_cases hv : t v = 0
Β· have hw8 : t w = 8 := by omega
rw [halfLaw_weight_eight t ht w hw8, halfLaw_weight_zero t ht v hv]
simp only [pairKappa_eight]
Β· exact halfLaw_zero_complement t
(complementary_half_sides_zero_parent t ht w v hwv hsum) w v hw hv hwv ij
theorem zero_maximum_axis_nonzero : β t β zeroSecond, t (halfMaxAxis t) β 0 := by
decide +kernel
theorem halfLaw_at_maximum (t : Shape) (ht : t β zeroSecond) (ij : PairSlot) :
halfLaw t (halfMaxAxis t) ij = zeroPairLaw t ij.1 ij.2 := by
have hp : positive t β true := by simpa using (List.mem_filter.mp ht).2
simp only [halfLaw, hp, Bool.false_eq_true, ite_false, ite_eq_right (zero_maximum_axis_nonzero t ht), ite_true]
theorem zeroPairLaw_shapeMax_eight (t : Shape) (ht : t β zeroSecond)
(hmax : shapeMax t = 8) (ij : PairSlot) :
zeroPairLaw t ij.1 ij.2 = if ij = (5,5) then 1 else 0 := by
have hshape : t β shapes 8 := (List.mem_filter.mp ht).1
rw [β halfLaw_at_maximum t ht ij]
exact halfLaw_weight_eight t hshape (halfMaxAxis t)
((halfMaxAxis_spec t hshape).trans hmax) ij
end MatrixMultiplication.AllFieldParameters
end OAI
|