File size: 5,297 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 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | import OAI.Combinatorics.HadwigerCounterexample.FiniteConditioning
import OAI.Combinatorics.HadwigerCounterexample.ConditionalProductLaws
namespace OAI
/-! # Cell Pruning -/
noncomputable section
namespace HadwigerCounterexample
open scoped BigOperators
open Finset
variable {A B I J : Type} [Fintype A] [Fintype B] [Fintype I] [Fintype J]
theorem sum_pr_tag (w : Wgt A) (P : A β Prop) (f : AβI) :
β i:I,pr w (fun x => P x β§ f x=i) = pr w P := by
classical
unfold pr
rw [β avg_sum]
refine avg_congr fun x _ => ?_
simp only [ind_and, β Finset.mul_sum]
rw [Finset.sum_eq_single (f x)]
Β· rw [ind_one rfl,mul_one]
Β· intro j _ hj; exact ind_zero hj.symm
simp
/-- implication needed only almost surely for finite measures. -/
theorem pr_on_mono {w : Wgt A} (hw : β x,0β€w x) {P Q : AβProp}
(h : β x,w xβ 0β P xβ Q x) : pr w P β€ pr w Q :=
Finset.sum_le_sum (fun x _ => by
by_cases he : w x=0
Β· simp [he]
exact mul_le_mul_of_nonneg_left (ind_mono (h x he)) (hw x))
theorem sum_pr_cells (w : Wgt (A Γ B)) (P : A Γ B β Prop) (f : AβI) (g : BβJ) :
β i:I,β j:J,pr w (fun x => P x β§ f x.1=i β§ g x.2=j) = pr w P := by
classical
rw [β sum_pr_tag w P (fun x => (f x.1,g x.2)), Fintype.sum_prod_type]
simp only [Prod.mk.injEq]
/-- restore the full pair-event probability in a specified cell. -/
theorem pair_restore (u : Wgt A) (v : Wgt B) (P : A β Prop) (Q : B β Prop)
(hP : 0 < pr u P) (hQ : 0 < pr v Q)
(c : A Γ B β Prop) :
pr (pairW u v) (fun x => P x.1 β§ Q x.2 β§ c x)=
pr u P * pr v Q * pr (pairW (onW u P) (onW v Q)) c := by
classical
let D := pr u P * pr v Q
let d := pairW (onW u P) (onW v Q)
change avg _ _ = D*avg d _
unfold avg
rw [Finset.mul_sum]
refine Finset.sum_congr rfl fun i _ => ?_
simp only [pairW,d,onW_val,D,ind_and]
field_simp
def memberC (p : AβProp) (f : AβI) (i : I) (x : A) := p x β§ f x=i
/-- heavy cells criterion. Loss charged to Ο times opposite mass
rather than Ο alone (key q fixed). -/
theorem prune_pairs (w : Wgt A) (v : Wgt B) (hw : SubLaw w) (hv : SubLaw v)
(P : A β Prop) (Q : BβProp) (f : AβI) (g : BβJ)
(C : AΓBβProp) (H T : β) (hH : 0β€H) (hT : 0<T)
{L : β} (hi : (Fintype.card I : β) β€ L)
(hj : (Fintype.card J : β) β€ L)
(h : β i j,T β€ pr w (memberC P f i) β T β€ pr v (memberC Q g j) β
Hβ€ pr (pairW (onW w (memberC P f i)) (onW v (memberC Q g j))) C) :
H * (pr w P * pr v Q) β€ pr (pairW w v) (fun x => P x.1 β§ Q x.2 β§ C x) +
(H*T*L)*(pr w P+pr v Q) := by
classical
let a (i:I) := pr w (memberC P f i)
let b (i:J) := pr v (memberC Q g i)
let d (i:I) (j:J) := pr (pairW w v) (fun x => memberC P f i x.1 β§ memberC Q g j x.2 β§ C x)
have ha i : 0β€a i := pr_nonneg hw.nz
have hb i : 0β€b i := pr_nonneg hv.nz
have he i j : H*(a i*b j) β€ d i j+ H*T*b j + H*T*a i := by
have hz : 0β€ d i j := pr_nonneg (subLaw_pair hw hv).nz
have ha' := mul_nonneg (mul_nonneg hH hT.le) (ha i)
have hb' := mul_nonneg (mul_nonneg hH hT.le) (hb j)
by_cases ht : T β€ a i
Β· by_cases hh : T β€ b j
Β· have hc := mul_le_mul_of_nonneg_right (h i j ht hh) (mul_nonneg (ha i) (hb j))
have h1 := pair_restore w v _ _ (lt_of_lt_of_le hT ht) (lt_of_lt_of_le hT hh) C
refine hc.trans ?_
rw [mul_comm (pr _ C)]
change _ β€ d i j + _ + _
unfold d
rw [h1]
change _ β€ a i*b j * _ + _+_
linarith
Β· have hg := mul_le_mul_of_nonneg_left (le_of_not_ge hh) (mul_nonneg hH (ha i))
calc H*(a i*b j) β€ H*T*a i := by linarith only [hg]
_ β€ _ := by linarith only [hb',hz]
have hg := mul_le_mul_of_nonneg_left (le_of_not_ge ht) (mul_nonneg hH (hb j))
calc H*(a i*b j) β€ H*T*b j := by linarith only [hg]
_ β€ _ := by linarith only [ha',hz]
have hA : pr w P=β i,a i := (sum_pr_tag w P f).symm
have hB : pr v Q=β j,b j := (sum_pr_tag v Q g).symm
have hC :
pr (pairW w v) (fun x => P x.1 β§ Q x.2 β§ C x) = β i,β j,d i j := by
rw [β sum_pr_cells (pairW w v) _ f g]
refine Finset.sum_congr rfl fun i _ => Finset.sum_congr rfl fun j _ => ?_
unfold d; congr 1; unfold memberC; ext; tauto
have h1 : H * (pr w P * pr v Q)=β i,β j,H*(a i*b j) := by
rw [hA,hB]
simp only [Finset.sum_mul,Finset.mul_sum]
exact Finset.sum_comm;
have h2 : β i:I,β j:J,H*T*b j=(Fintype.card I:β)*(H*T*pr v Q) := by
simp only [β Finset.mul_sum,βhB,Finset.sum_const, Finset.card_univ, nsmul_eq_mul]
ring
have h3 : β i:I,β j:J,H*T*a i=(Fintype.card J:β)*(H*T*pr w P) := by
rw [Finset.sum_comm]
simp only [β Finset.mul_sum,βhA,Finset.sum_const,Finset.card_univ,nsmul_eq_mul]
ring
rw [h1]
refine (Finset.sum_le_sum fun i _ => Finset.sum_le_sum fun j _ => he i j).trans ?_
simp only [Finset.sum_add_distrib]
rw [h2,h3,β hC]
have hh := mul_le_mul_of_nonneg_right hj (show 0β€H*T*pr w P from
mul_nonneg (mul_nonneg hH hT.le) (pr_nonneg hw.nz))
have hh' := mul_le_mul_of_nonneg_right hi (show 0β€H*T*pr v Q from
mul_nonneg (mul_nonneg hH hT.le) (pr_nonneg hv.nz))
linarith only [hh,hh']
end HadwigerCounterexample
end
end OAI
|