MindFormal v1.0.0One Mind

MindFormal.Chapters.Ch12.LeadConfidence.Intervals

theorem MindFormal.LeadConfidence.completed_intervals {Ω : Type u_1} [MeasurableSpace Ω] (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] (D C A B good : Set Ω) (hD : MeasurableSet D) (hg : MeasurableSet good) (Q : Ω → ℝ) (hQi : MeasureTheory.IntegrableOn Q D μ) (range : ∀ ω ∈ D, Q ω ∈ Set.Icc (1 / 2) 1) {q ε dQ : ℝ} (hq : q ∈ Set.Icc (1 / 2) 1) (he : ε < 1) (hdQ : 0 ≤ dQ) (mass : 1 - ε ≤ μ.real good) (complete : good ⊆ D) (sufficient : ∀ ω ∈ good, ω ∈ A → ω ∈ C) (necessary : ∀ ω ∈ good, ω ∈ C → ω ∈ B) (rating : ∀ ω ∈ good, |Q ω - q| ≤ dQ) :
1 - ε ≤ μ.real D ∧ 0 < μ.real D ∧ max 0 (μ.real A - ε) ≤ μ.real (D ∩ C) / μ.real D ∧ μ.real (D ∩ C) / μ.real D ≤ min 1 ((μ.real B + ε) / (1 - ε)) ∧ |(∫ (ω : Ω) in D, Q ω ∂μ) / μ.real D - q| ≤ (dQ + ε / 2) / (1 - ε) ∧ q - min 1 ((μ.real B + ε) / (1 - ε)) - (dQ + ε / 2) / (1 - ε) ≤ (∫ (ω : Ω) in D, Q ω ∂μ) / μ.real D - μ.real (D ∩ C) / μ.real D ∧ (∫ (ω : Ω) in D, Q ω ∂μ) / μ.real D - μ.real (D ∩ C) / μ.real D ≤ q - max 0 (μ.real A - ε) + (dQ + ε / 2) / (1 - ε)

OC1.16 with its actual completion/bin denominator. The two event inclusions are supplied by the native tube, and need no independence from the failed preparation, stream, report, or tail event.

theorem MindFormal.LeadConfidence.paired_gap_margin {qh qe ph pe Qh Qe Ah Ae Dh De : ℝ} (hc : |Qh - qh| ≤ Dh) (he : |Qe - qe| ≤ De) (hard : Ah ≤ ph) (easy : pe ≤ Ae) :
qh - qe + pe - ph - De - Dh ≤ Qh - Ah - (Qe - Ae)

OC1.17 retains both confidence errors and both accuracy endpoints. A scale difference is explicit when the compared scales are unmatched.

theorem MindFormal.LeadConfidence.binary_excess (confidence accuracy : ℝ) :
confidence - accuracy = 1 - accuracy - (1 - confidence)

Both binary readings are the identical signed excess.