File: Mathlib/Probability/CondCount.lean

full_name: ProbabilityTheory.condCount
code: /-- Given a set `s`, `condCount s` is the counting measure conditioned on `s`. In particular,
`condCount s t` is the proportion of `s` that is contained in `t`.

This is a probability measure when `s` is finite and nonempty and is given by
`ProbabilityTheory.condCount_isProbabilityMeasure`. -/
def condCount (s : Set Ω) : Measure Ω 
goal: MeasureTheory.Measure Ω

full_name: ProbabilityTheory.condCount_empty_meas
code: @[simp]
theorem condCount_empty_meas : (condCount ∅ : Measure Ω) = 0 
goal: ProbabilityTheory.condCount ∅ = 0

full_name: ProbabilityTheory.condCount_empty
code: theorem condCount_empty {s : Set Ω} : condCount s ∅ = 0 
goal: (ProbabilityTheory.condCount s) ∅ = 0

full_name: ProbabilityTheory.finite_of_condCount_ne_zero
code: theorem finite_of_condCount_ne_zero {s t : Set Ω} (h : condCount s t ≠ 0) : s.Finite 
goal: s.Finite

full_name: ProbabilityTheory.condCount_univ
code: theorem condCount_univ [Fintype Ω] {s : Set Ω} :
    condCount Set.univ s = Measure.count s / Fintype.card Ω 
goal: (ProbabilityTheory.condCount Set.univ) s = MeasureTheory.Measure.count s / ↑(Fintype.card Ω)

full_name: ProbabilityTheory.condCount_isProbabilityMeasure
code: theorem condCount_isProbabilityMeasure {s : Set Ω} (hs : s.Finite) (hs' : s.Nonempty) :
    IsProbabilityMeasure (condCount s) 
goal: MeasureTheory.IsProbabilityMeasure (ProbabilityTheory.condCount s)

full_name: ProbabilityTheory.condCount_singleton
code: theorem condCount_singleton (ω : Ω) (t : Set Ω) [Decidable (ω ∈ t)] :
    condCount {ω} t = if ω ∈ t then 1 else 0 
goal: (ProbabilityTheory.condCount {ω}) t = if ω ∈ t then 1 else 0

full_name: ProbabilityTheory.condCount_inter_self
code: theorem condCount_inter_self (hs : s.Finite) : condCount s (s ∩ t) = condCount s t 
goal: (ProbabilityTheory.condCount s) (s ∩ t) = (ProbabilityTheory.condCount s) t

full_name: ProbabilityTheory.condCount_self
code: theorem condCount_self (hs : s.Finite) (hs' : s.Nonempty) : condCount s s = 1 
goal: (ProbabilityTheory.condCount s) s = 1

full_name: ProbabilityTheory.condCount_eq_one_of
code: theorem condCount_eq_one_of (hs : s.Finite) (hs' : s.Nonempty) (ht : s ⊆ t) :
    condCount s t = 1 
goal: (ProbabilityTheory.condCount s) t = 1

full_name: ProbabilityTheory.pred_true_of_condCount_eq_one
code: theorem pred_true_of_condCount_eq_one (h : condCount s t = 1) : s ⊆ t 
goal: s ⊆ t

full_name: ProbabilityTheory.condCount_eq_zero_iff
code: theorem condCount_eq_zero_iff (hs : s.Finite) : condCount s t = 0 ↔ s ∩ t = ∅ 
goal: (ProbabilityTheory.condCount s) t = 0 ↔ s ∩ t = ∅

full_name: ProbabilityTheory.condCount_of_univ
code: theorem condCount_of_univ (hs : s.Finite) (hs' : s.Nonempty) : condCount s Set.univ = 1 
goal: (ProbabilityTheory.condCount s) Set.univ = 1

full_name: ProbabilityTheory.condCount_inter
code: theorem condCount_inter (hs : s.Finite) :
    condCount s (t ∩ u) = condCount (s ∩ t) u * condCount s t 
goal: (ProbabilityTheory.condCount s) (t ∩ u) = (ProbabilityTheory.condCount (s ∩ t)) u * (ProbabilityTheory.condCount s) t

full_name: ProbabilityTheory.condCount_inter'
code: theorem condCount_inter' (hs : s.Finite) :
    condCount s (t ∩ u) = condCount (s ∩ u) t * condCount s u 
goal: (ProbabilityTheory.condCount s) (t ∩ u) = (ProbabilityTheory.condCount (s ∩ u)) t * (ProbabilityTheory.condCount s) u

full_name: ProbabilityTheory.condCount_union
code: theorem condCount_union (hs : s.Finite) (htu : Disjoint t u) :
    condCount s (t ∪ u) = condCount s t + condCount s u 
goal: (ProbabilityTheory.condCount s) (t ∪ u) = (ProbabilityTheory.condCount s) t + (ProbabilityTheory.condCount s) u

full_name: ProbabilityTheory.condCount_compl
code: theorem condCount_compl (t : Set Ω) (hs : s.Finite) (hs' : s.Nonempty) :
    condCount s t + condCount s tᶜ = 1 
goal: (ProbabilityTheory.condCount s) t + (ProbabilityTheory.condCount s) tᶜ = 1

full_name: ProbabilityTheory.condCount_disjoint_union
code: theorem condCount_disjoint_union (hs : s.Finite) (ht : t.Finite) (hst : Disjoint s t) :
    condCount s u * condCount (s ∪ t) s + condCount t u * condCount (s ∪ t) t =
      condCount (s ∪ t) u 
goal: (ProbabilityTheory.condCount s) u * (ProbabilityTheory.condCount (s ∪ t)) s +
    (ProbabilityTheory.condCount t) u * (ProbabilityTheory.condCount (s ∪ t)) t =
  (ProbabilityTheory.condCount (s ∪ t)) u

full_name: ProbabilityTheory.condCount_add_compl_eq
code: /-- A version of the law of total probability for counting probabilities. -/
theorem condCount_add_compl_eq (u t : Set Ω) (hs : s.Finite) :
    condCount (s ∩ u) t * condCount s u + condCount (s ∩ uᶜ) t * condCount s uᶜ =
      condCount s t 
goal: (ProbabilityTheory.condCount (s ∩ u)) t * (ProbabilityTheory.condCount s) u +
    (ProbabilityTheory.condCount (s ∩ uᶜ)) t * (ProbabilityTheory.condCount s) uᶜ =
  (ProbabilityTheory.condCount s) t