l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem measure_symmDiff_eq_zero_iff {s t : Set α} : μ (s ∆ t) = 0 ↔ 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✝ s t : Set α
⊢ ↑↑μ (s ∆ t) = 0 ↔ s =ᵐ[μ] t

Next tactic:
simp [ae_eq_set, symmDiff_def]
@[simp]
theorem ae_eq_set_compl_compl {s t : Set α} : 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✝ s t : Set α
⊢ sᶜ =ᵐ[μ] tᶜ ↔ s =ᵐ[μ] t

Next tactic:
simp only [← measure_symmDiff_eq_zero_iff, compl_symmDiff_compl]
theorem ae_eq_set_compl {s t : Set α} : 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✝ s t : Set α
⊢ sᶜ =ᵐ[μ] t ↔ s =ᵐ[μ] tᶜ

Next tactic:
rw [← ae_eq_set_compl_compl, compl_compl]
theorem union_ae_eq_univ_of_ae_eq_univ_left (h : s =ᵐ[μ] univ) : (s ∪ t : Set α) =ᵐ[μ] univ := 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 =ᵐ[μ] univ
⊢ s ∪ t =ᵐ[μ] univ

Next tactic:
convert ae_eq_set_union h (ae_eq_refl t)
theorem union_ae_eq_univ_of_ae_eq_univ_left (h : s =ᵐ[μ] univ) : (s ∪ t : Set α) =ᵐ[μ] univ := by
  convert ae_eq_set_union h (ae_eq_refl t)
  

Proof state:
case h.e'_5
α : 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 =ᵐ[μ] univ
⊢ univ = univ ∪ t

Next tactic:
rw [univ_union]
theorem union_ae_eq_univ_of_ae_eq_univ_right (h : t =ᵐ[μ] univ) : (s ∪ t : Set α) =ᵐ[μ] univ := 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 : t =ᵐ[μ] univ
⊢ s ∪ t =ᵐ[μ] univ

Next tactic:
convert ae_eq_set_union (ae_eq_refl s) h
theorem union_ae_eq_univ_of_ae_eq_univ_right (h : t =ᵐ[μ] univ) : (s ∪ t : Set α) =ᵐ[μ] univ := by
  convert ae_eq_set_union (ae_eq_refl s) h
  

Proof state:
case h.e'_5
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
h : t =ᵐ[μ] univ
⊢ univ = s ∪ univ

Next tactic:
rw [union_univ]
theorem union_ae_eq_right_of_ae_eq_empty (h : s =ᵐ[μ] (∅ : Set α)) : (s ∪ t : Set α) =ᵐ[μ] 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 α
h : s =ᵐ[μ] ∅
⊢ s ∪ t =ᵐ[μ] t

Next tactic:
convert ae_eq_set_union h (ae_eq_refl t)
theorem union_ae_eq_right_of_ae_eq_empty (h : s =ᵐ[μ] (∅ : Set α)) : (s ∪ t : Set α) =ᵐ[μ] t := by
  convert ae_eq_set_union h (ae_eq_refl t)
  

Proof state:
case h.e'_5
α : 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:
rw [empty_union]
theorem union_ae_eq_left_of_ae_eq_empty (h : t =ᵐ[μ] (∅ : Set α)) : (s ∪ t : Set α) =ᵐ[μ] 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 α
h : t =ᵐ[μ] ∅
⊢ s ∪ t =ᵐ[μ] s

Next tactic:
convert ae_eq_set_union (ae_eq_refl s) h
theorem union_ae_eq_left_of_ae_eq_empty (h : t =ᵐ[μ] (∅ : Set α)) : (s ∪ t : Set α) =ᵐ[μ] s := by
  convert ae_eq_set_union (ae_eq_refl s) h
  

Proof state:
case h.e'_5
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
h : t =ᵐ[μ] ∅
⊢ s = s ∪ ∅

Next tactic:
rw [union_empty]
theorem inter_ae_eq_right_of_ae_eq_univ (h : s =ᵐ[μ] univ) : (s ∩ t : Set α) =ᵐ[μ] 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 α
h : s =ᵐ[μ] univ
⊢ s ∩ t =ᵐ[μ] t

Next tactic:
convert ae_eq_set_inter h (ae_eq_refl t)
theorem inter_ae_eq_right_of_ae_eq_univ (h : s =ᵐ[μ] univ) : (s ∩ t : Set α) =ᵐ[μ] t := by
  convert ae_eq_set_inter h (ae_eq_refl t)
  

Proof state:
case h.e'_5
α : 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 =ᵐ[μ] univ
⊢ t = univ ∩ t

Next tactic:
rw [univ_inter]
theorem inter_ae_eq_left_of_ae_eq_univ (h : t =ᵐ[μ] univ) : (s ∩ t : Set α) =ᵐ[μ] 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 α
h : t =ᵐ[μ] univ
⊢ s ∩ t =ᵐ[μ] s

Next tactic:
convert ae_eq_set_inter (ae_eq_refl s) h
theorem inter_ae_eq_left_of_ae_eq_univ (h : t =ᵐ[μ] univ) : (s ∩ t : Set α) =ᵐ[μ] s := by
  convert ae_eq_set_inter (ae_eq_refl s) h
  

Proof state:
case h.e'_5
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
h : t =ᵐ[μ] univ
⊢ s = s ∩ univ

Next tactic:
rw [inter_univ]
theorem inter_ae_eq_empty_of_ae_eq_empty_left (h : s =ᵐ[μ] (∅ : Set α)) :
    (s ∩ t : Set α) =ᵐ[μ] (∅ : Set α) := 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 =ᵐ[μ] ∅
⊢ s ∩ t =ᵐ[μ] ∅

Next tactic:
convert ae_eq_set_inter h (ae_eq_refl t)
theorem inter_ae_eq_empty_of_ae_eq_empty_left (h : s =ᵐ[μ] (∅ : Set α)) :
    (s ∩ t : Set α) =ᵐ[μ] (∅ : Set α) := by
  convert ae_eq_set_inter h (ae_eq_refl t)
  

Proof state:
case h.e'_5
α : 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

Next tactic:
rw [empty_inter]
theorem inter_ae_eq_empty_of_ae_eq_empty_right (h : t =ᵐ[μ] (∅ : Set α)) :
    (s ∩ t : Set α) =ᵐ[μ] (∅ : Set α) := 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 : t =ᵐ[μ] ∅
⊢ s ∩ t =ᵐ[μ] ∅

Next tactic:
convert ae_eq_set_inter (ae_eq_refl s) h
theorem inter_ae_eq_empty_of_ae_eq_empty_right (h : t =ᵐ[μ] (∅ : Set α)) :
    (s ∩ t : Set α) =ᵐ[μ] (∅ : Set α) := by
  convert ae_eq_set_inter (ae_eq_refl s) h
  

Proof state:
case h.e'_5
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
inst✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t : Set α
h : t =ᵐ[μ] ∅
⊢ ∅ = s ∩ ∅

Next tactic:
rw [inter_empty]
/-- Given a predicate on `β` and `Set α` where both `α` and `β` are measurable spaces, if the
predicate holds for almost every `x : β` and
- `∅ : Set α`
- a family of sets generating the σ-algebra of `α`
Moreover, if for almost every `x : β`, the predicate is closed under complements and countable
disjoint unions, then the predicate holds for almost every `x : β` and all measurable sets of `α`.

This is an AE version of `MeasurableSpace.induction_on_inter` where the condition is dependent
on a measurable space `β`. -/
theorem _root_.MeasurableSpace.ae_induction_on_inter {β} [MeasurableSpace β] {μ : Measure β}
    {C : β → Set α → Prop} {s : Set (Set α)} [m : MeasurableSpace α]
    (h_eq : m = MeasurableSpace.generateFrom s)
    (h_inter : IsPiSystem s) (h_empty : ∀ᵐ x ∂μ, C x ∅) (h_basic : ∀ᵐ x ∂μ, ∀ t ∈ s, C x t)
    (h_compl : ∀ᵐ x ∂μ, ∀ t, MeasurableSet t → C x t → C x tᶜ)
    (h_union : ∀ᵐ x ∂μ, ∀ f : ℕ → Set α,
        Pairwise (Disjoint on f) → (∀ i, MeasurableSet (f i)) → (∀ i, C x (f i)) → C x (⋃ i, f i)) :
    ∀ᵐ x ∂μ, ∀ ⦃t⦄, MeasurableSet t → C x 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 α
β : Type u_6
inst✝ : MeasurableSpace β
μ : Measure β
C : β → Set α → Prop
s : Set (Set α)
m : MeasurableSpace α
h_eq : m = generateFrom s
h_inter : IsPiSystem s
h_empty : ∀ᵐ (x : β) ∂μ, C x ∅
h_basic : ∀ᵐ (x : β) ∂μ, ∀ t ∈ s, C x t
h_compl : ∀ᵐ (x : β) ∂μ, ∀ (t : Set α), MeasurableSet t → C x t → C x tᶜ
h_union :
  ∀ᵐ (x : β) ∂μ,
    ∀ (f : ℕ → Set α),
      Pairwise (Disjoint on f) → (∀ (i : ℕ), MeasurableSet (f i)) → (∀ (i : ℕ), C x (f i)) → C x (⋃ i, f i)
⊢ ∀ᵐ (x : β) ∂μ, ∀ ⦃t : Set α⦄, MeasurableSet t → C x t

Next tactic:
filter_upwards [h_empty, h_basic, h_compl, h_union] with x hx_empty hx_basic hx_compl hx_union
    using MeasurableSpace.induction_on_inter h_eq h_inter hx_empty hx_basic hx_compl hx_union
@[to_additive]
theorem _root_.Set.mulIndicator_ae_eq_one {M : Type*} [One M] {f : α → M} {s : Set α} :
    s.mulIndicator f =ᵐ[μ] 1 ↔ μ (s ∩ f.mulSupport) = 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 α
M : Type u_6
inst✝ : One M
f : α → M
s : Set α
⊢ mulIndicator s f =ᵐ[μ] 1 ↔ ↑↑μ (s ∩ mulSupport f) = 0

Next tactic:
simp [EventuallyEq, eventually_iff, Measure.ae, compl_setOf]
@[to_additive]
theorem _root_.Set.mulIndicator_ae_eq_one {M : Type*} [One M] {f : α → M} {s : Set α} :
    s.mulIndicator f =ᵐ[μ] 1 ↔ μ (s ∩ f.mulSupport) = 0 := by
  simp [EventuallyEq, eventually_iff, Measure.ae, compl_setOf]; 

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 α
M : Type u_6
inst✝ : One M
f : α → M
s : Set α
⊢ ↑↑μ {a | a ∈ s ∧ ¬f a = 1} = 0 ↔ ↑↑μ (s ∩ mulSupport f) = 0

Next tactic:
rfl
/-- If `s ⊆ t` modulo a set of measure `0`, then `μ s ≤ μ t`. -/
@[mono]
theorem measure_mono_ae (H : s ≤ᵐ[μ] t) : μ s ≤ μ t :=
  calc
    μ s ≤ μ (s ∪ t) := measure_mono <| subset_union_left s t
    _ = μ (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 α
H : s ≤ᵐ[μ] t
⊢ ↑↑μ (s ∪ t) = ↑↑μ (t ∪ s \ t)

Next tactic:
rw [union_diff_self, Set.union_comm]
/-- If `s ⊆ t` modulo a set of measure `0`, then `μ s ≤ μ t`. -/
@[mono]
theorem measure_mono_ae (H : s ≤ᵐ[μ] t) : μ s ≤ μ t :=
  calc
    μ s ≤ μ (s ∪ t) := measure_mono <| subset_union_left s t
    _ = μ (t ∪ s \ t) := by rw [union_diff_self, Set.union_comm]
    _ ≤ μ t + μ (s \ t) := (measure_union_le _ _)
    _ = μ 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 α
H : s ≤ᵐ[μ] t
⊢ ↑↑μ t + ↑↑μ (s \ t) = ↑↑μ t

Next tactic:
rw [ae_le_set.1 H, add_zero]
theorem subset_toMeasurable (μ : Measure α) (s : Set α) : s ⊆ toMeasurable μ 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 α
⊢ s ⊆ toMeasurable μ s

Next tactic:
rw [toMeasurable_def]
theorem subset_toMeasurable (μ : Measure α) (s : Set α) : s ⊆ toMeasurable μ s := by
  rw [toMeasurable_def]; 

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 ⊆
    if h : ∃ t ⊇ s, MeasurableSet t ∧ t =ᵐ[μ] s then Exists.choose h
    else
      if h' : ∃ t ⊇ s, MeasurableSet t ∧ ∀ (u : Set α), MeasurableSet u → ↑↑μ (t ∩ u) = ↑↑μ (s ∩ u) then
        Exists.choose h'
      else Exists.choose (_ : ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑↑μ t = ↑↑μ s)

Next tactic:
split_ifs with hs h's
theorem subset_toMeasurable (μ : Measure α) (s : Set α) : s ⊆ toMeasurable μ s := by
  rw [toMeasurable_def]; split_ifs with hs h's
  

Proof state:
case pos
α : 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 α
hs : ∃ t ⊇ s, MeasurableSet t ∧ t =ᵐ[μ] s
⊢ s ⊆ Exists.choose hs
case pos
α : 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 α
hs : ¬∃ t ⊇ s, MeasurableSet t ∧ t =ᵐ[μ] s
h's : ∃ t ⊇ s, MeasurableSet t ∧ ∀ (u : Set α), MeasurableSet u → ↑↑μ (t ∩ u) = ↑↑μ (s ∩ u)
⊢ s ⊆ Exists.choose h's
case neg
α : 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 α
hs : ¬∃ t ⊇ s, MeasurableSet t ∧ t =ᵐ[μ] s
h's : ¬∃ t ⊇ s, MeasurableSet t ∧ ∀ (u : Set α), MeasurableSet u → ↑↑μ (t ∩ u) = ↑↑μ (s ∩ u)
⊢ s ⊆ Exists.choose (_ : ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑↑μ t = ↑↑μ s)

Next tactic:
exacts [hs.choose_spec.1, h's.choose_spec.1, (exists_measurable_superset μ s).choose_spec.1]
@[simp]
theorem measurableSet_toMeasurable (μ : Measure α) (s : Set α) :
    MeasurableSet (toMeasurable μ 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 α
⊢ MeasurableSet (toMeasurable μ s)

Next tactic:
rw [toMeasurable_def]
@[simp]
theorem measurableSet_toMeasurable (μ : Measure α) (s : Set α) :
    MeasurableSet (toMeasurable μ s) := by
  rw [toMeasurable_def]; 

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 α
⊢ MeasurableSet
    (if h : ∃ t ⊇ s, MeasurableSet t ∧ t =ᵐ[μ] s then Exists.choose h
    else
      if h' : ∃ t ⊇ s, MeasurableSet t ∧ ∀ (u : Set α), MeasurableSet u → ↑↑μ (t ∩ u) = ↑↑μ (s ∩ u) then
        Exists.choose h'
      else Exists.choose (_ : ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑↑μ t = ↑↑μ s))

Next tactic:
split_ifs with hs h's
@[simp]
theorem measurableSet_toMeasurable (μ : Measure α) (s : Set α) :
    MeasurableSet (toMeasurable μ s) := by
  rw [toMeasurable_def]; split_ifs with hs h's
  

Proof state:
case pos
α : 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 α
hs : ∃ t ⊇ s, MeasurableSet t ∧ t =ᵐ[μ] s
⊢ MeasurableSet (Exists.choose hs)
case pos
α : 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 α
hs : ¬∃ t ⊇ s, MeasurableSet t ∧ t =ᵐ[μ] s
h's : ∃ t ⊇ s, MeasurableSet t ∧ ∀ (u : Set α), MeasurableSet u → ↑↑μ (t ∩ u) = ↑↑μ (s ∩ u)
⊢ MeasurableSet (Exists.choose h's)
case neg
α : 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 α
hs : ¬∃ t ⊇ s, MeasurableSet t ∧ t =ᵐ[μ] s
h's : ¬∃ t ⊇ s, MeasurableSet t ∧ ∀ (u : Set α), MeasurableSet u → ↑↑μ (t ∩ u) = ↑↑μ (s ∩ u)
⊢ MeasurableSet (Exists.choose (_ : ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑↑μ t = ↑↑μ s))

Next tactic:
exacts [hs.choose_spec.2.1, h's.choose_spec.2.1,
          (exists_measurable_superset μ s).choose_spec.2.1]
@[simp]
theorem measure_toMeasurable (s : Set α) : μ (toMeasurable μ 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 s : Set α
⊢ ↑↑μ (toMeasurable μ s) = ↑↑μ s

Next tactic:
rw [toMeasurable_def]
@[simp]
theorem measure_toMeasurable (s : Set α) : μ (toMeasurable μ s) = μ s := by
  rw [toMeasurable_def]; 

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 α
⊢ ↑↑μ
      (if h : ∃ t ⊇ s, MeasurableSet t ∧ t =ᵐ[μ] s then Exists.choose h
      else
        if h' : ∃ t ⊇ s, MeasurableSet t ∧ ∀ (u : Set α), MeasurableSet u → ↑↑μ (t ∩ u) = ↑↑μ (s ∩ u) then
          Exists.choose h'
        else Exists.choose (_ : ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑↑μ t = ↑↑μ s)) =
    ↑↑μ s

Next tactic:
split_ifs with hs h's
@[simp]
theorem measure_toMeasurable (s : Set α) : μ (toMeasurable μ s) = μ s := by
  rw [toMeasurable_def]; split_ifs with hs h's
  · 

Proof state:
case pos
α : 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 : ∃ t ⊇ s, MeasurableSet t ∧ t =ᵐ[μ] s
⊢ ↑↑μ (Exists.choose hs) = ↑↑μ s

Next tactic:
exact measure_congr hs.choose_spec.2.2
@[simp]
theorem measure_toMeasurable (s : Set α) : μ (toMeasurable μ s) = μ s := by
  rw [toMeasurable_def]; split_ifs with hs h's
  · exact measure_congr hs.choose_spec.2.2
  · 

Proof state:
case pos
α : 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 : ¬∃ t ⊇ s, MeasurableSet t ∧ t =ᵐ[μ] s
h's : ∃ t ⊇ s, MeasurableSet t ∧ ∀ (u : Set α), MeasurableSet u → ↑↑μ (t ∩ u) = ↑↑μ (s ∩ u)
⊢ ↑↑μ (Exists.choose h's) = ↑↑μ s

Next tactic:
simpa only [inter_univ] using h's.choose_spec.2.2 univ MeasurableSet.univ
@[simp]
theorem measure_toMeasurable (s : Set α) : μ (toMeasurable μ s) = μ s := by
  rw [toMeasurable_def]; split_ifs with hs h's
  · exact measure_congr hs.choose_spec.2.2
  · simpa only [inter_univ] using h's.choose_spec.2.2 univ MeasurableSet.univ
  · 

Proof state:
case neg
α : 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 : ¬∃ t ⊇ s, MeasurableSet t ∧ t =ᵐ[μ] s
h's : ¬∃ t ⊇ s, MeasurableSet t ∧ ∀ (u : Set α), MeasurableSet u → ↑↑μ (t ∩ u) = ↑↑μ (s ∩ u)
⊢ ↑↑μ (Exists.choose (_ : ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑↑μ t = ↑↑μ s)) = ↑↑μ s

Next tactic:
exact (exists_measurable_superset μ s).choose_spec.2.2
@[simp]
theorem star_iff [InvolutiveStar R] {x : R} : IsSelfAdjoint (star x) ↔ IsSelfAdjoint x := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝ : InvolutiveStar R
x : R
⊢ IsSelfAdjoint (star x) ↔ IsSelfAdjoint x

Next tactic:
simpa only [IsSelfAdjoint, star_star] using eq_comm
@[simp]
theorem star_mul_self [Mul R] [StarMul R] (x : R) : IsSelfAdjoint (star x * x) := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : Mul R
inst✝ : StarMul R
x : R
⊢ IsSelfAdjoint (star x * x)

Next tactic:
simp only [IsSelfAdjoint, star_mul, star_star]
@[simp]
theorem mul_star_self [Mul R] [StarMul R] (x : R) : IsSelfAdjoint (x * star x) := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : Mul R
inst✝ : StarMul R
x : R
⊢ IsSelfAdjoint (x * star x)

Next tactic:
simpa only [star_star] using star_mul_self (star x)
/-- Self-adjoint elements commute if and only if their product is self-adjoint. -/
lemma commute_iff {R : Type*} [Mul R] [StarMul R] {x y : R}
    (hx : IsSelfAdjoint x) (hy : IsSelfAdjoint y) : Commute x y ↔ IsSelfAdjoint (x * y) := by
  

Proof state:
R✝ : Type u_1
A : Type u_2
R : Type u_3
inst✝¹ : Mul R
inst✝ : StarMul R
x y : R
hx : IsSelfAdjoint x
hy : IsSelfAdjoint y
⊢ Commute x y ↔ IsSelfAdjoint (x * y)

Next tactic:
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
/-- Self-adjoint elements commute if and only if their product is self-adjoint. -/
lemma commute_iff {R : Type*} [Mul R] [StarMul R] {x y : R}
    (hx : IsSelfAdjoint x) (hy : IsSelfAdjoint y) : Commute x y ↔ IsSelfAdjoint (x * y) := by
  refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
  · 

Proof state:
case refine_1
R✝ : Type u_1
A : Type u_2
R : Type u_3
inst✝¹ : Mul R
inst✝ : StarMul R
x y : R
hx : IsSelfAdjoint x
hy : IsSelfAdjoint y
h : Commute x y
⊢ IsSelfAdjoint (x * y)

Next tactic:
rw [isSelfAdjoint_iff, star_mul, hx.star_eq, hy.star_eq, h.eq]
/-- Self-adjoint elements commute if and only if their product is self-adjoint. -/
lemma commute_iff {R : Type*} [Mul R] [StarMul R] {x y : R}
    (hx : IsSelfAdjoint x) (hy : IsSelfAdjoint y) : Commute x y ↔ IsSelfAdjoint (x * y) := by
  refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
  · rw [isSelfAdjoint_iff, star_mul, hx.star_eq, hy.star_eq, h.eq]
  · 

Proof state:
case refine_2
R✝ : Type u_1
A : Type u_2
R : Type u_3
inst✝¹ : Mul R
inst✝ : StarMul R
x y : R
hx : IsSelfAdjoint x
hy : IsSelfAdjoint y
h : IsSelfAdjoint (x * y)
⊢ Commute x y

Next tactic:
simpa only [star_mul, hx.star_eq, hy.star_eq] using h.symm
theorem add {x y : R} (hx : IsSelfAdjoint x) (hy : IsSelfAdjoint y) : IsSelfAdjoint (x + y) := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : AddMonoid R
inst✝ : StarAddMonoid R
x y : R
hx : IsSelfAdjoint x
hy : IsSelfAdjoint y
⊢ IsSelfAdjoint (x + y)

Next tactic:
simp only [isSelfAdjoint_iff, star_add, hx.star_eq, hy.star_eq]
set_option linter.deprecated false in
@[deprecated]
theorem bit0 {x : R} (hx : IsSelfAdjoint x) : IsSelfAdjoint (bit0 x) := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : AddMonoid R
inst✝ : StarAddMonoid R
x : R
hx : IsSelfAdjoint x
⊢ IsSelfAdjoint (_root_.bit0 x)

Next tactic:
simp only [isSelfAdjoint_iff, star_bit0, hx.star_eq]
theorem neg {x : R} (hx : IsSelfAdjoint x) : IsSelfAdjoint (-x) := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : AddGroup R
inst✝ : StarAddMonoid R
x : R
hx : IsSelfAdjoint x
⊢ IsSelfAdjoint (-x)

Next tactic:
simp only [isSelfAdjoint_iff, star_neg, hx.star_eq]
theorem sub {x y : R} (hx : IsSelfAdjoint x) (hy : IsSelfAdjoint y) : IsSelfAdjoint (x - y) := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : AddGroup R
inst✝ : StarAddMonoid R
x y : R
hx : IsSelfAdjoint x
hy : IsSelfAdjoint y
⊢ IsSelfAdjoint (x - y)

Next tactic:
simp only [isSelfAdjoint_iff, star_sub, hx.star_eq, hy.star_eq]
theorem _root_.isSelfAdjoint_add_star_self (x : R) : IsSelfAdjoint (x + star x) := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : AddCommMonoid R
inst✝ : StarAddMonoid R
x : R
⊢ IsSelfAdjoint (x + star x)

Next tactic:
simp only [isSelfAdjoint_iff, add_comm, star_add, star_star]
theorem _root_.isSelfAdjoint_star_add_self (x : R) : IsSelfAdjoint (star x + x) := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : AddCommMonoid R
inst✝ : StarAddMonoid R
x : R
⊢ IsSelfAdjoint (star x + x)

Next tactic:
simp only [isSelfAdjoint_iff, add_comm, star_add, star_star]
theorem conjugate {x : R} (hx : IsSelfAdjoint x) (z : R) : IsSelfAdjoint (z * x * star z) := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : Semigroup R
inst✝ : StarMul R
x : R
hx : IsSelfAdjoint x
z : R
⊢ IsSelfAdjoint (z * x * star z)

Next tactic:
simp only [isSelfAdjoint_iff, star_mul, star_star, mul_assoc, hx.star_eq]
theorem conjugate' {x : R} (hx : IsSelfAdjoint x) (z : R) : IsSelfAdjoint (star z * x * z) := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : Semigroup R
inst✝ : StarMul R
x : R
hx : IsSelfAdjoint x
z : R
⊢ IsSelfAdjoint (star z * x * z)

Next tactic:
simp only [isSelfAdjoint_iff, star_mul, star_star, mul_assoc, hx.star_eq]
theorem isStarNormal {x : R} (hx : IsSelfAdjoint x) : IsStarNormal x :=
  ⟨by 

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : Semigroup R
inst✝ : StarMul R
x : R
hx : IsSelfAdjoint x
⊢ Commute (star x) x

Next tactic:
simp only [Commute, SemiconjBy, hx.star_eq]
theorem pow {x : R} (hx : IsSelfAdjoint x) (n : ℕ) : IsSelfAdjoint (x ^ n) := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : Monoid R
inst✝ : StarMul R
x : R
hx : IsSelfAdjoint x
n : ℕ
⊢ IsSelfAdjoint (x ^ n)

Next tactic:
simp only [isSelfAdjoint_iff, star_pow, hx.star_eq]
set_option linter.deprecated false in
@[deprecated]
theorem bit1 {x : R} (hx : IsSelfAdjoint x) : IsSelfAdjoint (bit1 x) := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : Semiring R
inst✝ : StarRing R
x : R
hx : IsSelfAdjoint x
⊢ IsSelfAdjoint (_root_.bit1 x)

Next tactic:
simp only [isSelfAdjoint_iff, star_bit1, hx.star_eq]
theorem mul {x y : R} (hx : IsSelfAdjoint x) (hy : IsSelfAdjoint y) : IsSelfAdjoint (x * y) := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : CommSemigroup R
inst✝ : StarMul R
x y : R
hx : IsSelfAdjoint x
hy : IsSelfAdjoint y
⊢ IsSelfAdjoint (x * y)

Next tactic:
simp only [isSelfAdjoint_iff, star_mul', hx.star_eq, hy.star_eq]
theorem inv {x : R} (hx : IsSelfAdjoint x) : IsSelfAdjoint x⁻¹ := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : DivisionSemiring R
inst✝ : StarRing R
x : R
hx : IsSelfAdjoint x
⊢ IsSelfAdjoint x⁻¹

Next tactic:
simp only [isSelfAdjoint_iff, star_inv', hx.star_eq]
theorem zpow {x : R} (hx : IsSelfAdjoint x) (n : ℤ) : IsSelfAdjoint (x ^ n) := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝¹ : DivisionSemiring R
inst✝ : StarRing R
x : R
hx : IsSelfAdjoint x
n : ℤ
⊢ IsSelfAdjoint (x ^ n)

Next tactic:
simp only [isSelfAdjoint_iff, star_zpow₀, hx.star_eq]