Skip to content

Commit f30aae2

Browse files
committed
some progress on the correctness of expectation
1 parent d645fe0 commit f30aae2

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

MDPLib/Probability/Basic.lean

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,17 @@ theorem law_total_exp : 𝔼[𝔼[X |ᵣ L // P] // P] = 𝔼[X // P] :=
501501
_ = ∑ i : Fin k, 𝔼[X * (L =ᵢ i) // P] := by apply Fintype.sum_congr; intro i; apply exp_congr; rw[indi_eq_indr]
502502
_ = 𝔼[X // P] := by rw [←exp_decompose]
503503

504+
example : ∀x, x ∈ Finset.univ.image X ↔ x ∈ (List.ofFn X |> List.dedup) :=
505+
by intro x
506+
constructor
507+
· intro h
508+
refine List.mem_dedup.mpr ?_
509+
rw [Fin.univ_image_def] at h
510+
rw [List.mem_toFinset] at h
511+
exact h
512+
· intro h
513+
sorry
514+
504515
/-- Shows that our definition of expectation is correct -/
505516
theorem expect_def_correct : 𝔼[ X // P] = ∑ y ∈ (Finset.univ.image X), (ℙ[ X =ᵣ y // P] * y) := by
506517
-- TODO: Can we use FinEnum and Quotient to reduce it to LOTUS: where i is the index of the unique element, g

0 commit comments

Comments
 (0)