File size: 2,429 Bytes
4a56cd6 | 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 | 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
|