Download data/lean/OAI/Probability/MatroidProphet/Residual/Transfer.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 2.84 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/MatroidProphet/Residual/Transfer.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/MatroidProphet/Residual/Transfer.lean
-
curl -L -o Transfer.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/MatroidProphet/Residual/Transfer.lean
2.84 kB
| import OAI.Probability.MatroidProphet.Residual.Tail | |
| import OAI.Probability.MatroidProphet.Residual.Comparison | |
| namespace OAI | |
| namespace MatroidProphet | |
| open Finset | |
| variable {Ξ± : Type*} [DecidableEq Ξ±] | |
| noncomputable def tripleMaskExpectation (p q r : Ξ± β β) (V : Finset Ξ±) | |
| (f : Finset Ξ± β Finset Ξ± β Finset Ξ± β β) : β := | |
| bitsExpectation p V (fun D => bitsExpectation q V (fun C => bitsExpectation r V (f D C))) | |
| lemma tripleMaskExpectation_mono (p q r : Ξ± β β) | |
| (hp0 : β e, 0 β€ p e) (hp1 : β e, p e β€ 1) | |
| (hq0 : β e, 0 β€ q e) (hq1 : β e, q e β€ 1) | |
| (hr0 : β e, 0 β€ r e) (hr1 : β e, r e β€ 1) | |
| (V : Finset Ξ±) {f g : Finset Ξ± β Finset Ξ± β Finset Ξ± β β} | |
| (h : β D β V, β C β V, β T β V, f D C T β€ g D C T) : | |
| tripleMaskExpectation p q r V f β€ tripleMaskExpectation p q r V g := by | |
| apply bitsExpectation_mono p hp0 hp1 | |
| intro D hD | |
| apply bitsExpectation_mono q hq0 hq1 | |
| intro C hC | |
| exact bitsExpectation_mono r hr0 hr1 V (fun T hT => h D hD C hC T hT) | |
| lemma tripleMaskExpectation_add (p q r : Ξ± β β) (V : Finset Ξ±) | |
| (f g : Finset Ξ± β Finset Ξ± β Finset Ξ± β β) : | |
| tripleMaskExpectation p q r V (fun D C T => f D C T + g D C T) = | |
| tripleMaskExpectation p q r V f + tripleMaskExpectation p q r V g := by | |
| simp only [tripleMaskExpectation, bitsExpectation_add] | |
| lemma tripleMaskExpectation_mul (p q r : Ξ± β β) (V : Finset Ξ±) (c : β) | |
| (f : Finset Ξ± β Finset Ξ± β Finset Ξ± β β) : | |
| tripleMaskExpectation p q r V (fun D C T => c * f D C T) = | |
| c * tripleMaskExpectation p q r V f := by | |
| simp only [tripleMaskExpectation, bitsExpectation_mul_const] | |
| lemma tripleMask_sample_to_rank (p q r : Ξ± β β) | |
| (hp0 : β e, 0 β€ p e) (hp1 : β e, p e β€ 1) | |
| (hq0 : β e, 0 β€ q e) (hq1 : β e, q e β€ 1) | |
| (hr0 : β e, 0 β€ r e) (hr1 : β e, r e β€ 1) | |
| (V : Finset Ξ±) (Ο z error : Finset Ξ± β Finset Ξ± β Finset Ξ± β β) | |
| (Y : β) | |
| (hdet : β D β V, β C β V, β T β V, Ο D C T β€ densityThreshold * z D C T + error D C T) | |
| (hsafe : retainedFraction * Y - (V.card : β) / densityThreshold β€ tripleMaskExpectation p q r V Ο) | |
| (herr : tripleMaskExpectation p q r V error β€ 2 * residualDelta * V.card) : | |
| (retainedFraction * Y - ((2 : β)^23)β»ΒΉ * V.card) / densityThreshold β€ | |
| tripleMaskExpectation p q r V z := by | |
| have hcompare := tripleMaskExpectation_mono p q r hp0 hp1 hq0 hq1 hr0 hr1 V hdet | |
| rw [tripleMaskExpectation_add, tripleMaskExpectation_mul] at hcompare | |
| have hc := mul_le_mul_of_nonneg_right residual_error_constant (Nat.cast_nonneg V.card) | |
| have hkpos : 0 < densityThreshold := constants_positive.2.1 | |
| apply (div_le_iffβ hkpos).2 | |
| rw [div_eq_mul_inv] at hsafe | |
| nlinarith | |
| end MatroidProphet | |
| end OAI | |