Download lean/OAI/Probability/MatroidProphet/Residual/MaskUnion.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.52 kB
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Probability/MatroidProphet/Residual/MaskUnion.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/Probability/MatroidProphet/Residual/MaskUnion.lean
-
curl -L -o MaskUnion.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Probability/MatroidProphet/Residual/MaskUnion.lean
1.52 kB
| import OAI.Probability.MatroidProphet.Residual.Probability | |
| namespace OAI | |
| namespace MatroidProphet | |
| open Finset | |
| variable {α : Type*} [DecidableEq α] | |
| lemma bitsExpectation_union (p q : α → ℝ) (V : Finset α) (f : Finset α → ℝ) : | |
| bitsExpectation p V (fun D => bitsExpectation q V (fun C => f (D ∪ C))) = | |
| bitsExpectation (fun e => p e + (1 - p e) * q e) V f := by | |
| induction V using Finset.induction_on generalizing f with | |
| | empty => simp | |
| | e V he ih => | |
| rw [bitsExpectation_insert p V e he, | |
| bitsExpectation_insert (fun e => p e + (1 - p e) * q e) V e he] | |
| have hno : bitsExpectation p V (fun D => bitsExpectation q (insert e V) (fun C => f (D ∪ C))) = | |
| (1 - q e) * bitsExpectation p V (fun D => bitsExpectation q V (fun C => f (D ∪ C))) + | |
| q e * bitsExpectation p V (fun D => bitsExpectation q V (fun C => f (insert e (D ∪ C)))) := by | |
| simp_rw [bitsExpectation_insert q V e he, union_insert] | |
| rw [bitsExpectation_add, bitsExpectation_mul_const, bitsExpectation_mul_const] | |
| have hyes : bitsExpectation p V (fun D => bitsExpectation q (insert e V) (fun C => f (insert e D ∪ C))) = | |
| bitsExpectation p V (fun D => bitsExpectation q V (fun C => f (insert e (D ∪ C)))) := by | |
| apply bitsExpectation_congr | |
| intro D hD | |
| rw [bitsExpectation_insert q V e he] | |
| simp only [insert_union, union_insert, insert_idem] | |
| ring | |
| rw [hno, hyes, ih f, ih (fun S => f (insert e S))] | |
| ring | |
| end MatroidProphet | |
| end OAI | |