l3lab/ntp-mathlib huggingface dataset:
/-- Obtain a measure by giving a countably additive function that sends `∅` to `0`. -/
def ofMeasurable (m : ∀ s : Set α, MeasurableSet s → ℝ≥0∞) (m0 : m ∅ MeasurableSet.empty = 0)
    (mU :
      ∀ ⦃f : ℕ → Set α⦄ (h : ∀ i, MeasurableSet (f i)),
        Pairwise (Disjoint on f) → m (⋃ i, f i) (MeasurableSet.iUnion h) = ∑' i, m (f i) (h i)) :
    Measure α :=
  { inducedOuterMeasure m _ m0 with
    m_iUnion := fun f hf hd =>
      show inducedOuterMeasure m _ m0 (iUnion f) = ∑' i, inducedOuterMeasure m _ m0 (f i) by
        rw [inducedOuterMeasure_eq m0 mU, mU hf hd]
        congr; funext n; rw [inducedOuterMeasure_eq m0 mU]
    trimmed :=
      show (inducedOuterMeasure m _ m0).trim = inducedOuterMeasure m _ m0 by
        unfold OuterMeasure.trim
        congr; 

Proof state:
case e_m
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
m : (s : Set α) → MeasurableSet s → ℝ≥0∞
m0 : m ∅ (_ : MeasurableSet ∅) = 0
mU :
  ∀ ⦃f : ℕ → Set α⦄ (h : ∀ (i : ℕ), MeasurableSet (f i)),
    Pairwise (Disjoint on f) →
      m (⋃ i, f i) (_ : MeasurableSet (⋃ b, f b)) = ∑' (i : ℕ), m (f i) (_ : MeasurableSet (f i))
src✝ : OuterMeasure α := inducedOuterMeasure m (_ : MeasurableSet ∅) m0
⊢ (fun s x => ↑(inducedOuterMeasure m (_ : MeasurableSet ∅) m0) s) = m

Next tactic:
funext s hs
/-- Obtain a measure by giving a countably additive function that sends `∅` to `0`. -/
def ofMeasurable (m : ∀ s : Set α, MeasurableSet s → ℝ≥0∞) (m0 : m ∅ MeasurableSet.empty = 0)
    (mU :
      ∀ ⦃f : ℕ → Set α⦄ (h : ∀ i, MeasurableSet (f i)),
        Pairwise (Disjoint on f) → m (⋃ i, f i) (MeasurableSet.iUnion h) = ∑' i, m (f i) (h i)) :
    Measure α :=
  { inducedOuterMeasure m _ m0 with
    m_iUnion := fun f hf hd =>
      show inducedOuterMeasure m _ m0 (iUnion f) = ∑' i, inducedOuterMeasure m _ m0 (f i) by
        rw [inducedOuterMeasure_eq m0 mU, mU hf hd]
        congr; funext n; rw [inducedOuterMeasure_eq m0 mU]
    trimmed :=
      show (inducedOuterMeasure m _ m0).trim = inducedOuterMeasure m _ m0 by
        unfold OuterMeasure.trim
        congr; funext s hs
        

Proof state:
case e_m.h.h
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
m : (s : Set α) → MeasurableSet s → ℝ≥0∞
m0 : m ∅ (_ : MeasurableSet ∅) = 0
mU :
  ∀ ⦃f : ℕ → Set α⦄ (h : ∀ (i : ℕ), MeasurableSet (f i)),
    Pairwise (Disjoint on f) →
      m (⋃ i, f i) (_ : MeasurableSet (⋃ b, f b)) = ∑' (i : ℕ), m (f i) (_ : MeasurableSet (f i))
src✝ : OuterMeasure α := inducedOuterMeasure m (_ : MeasurableSet ∅) m0
s : Set α
hs : MeasurableSet s
⊢ ↑(inducedOuterMeasure m (_ : MeasurableSet ∅) m0) s = m s hs

Next tactic:
exact inducedOuterMeasure_eq m0 mU hs
theorem toOuterMeasure_injective : Injective (toOuterMeasure : Measure α → OuterMeasure α) :=
  fun ⟨m₁, u₁, h₁⟩ ⟨m₂, _u₂, _h₂⟩ _h => by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
x✝¹ x✝ : Measure α
m₁ : OuterMeasure α
u₁ :
  ∀ ⦃f : ℕ → Set α⦄,
    (∀ (i : ℕ), MeasurableSet (f i)) → Pairwise (Disjoint on f) → ↑m₁ (⋃ i, f i) = ∑' (i : ℕ), ↑m₁ (f i)
h₁ : OuterMeasure.trim m₁ = m₁
m₂ : OuterMeasure α
_u₂ :
  ∀ ⦃f : ℕ → Set α⦄,
    (∀ (i : ℕ), MeasurableSet (f i)) → Pairwise (Disjoint on f) → ↑m₂ (⋃ i, f i) = ∑' (i : ℕ), ↑m₂ (f i)
_h₂ : OuterMeasure.trim m₂ = m₂
_h :
  ↑{ toOuterMeasure := m₁, m_iUnion := u₁, trimmed := h₁ } = ↑{ toOuterMeasure := m₂, m_iUnion := _u₂, trimmed := _h₂ }
⊢ { toOuterMeasure := m₁, m_iUnion := u₁, trimmed := h₁ } = { toOuterMeasure := m₂, m_iUnion := _u₂, trimmed := _h₂ }

Next tactic:
congr
@[ext]
theorem ext (h : ∀ s, MeasurableSet s → μ₁ s = μ₂ s) : μ₁ = μ₂ :=
  toOuterMeasure_injective <| by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
h : ∀ (s : Set α), MeasurableSet s → ↑↑μ₁ s = ↑↑μ₂ s
⊢ ↑μ₁ = ↑μ₂

Next tactic:
rw [← trimmed, OuterMeasure.trim_congr (h _), trimmed]
theorem ext_iff : μ₁ = μ₂ ↔ ∀ s, MeasurableSet s → μ₁ s = μ₂ s :=
  ⟨by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
⊢ μ₁ = μ₂ → ∀ (s : Set α), MeasurableSet s → ↑↑μ₁ s = ↑↑μ₂ s

Next tactic:
rintro rfl s _hs
theorem ext_iff : μ₁ = μ₂ ↔ ∀ s, MeasurableSet s → μ₁ s = μ₂ s :=
  ⟨by rintro rfl s _hs; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ : Measure α
s✝ s₁ s₂ t s : Set α
_hs : MeasurableSet s
⊢ ↑↑μ₁ s = ↑↑μ₁ s

Next tactic:
rfl
theorem ext_iff' : μ₁ = μ₂ ↔ ∀ s, μ₁ s = μ₂ s :=
  ⟨by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
⊢ μ₁ = μ₂ → ∀ (s : Set α), ↑↑μ₁ s = ↑↑μ₂ s

Next tactic:
rintro rfl s
theorem ext_iff' : μ₁ = μ₂ ↔ ∀ s, μ₁ s = μ₂ s :=
  ⟨by rintro rfl s; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ : Measure α
s✝ s₁ s₂ t s : Set α
⊢ ↑↑μ₁ s = ↑↑μ₁ s

Next tactic:
rfl
theorem measure_eq_trim (s : Set α) : μ s = μ.toOuterMeasure.trim s := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t s : Set α
⊢ ↑↑μ s = ↑(OuterMeasure.trim ↑μ) s

Next tactic:
rw [μ.trimmed]
theorem measure_eq_iInf (s : Set α) : μ s = ⨅ (t) (_ : s ⊆ t) (_ : MeasurableSet t), μ t := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t s : Set α
⊢ ↑↑μ s = ⨅ t, ⨅ (_ : s ⊆ t), ⨅ (_ : MeasurableSet t), ↑↑μ t

Next tactic:
rw [measure_eq_trim, OuterMeasure.trim_eq_iInf]
/-- A variant of `measure_eq_iInf` which has a single `iInf`. This is useful when applying a
  lemma next that only works for non-empty infima, in which case you can use
  `nonempty_measurable_superset`. -/
theorem measure_eq_iInf' (μ : Measure α) (s : Set α) :
    μ s = ⨅ t : { t // s ⊆ t ∧ MeasurableSet t }, μ t := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ✝ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
μ : Measure α
s : Set α
⊢ ↑↑μ s = ⨅ t, ↑↑μ ↑t

Next tactic:
simp_rw [iInf_subtype, iInf_and, ← measure_eq_iInf]
theorem measure_eq_extend (hs : MeasurableSet s) :
    μ s = extend (fun t (_ht : MeasurableSet t) => μ t) s := by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
hs : MeasurableSet s
⊢ ↑↑μ s = extend (fun t _ht => ↑↑μ t) s

Next tactic:
rw [extend_eq]
theorem measure_eq_extend (hs : MeasurableSet s) :
    μ s = extend (fun t (_ht : MeasurableSet t) => μ t) s := by
    rw [extend_eq]
    

Proof state:
case h
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
hs : MeasurableSet s
⊢ MeasurableSet s

Next tactic:
exact hs
/-- For every set there exists a measurable superset of the same measure. -/
theorem exists_measurable_superset (μ : Measure α) (s : Set α) :
    ∃ t, s ⊆ t ∧ MeasurableSet t ∧ μ t = μ s := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ✝ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
μ : Measure α
s : Set α
⊢ ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑↑μ t = ↑↑μ s

Next tactic:
simpa only [← measure_eq_trim] using μ.toOuterMeasure.exists_measurable_superset_eq_trim s
/-- For every set `s` and a countable collection of measures `μ i` there exists a measurable
superset `t ⊇ s` such that each measure `μ i` takes the same value on `s` and `t`. -/
theorem exists_measurable_superset_forall_eq {ι} [Countable ι] (μ : ι → Measure α) (s : Set α) :
    ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ∀ i, μ i t = μ i s := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι✝ : Type u_5
inst✝¹ : MeasurableSpace α
μ✝ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
ι : Sort u_6
inst✝ : Countable ι
μ : ι → Measure α
s : Set α
⊢ ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ∀ (i : ι), ↑↑(μ i) t = ↑↑(μ i) s

Next tactic:
simpa only [← measure_eq_trim] using
    OuterMeasure.exists_measurable_superset_forall_eq_trim (fun i => (μ i).toOuterMeasure) s
theorem exists_measurable_superset₂ (μ ν : Measure α) (s : Set α) :
    ∃ t, s ⊆ t ∧ MeasurableSet t ∧ μ t = μ s ∧ ν t = ν s := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ✝ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
μ ν : Measure α
s : Set α
⊢ ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑↑μ t = ↑↑μ s ∧ ↑↑ν t = ↑↑ν s

Next tactic:
simpa only [Bool.forall_bool.trans and_comm] using
    exists_measurable_superset_forall_eq (fun b => cond b μ ν) s
theorem measure_biUnion_le {s : Set β} (hs : s.Countable) (f : β → Set α) :
    μ (⋃ b ∈ s, f b) ≤ ∑' p : s, μ (f p) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
s : Set β
hs : Set.Countable s
f : β → Set α
⊢ ↑↑μ (⋃ b ∈ s, f b) ≤ ∑' (p : ↑s), ↑↑μ (f ↑p)

Next tactic:
haveI := hs.to_subtype
theorem measure_biUnion_le {s : Set β} (hs : s.Countable) (f : β → Set α) :
    μ (⋃ b ∈ s, f b) ≤ ∑' p : s, μ (f p) := by
  haveI := hs.to_subtype
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
s : Set β
hs : Set.Countable s
f : β → Set α
this : Countable ↑s
⊢ ↑↑μ (⋃ b ∈ s, f b) ≤ ∑' (p : ↑s), ↑↑μ (f ↑p)

Next tactic:
rw [biUnion_eq_iUnion]
theorem measure_biUnion_le {s : Set β} (hs : s.Countable) (f : β → Set α) :
    μ (⋃ b ∈ s, f b) ≤ ∑' p : s, μ (f p) := by
  haveI := hs.to_subtype
  rw [biUnion_eq_iUnion]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
s : Set β
hs : Set.Countable s
f : β → Set α
this : Countable ↑s
⊢ ↑↑μ (⋃ x, f ↑x) ≤ ∑' (p : ↑s), ↑↑μ (f ↑p)

Next tactic:
apply measure_iUnion_le
theorem measure_biUnion_finset_le (s : Finset β) (f : β → Set α) :
    μ (⋃ b ∈ s, f b) ≤ ∑ p in s, μ (f p) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
s : Finset β
f : β → Set α
⊢ ↑↑μ (⋃ b ∈ s, f b) ≤ ∑ p in s, ↑↑μ (f p)

Next tactic:
rw [← Finset.sum_attach, Finset.attach_eq_univ, ← tsum_fintype]
theorem measure_biUnion_finset_le (s : Finset β) (f : β → Set α) :
    μ (⋃ b ∈ s, f b) ≤ ∑ p in s, μ (f p) := by
  rw [← Finset.sum_attach, Finset.attach_eq_univ, ← tsum_fintype]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
s : Finset β
f : β → Set α
⊢ ↑↑μ (⋃ b ∈ s, f b) ≤ ∑' (b : { x // x ∈ s }), ↑↑μ (f ↑b)

Next tactic:
exact measure_biUnion_le s.countable_toSet f
theorem measure_iUnion_fintype_le [Fintype β] (f : β → Set α) : μ (⋃ b, f b) ≤ ∑ p, μ (f p) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝¹ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
inst✝ : Fintype β
f : β → Set α
⊢ ↑↑μ (⋃ b, f b) ≤ ∑ p : β, ↑↑μ (f p)

Next tactic:
convert measure_biUnion_finset_le Finset.univ f
theorem measure_iUnion_fintype_le [Fintype β] (f : β → Set α) : μ (⋃ b, f b) ≤ ∑ p, μ (f p) := by
  convert measure_biUnion_finset_le Finset.univ f
  

Proof state:
case h.e'_3.h.e'_3.h.e'_3.h
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝¹ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
inst✝ : Fintype β
f : β → Set α
x✝ : β
⊢ f x✝ = ⋃ (_ : x✝ ∈ Finset.univ), f x✝

Next tactic:
simp
theorem measure_biUnion_lt_top {s : Set β} {f : β → Set α} (hs : s.Finite)
    (hfin : ∀ i ∈ s, μ (f i) ≠ ∞) : μ (⋃ i ∈ s, f i) < ∞ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
s : Set β
f : β → Set α
hs : Set.Finite s
hfin : ∀ i ∈ s, ↑↑μ (f i) ≠ ⊤
⊢ ↑↑μ (⋃ i ∈ s, f i) < ⊤

Next tactic:
convert (measure_biUnion_finset_le hs.toFinset f).trans_lt _ using 3
theorem measure_biUnion_lt_top {s : Set β} {f : β → Set α} (hs : s.Finite)
    (hfin : ∀ i ∈ s, μ (f i) ≠ ∞) : μ (⋃ i ∈ s, f i) < ∞ := by
  convert (measure_biUnion_finset_le hs.toFinset f).trans_lt _ using 3
  · 

Proof state:
case h.e'_3.h.e'_3.h.e'_3
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
s : Set β
f : β → Set α
hs : Set.Finite s
hfin : ∀ i ∈ s, ↑↑μ (f i) ≠ ⊤
⊢ (fun i => ⋃ (_ : i ∈ s), f i) = fun b => ⋃ (_ : b ∈ Finite.toFinset hs), f b

Next tactic:
ext
theorem measure_biUnion_lt_top {s : Set β} {f : β → Set α} (hs : s.Finite)
    (hfin : ∀ i ∈ s, μ (f i) ≠ ∞) : μ (⋃ i ∈ s, f i) < ∞ := by
  convert (measure_biUnion_finset_le hs.toFinset f).trans_lt _ using 3
  · ext
    

Proof state:
case h.e'_3.h.e'_3.h.e'_3.h.h
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
s : Set β
f : β → Set α
hs : Set.Finite s
hfin : ∀ i ∈ s, ↑↑μ (f i) ≠ ⊤
x✝¹ : β
x✝ : α
⊢ x✝ ∈ ⋃ (_ : x✝¹ ∈ s), f x✝¹ ↔ x✝ ∈ ⋃ (_ : x✝¹ ∈ Finite.toFinset hs), f x✝¹

Next tactic:
rw [Finite.mem_toFinset]
theorem measure_biUnion_lt_top {s : Set β} {f : β → Set α} (hs : s.Finite)
    (hfin : ∀ i ∈ s, μ (f i) ≠ ∞) : μ (⋃ i ∈ s, f i) < ∞ := by
  convert (measure_biUnion_finset_le hs.toFinset f).trans_lt _ using 3
  · ext
    rw [Finite.mem_toFinset]
  

Proof state:
case convert_3
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
s : Set β
f : β → Set α
hs : Set.Finite s
hfin : ∀ i ∈ s, ↑↑μ (f i) ≠ ⊤
⊢ ∑ p in Finite.toFinset hs, ↑↑μ (f p) < ⊤

Next tactic:
apply ENNReal.sum_lt_top
theorem measure_biUnion_lt_top {s : Set β} {f : β → Set α} (hs : s.Finite)
    (hfin : ∀ i ∈ s, μ (f i) ≠ ∞) : μ (⋃ i ∈ s, f i) < ∞ := by
  convert (measure_biUnion_finset_le hs.toFinset f).trans_lt _ using 3
  · ext
    rw [Finite.mem_toFinset]
  apply ENNReal.sum_lt_top; 

Proof state:
case convert_3.h
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
s : Set β
f : β → Set α
hs : Set.Finite s
hfin : ∀ i ∈ s, ↑↑μ (f i) ≠ ⊤
⊢ ∀ a ∈ Finite.toFinset hs, ↑↑μ (f a) ≠ ⊤

Next tactic:
simpa only [Finite.mem_toFinset]
lemma measure_null_iff_singleton {s : Set α} (hs : s.Countable) : μ s = 0 ↔ ∀ x ∈ s, μ {x} = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t s : Set α
hs : Set.Countable s
⊢ ↑↑μ s = 0 ↔ ∀ x ∈ s, ↑↑μ {x} = 0

Next tactic:
rw [← measure_biUnion_null_iff hs, biUnion_of_singleton]
@[simp]
theorem measure_union_lt_top_iff : μ (s ∪ t) < ∞ ↔ μ s < ∞ ∧ μ t < ∞ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
⊢ ↑↑μ (s ∪ t) < ⊤ ↔ ↑↑μ s < ⊤ ∧ ↑↑μ t < ⊤

Next tactic:
refine' ⟨fun h => ⟨_, _⟩, fun h => measure_union_lt_top h.1 h.2⟩
@[simp]
theorem measure_union_lt_top_iff : μ (s ∪ t) < ∞ ↔ μ s < ∞ ∧ μ t < ∞ := by
  refine' ⟨fun h => ⟨_, _⟩, fun h => measure_union_lt_top h.1 h.2⟩
  · 

Proof state:
case refine'_1
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
h : ↑↑μ (s ∪ t) < ⊤
⊢ ↑↑μ s < ⊤

Next tactic:
exact (measure_mono (Set.subset_union_left s t)).trans_lt h
@[simp]
theorem measure_union_lt_top_iff : μ (s ∪ t) < ∞ ↔ μ s < ∞ ∧ μ t < ∞ := by
  refine' ⟨fun h => ⟨_, _⟩, fun h => measure_union_lt_top h.1 h.2⟩
  · exact (measure_mono (Set.subset_union_left s t)).trans_lt h
  · 

Proof state:
case refine'_2
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
h : ↑↑μ (s ∪ t) < ⊤
⊢ ↑↑μ t < ⊤

Next tactic:
exact (measure_mono (Set.subset_union_right s t)).trans_lt h
@[simp]
theorem measure_union_eq_top_iff : μ (s ∪ t) = ∞ ↔ μ s = ∞ ∨ μ t = ∞ :=
  not_iff_not.1 <| by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
⊢ ¬↑↑μ (s ∪ t) = ⊤ ↔ ¬(↑↑μ s = ⊤ ∨ ↑↑μ t = ⊤)

Next tactic:
simp only [← lt_top_iff_ne_top, ← Ne.def, not_or, measure_union_lt_top_iff]
theorem exists_measure_pos_of_not_measure_iUnion_null [Countable β] {s : β → Set α}
    (hs : μ (⋃ n, s n) ≠ 0) : ∃ n, 0 < μ (s n) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝¹ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
inst✝ : Countable β
s : β → Set α
hs : ↑↑μ (⋃ n, s n) ≠ 0
⊢ ∃ n, 0 < ↑↑μ (s n)

Next tactic:
contrapose! hs
theorem exists_measure_pos_of_not_measure_iUnion_null [Countable β] {s : β → Set α}
    (hs : μ (⋃ n, s n) ≠ 0) : ∃ n, 0 < μ (s n) := by
  contrapose! hs
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝¹ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
inst✝ : Countable β
s : β → Set α
hs : ∀ (n : β), ↑↑μ (s n) ≤ 0
⊢ ↑↑μ (⋃ n, s n) = 0

Next tactic:
exact measure_iUnion_null fun n => nonpos_iff_eq_zero.1 (hs n)
/-- The “almost everywhere” filter of co-null sets. -/
def Measure.ae {α} {m : MeasurableSpace α} (μ : Measure α) : Filter α where
  sets := { s | μ sᶜ = 0 }
  univ_sets := by 

Proof state:
α✝ : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α✝
μ✝ μ₁ μ₂ : Measure α✝
s s₁ s₂ t : Set α✝
α : Type ?u.36513
m : MeasurableSpace α
μ : Measure α
⊢ univ ∈ {s | ↑↑μ sᶜ = 0}

Next tactic:
simp
/-- The “almost everywhere” filter of co-null sets. -/
def Measure.ae {α} {m : MeasurableSpace α} (μ : Measure α) : Filter α where
  sets := { s | μ sᶜ = 0 }
  univ_sets := by simp
  inter_sets hs ht := by 

Proof state:
α✝ : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α✝
μ✝ μ₁ μ₂ : Measure α✝
s s₁ s₂ t : Set α✝
α : Type ?u.36513
m : MeasurableSpace α
μ : Measure α
x✝ y✝ : Set α
hs : x✝ ∈ {s | ↑↑μ sᶜ = 0}
ht : y✝ ∈ {s | ↑↑μ sᶜ = 0}
⊢ x✝ ∩ y✝ ∈ {s | ↑↑μ sᶜ = 0}

Next tactic:
simp only [compl_inter, mem_setOf_eq]
/-- The “almost everywhere” filter of co-null sets. -/
def Measure.ae {α} {m : MeasurableSpace α} (μ : Measure α) : Filter α where
  sets := { s | μ sᶜ = 0 }
  univ_sets := by simp
  inter_sets hs ht := by simp only [compl_inter, mem_setOf_eq]; 

Proof state:
α✝ : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α✝
μ✝ μ₁ μ₂ : Measure α✝
s s₁ s₂ t : Set α✝
α : Type ?u.36513
m : MeasurableSpace α
μ : Measure α
x✝ y✝ : Set α
hs : x✝ ∈ {s | ↑↑μ sᶜ = 0}
ht : y✝ ∈ {s | ↑↑μ sᶜ = 0}
⊢ ↑↑μ (x✝ᶜ ∪ y✝ᶜ) = 0

Next tactic:
exact measure_union_null hs ht
theorem compl_mem_ae_iff {s : Set α} : sᶜ ∈ μ.ae ↔ μ s = 0 := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t s : Set α
⊢ sᶜ ∈ Measure.ae μ ↔ ↑↑μ s = 0

Next tactic:
simp only [mem_ae_iff, compl_compl]
instance instCountableInterFilter : CountableInterFilter μ.ae :=
  ⟨by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
⊢ ∀ (S : Set (Set α)), Set.Countable S → (∀ s ∈ S, s ∈ Measure.ae μ) → ⋂₀ S ∈ Measure.ae μ

Next tactic:
intro S hSc hS
instance instCountableInterFilter : CountableInterFilter μ.ae :=
  ⟨by
    intro S hSc hS
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
S : Set (Set α)
hSc : Set.Countable S
hS : ∀ s ∈ S, s ∈ Measure.ae μ
⊢ ⋂₀ S ∈ Measure.ae μ

Next tactic:
rw [mem_ae_iff, compl_sInter, sUnion_image]
instance instCountableInterFilter : CountableInterFilter μ.ae :=
  ⟨by
    intro S hSc hS
    rw [mem_ae_iff, compl_sInter, sUnion_image]
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
S : Set (Set α)
hSc : Set.Countable S
hS : ∀ s ∈ S, s ∈ Measure.ae μ
⊢ ↑↑μ (⋃ x ∈ S, xᶜ) = 0

Next tactic:
exact (measure_biUnion_null_iff hSc).2 hS
theorem all_ae_of {ι : Sort _} {p : α → ι → Prop} (hp : ∀ᵐ a ∂μ, ∀ i, p a i) (i : ι) :
    ∀ᵐ a ∂μ, p a i := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι✝ : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
ι : Sort u_6
p : α → ι → Prop
hp : ∀ᵐ (a : α) ∂μ, ∀ (i : ι), p a i
i : ι
⊢ ∀ᵐ (a : α) ∂μ, p a i

Next tactic:
filter_upwards [hp] with a ha using ha i
lemma ae_iff_of_countable [Countable α] {p : α → Prop} : (∀ᵐ x ∂μ, p x) ↔ ∀ x, μ {x} ≠ 0 → p x := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝¹ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
inst✝ : Countable α
p : α → Prop
⊢ (∀ᵐ (x : α) ∂μ, p x) ↔ ∀ (x : α), ↑↑μ {x} ≠ 0 → p x

Next tactic:
rw [ae_iff, measure_null_iff_singleton]
lemma ae_iff_of_countable [Countable α] {p : α → Prop} : (∀ᵐ x ∂μ, p x) ↔ ∀ x, μ {x} ≠ 0 → p x := by
  rw [ae_iff, measure_null_iff_singleton]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝¹ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
inst✝ : Countable α
p : α → Prop
⊢ (∀ x ∈ {a | ¬p a}, ↑↑μ {x} = 0) ↔ ∀ (x : α), ↑↑μ {x} ≠ 0 → p x
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝¹ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
inst✝ : Countable α
p : α → Prop
⊢ Set.Countable {a | ¬p a}

Next tactic:
exacts [forall_congr' fun _ ↦ not_imp_comm, Set.to_countable _]
@[simp]
theorem ae_eq_empty : s =ᵐ[μ] (∅ : Set α) ↔ μ s = 0 :=
  eventuallyEq_empty.trans <| by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
⊢ (∀ᵐ (x : α) ∂μ, x ∉ s) ↔ ↑↑μ s = 0

Next tactic:
simp only [ae_iff, Classical.not_not, setOf_mem_eq]
theorem ae_le_set : s ≤ᵐ[μ] t ↔ μ (s \ t) = 0 :=
  calc
    s ≤ᵐ[μ] t ↔ ∀ᵐ x ∂μ, x ∈ s → x ∈ t := Iff.rfl
    _ ↔ μ (s \ t) = 0 := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
⊢ (∀ᵐ (x : α) ∂μ, x ∈ s → x ∈ t) ↔ ↑↑μ (s \ t) = 0

Next tactic:
simp [ae_iff]
theorem ae_le_set : s ≤ᵐ[μ] t ↔ μ (s \ t) = 0 :=
  calc
    s ≤ᵐ[μ] t ↔ ∀ᵐ x ∂μ, x ∈ s → x ∈ t := Iff.rfl
    _ ↔ μ (s \ t) = 0 := by simp [ae_iff]; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
⊢ ↑↑μ {a | a ∈ s ∧ a ∉ t} = 0 ↔ ↑↑μ (s \ t) = 0

Next tactic:
rfl
theorem union_ae_eq_right : (s ∪ t : Set α) =ᵐ[μ] t ↔ μ (s \ t) = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
⊢ s ∪ t =ᵐ[μ] t ↔ ↑↑μ (s \ t) = 0

Next tactic:
simp [eventuallyLE_antisymm_iff, ae_le_set, union_diff_right,
    diff_eq_empty.2 (Set.subset_union_right _ _)]
theorem diff_ae_eq_self : (s \ t : Set α) =ᵐ[μ] s ↔ μ (s ∩ t) = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
⊢ s \ t =ᵐ[μ] s ↔ ↑↑μ (s ∩ t) = 0

Next tactic:
simp [eventuallyLE_antisymm_iff, ae_le_set, diff_diff_right, diff_diff,
    diff_eq_empty.2 (Set.subset_union_right _ _)]
theorem ae_eq_set {s t : Set α} : s =ᵐ[μ] t ↔ μ (s \ t) = 0 ∧ μ (t \ s) = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ s t : Set α
⊢ s =ᵐ[μ] t ↔ ↑↑μ (s \ t) = 0 ∧ ↑↑μ (t \ s) = 0

Next tactic:
simp [eventuallyLE_antisymm_iff, ae_le_set]