File size: 3,084 Bytes
92416a2 | 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
|