Cond bind le second
Prob.cond_bind_le_second
Plain-language statement
Bound an enriched cond by bounding the second half uniformly in the first half
Exact Lean statement
lemma cond_bind_le_second {f : Prob α} {g : α → Prob β} (p q : β → Prop) (i : α → Prop) {b : ℝ}
(b0 : 0 ≤ b) (gb : ∀ x, f.prob x ≠ 0 → i x → (g x).cond p q ≤ b) :
(f >>= λ x ↦ Prod.mk x <$> g x).cond (λ y ↦ p y.snd) (λ y ↦ q y.snd ∧ i y.fst) ≤ bFormal artifact
Lean source
lemma cond_bind_le_second {f : Prob α} {g : α → Prob β} (p q : β → Prop) (i : α → Prop) {b : ℝ} (b0 : 0 ≤ b) (gb : ∀ x, f.prob x ≠ 0 → i x → (g x).cond p q ≤ b) : (f >>= λ x ↦ Prod.mk x <$> g x).cond (λ y ↦ p y.snd) (λ y ↦ q y.snd ∧ i y.fst) ≤ b := by simp only [cond] by_cases d0 : (f >>= λ x ↦ Prod.mk x <$> g x).pr (λ y ↦ q y.2 ∧ i y.1) = 0 · simp only [d0, div_zero, b0] simp only [div_le_iff ((Ne.symm d0).lt_of_le pr_nonneg)] simp only [pr, ←exp_const_mul, exp_bind]; apply exp_mono; intro x m simp only [exp_map, Function.comp] by_cases ix : i x · simp only [ix, and_true]; specialize gb x m ix; simp only [cond] at gb by_cases gq : (g x).pr q = 0 · rw [exp_eq_zero] · apply exp_nonneg; intro y _; by_cases qy : q y repeat simp only [qy, if_true, if_false, mul_one, mul_zero, b0, le_refl] · intro y n; rw [pr_eq_zero] at gq; simp only [gq y n, and_false, if_false] · simp only [div_le_iff ((Ne.symm gq).lt_of_le pr_nonneg)] at gb; simp only [pr, ←exp_const_mul] at gb; convert gb · simp only [ix, and_false, ite_false, mul_zero, le_refl]- Project
- debate
- License
- Apache-2.0
- Commit
- de3a6e500ae1
- Source
- Prob/Cond.lean:303-321
Reuse this declaration
Bring the exact result into your workflow
The import identifies the source module. Your project still needs the pinned package dependency shown on this page.
What this badge means
This completion status comes from the project or community source. It has not yet been represented here as an independent rebuild and axiom audit.
Continue in this project
Related declarations
Alice pr le
alice_pr_le
Plain-language statement
Honest Alice has error ≥ e with probability ≤ q
Source project: debate
Person-level attribution pending.
Alice steps cost
alice_steps_cost
Plain-language statement
Alice makes few queries, regardless of Bob and Vera
Source project: debate
Person-level attribution pending.
Alices close
alices_close
Plain-language statement
Alice produces (p,y) with p close to o.probs y with good probability
Source project: debate
Person-level attribution pending.