File size: 3,084 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 | import OAI.Dynamics.ConditionalShuffle.Exchangeable
namespace OAI
noncomputable section
open scoped Classical
namespace Thorp.Conditional
lemma physicalFlow_finSum {Ξ± : Type*} [Fintype Ξ±] (d : β) (B : Position (d+1) β Bool)
(a : Ξ± β β) (w : Ξ± β Position (d+1) β β) (c : Position d β Bool) (y) :
physicalFlow d B (fun x => β i, a i * w i x) c y =
β i, a i * physicalFlow d B (w i) c y := by
rw [physicalFlow_resampling, mean_sum]
simp only [mean_const_mul, physicalFlow_resampling]
lemma physicalFlow_nonneg (d : β) (B : Position (d+1) β Bool)
(w : Position (d+1) β β) (hw : β x, 0 β€ w x) (c : Position d β Bool) (y) :
0 β€ physicalFlow d B w c y := by
rw [physicalFlow_resampling]
exact mean_nonneg (fun r => hw _)
lemma rawIterate_nonneg (d : β) (v : RawState (d+1)) (hv : β x, 0 β€ v.weight x)
(t : β) (Ο : SweepHistory d t) (y) : 0 β€ (rawIterate d v t Ο).weight y := by
induction t generalizing y with
| zero => exact hv y
| succ t ih => exact physicalFlow_nonneg d _ _ (ih (Fin.init Ο)) _ y
lemma rawIterate_finSum {Ξ± : Type*} [Fintype Ξ±] (d : β) (B : Position (d+1) β Bool)
(a : Ξ± β β) (w : Ξ± β Position (d+1) β β) (t : β) (Ο : SweepHistory d t) (y) :
(rawIterate d β¨B,fun x => β i, a i * w i xβ© t Ο).weight y =
β i, a i * (rawIterate d β¨B,w iβ© t Ο).weight y := by
induction t generalizing y with
| zero => rfl
| succ t ih =>
change physicalFlow d (rawIterate d β¨B,_β© t (Fin.init Ο)).free
(rawIterate d β¨B,_β© t (Fin.init Ο)).weight (Ο (Fin.last t)) y = _
have hw : (rawIterate d β¨B,fun x => β i, a i * w i xβ© t (Fin.init Ο)).weight =
fun z => β i, a i * (rawIterate d β¨B,w iβ© t (Fin.init Ο)).weight z := by
funext z; exact ih (Fin.init Ο) z
rw [hw, physicalFlow_finSum]
apply Finset.sum_congr rfl; intro i _
congr 1
change physicalFlow d _ _ _ y = physicalFlow d _ _ _ y
congr 1
funext x
erw [rawIterate_free, rawIterate_free]
rfl
lemma rawPoint_nonneg (d t : β) (B : Position (d+1) β Bool) (a : Position (d+1))
(Ο : SweepHistory d t) (y) :
0 β€ (rawIterate d (rawPoint (d+1) B a) t Ο).weight y :=
rawIterate_nonneg d _ (fun x => by dsimp [rawPoint]; split <;> norm_num) t Ο y
lemma rawIterate_point_decomposition {Ξ± : Type*} [Fintype Ξ±] (d : β)
(B : Position (d+1) β Bool) (e : Ξ± β Position (d+1)) (a : Ξ± β β)
(t : β) (Ο : SweepHistory d t) (y) :
(rawIterate d β¨B,fun x => β i, if x = e i then a i else 0β© t Ο).weight y =
β i, a i * (rawIterate d (rawPoint (d+1) B (e i)) t Ο).weight y := by
have hw : (fun x => β i, if x = e i then a i else 0) =
(fun x => β i, a i * (rawPoint (d+1) B (e i)).weight x) := by
funext x
apply Finset.sum_congr rfl; intro i _
simp only [rawPoint]
split <;> simp
rw [hw]
exact rawIterate_finSum d B a (fun i => (rawPoint (d+1) B (e i)).weight) t Ο y
end Thorp.Conditional
end
end OAI
|