Download data/lean/OAI/Probability/MatroidSecretary/Pivots/TransactionLogResource.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 2.43 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/MatroidSecretary/Pivots/TransactionLogResource.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/MatroidSecretary/Pivots/TransactionLogResource.lean
-
curl -L -o TransactionLogResource.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/MatroidSecretary/Pivots/TransactionLogResource.lean
2.43 kB
| import OAI.Probability.MatroidProphet.Main | |
| namespace OAI | |
| /-! | |
| # The exact one-query resource identity | |
| This is the displayed `eq:log-resource` with its conditional product law written | |
| as the explicit two-outcome Bernoulli expectation. The finite-tree execution | |
| proof justifies applying this identity at every predictably selected fresh query. | |
| -/ | |
| namespace MatroidProphet | |
| open Finset | |
| /-- The source's expected one-query decrement, exponential expression, and | |
| logarithmic bound, for the actual finite-product failure probabilities. -/ | |
| theorem transaction_log_resource | |
| {Ξ± : Type*} [DecidableEq Ξ±] | |
| (cert : Finset Ξ± β Prop) [DecidablePred cert] (hcert : Monotone cert) | |
| (q : Ξ± β β) (hq0 : β e, 0 β€ q e) (hq1 : β e, q e β€ 1) | |
| (V I : Finset Ξ±) (e : Ξ±) (he : e β V) | |
| (hp : 0 < bitsFailure cert q V β ) : | |
| let p := bitsFailure cert q V β | |
| let p' := bitsFailure cert q (V.erase e) β | |
| let Z := bitsFailure cert q V I / p | |
| let next := (1 - q e) * (bitsFailure cert q (V.erase e) I / p') + | |
| q e * (bitsFailure cert q (V.erase e) (insert e I) / p') | |
| Z - next = Z * (1 - p / p') β§ | |
| Z - next = Z * (1 - Real.exp (-(Real.log p' - Real.log p))) β§ | |
| Z - next β€ Real.log p' - Real.log p := by | |
| dsimp only | |
| have hpp' : bitsFailure cert q V β β€ bitsFailure cert q (V.erase e) β := | |
| bitsFailure_antitone cert hcert q hq0 hq1 β (erase_subset e V) | |
| have hp' : 0 < bitsFailure cert q (V.erase e) β := hp.trans_le hpp' | |
| have hmean : | |
| (1 - q e) * (bitsFailure cert q (V.erase e) I / | |
| bitsFailure cert q (V.erase e) β ) + | |
| q e * (bitsFailure cert q (V.erase e) (insert e I) / | |
| bitsFailure cert q (V.erase e) β ) = | |
| bitsFailure cert q V I / bitsFailure cert q (V.erase e) β := by | |
| rw [bitsFailure_split cert q V I e he] | |
| ring | |
| rw [hmean] | |
| have hid : bitsFailure cert q V I / bitsFailure cert q V β - | |
| bitsFailure cert q V I / bitsFailure cert q (V.erase e) β = | |
| bitsFailure cert q V I / bitsFailure cert q V β * | |
| (1 - bitsFailure cert q V β / bitsFailure cert q (V.erase e) β ) := by | |
| field_simp | |
| refine β¨hid, ?_, ?_β© | |
| Β· rw [neg_sub, Real.exp_sub, Real.exp_log hp, Real.exp_log hp'] | |
| exact hid | |
| Β· exact ratio_resource hp hpp' (bitsFailure_nonneg cert q hq0 hq1 V I) | |
| (bitsFailure_forced_antitone cert hcert q hq0 hq1 V (empty_subset I)) | |
| end MatroidProphet | |
| end OAI | |