l3lab/ntp-mathlib huggingface dataset:
/-- The inner dual of inner dual of a non-empty, closed convex cone is itself.  -/
theorem ConvexCone.innerDualCone_of_innerDualCone_eq_self (K : ConvexCone ℝ H)
    (ne : (K : Set H).Nonempty) (hc : IsClosed (K : Set H)) :
    ((K : Set H).innerDualCone : Set H).innerDualCone = K := by
  ext x
  

Proof state:
case h
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
x : H
⊢ x ∈ innerDualCone ↑(innerDualCone ↑K) ↔ x ∈ K

Next tactic:
constructor
/-- The inner dual of inner dual of a non-empty, closed convex cone is itself.  -/
theorem ConvexCone.innerDualCone_of_innerDualCone_eq_self (K : ConvexCone ℝ H)
    (ne : (K : Set H).Nonempty) (hc : IsClosed (K : Set H)) :
    ((K : Set H).innerDualCone : Set H).innerDualCone = K := by
  ext x
  constructor
  · 

Proof state:
case h.mp
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
x : H
⊢ x ∈ innerDualCone ↑(innerDualCone ↑K) → x ∈ K

Next tactic:
rw [mem_innerDualCone, ← SetLike.mem_coe]
/-- The inner dual of inner dual of a non-empty, closed convex cone is itself.  -/
theorem ConvexCone.innerDualCone_of_innerDualCone_eq_self (K : ConvexCone ℝ H)
    (ne : (K : Set H).Nonempty) (hc : IsClosed (K : Set H)) :
    ((K : Set H).innerDualCone : Set H).innerDualCone = K := by
  ext x
  constructor
  · rw [mem_innerDualCone, ← SetLike.mem_coe]
    

Proof state:
case h.mp
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
x : H
⊢ (∀ x_1 ∈ ↑(innerDualCone ↑K), 0 ≤ inner x_1 x) → x ∈ ↑K

Next tactic:
contrapose!
/-- The inner dual of inner dual of a non-empty, closed convex cone is itself.  -/
theorem ConvexCone.innerDualCone_of_innerDualCone_eq_self (K : ConvexCone ℝ H)
    (ne : (K : Set H).Nonempty) (hc : IsClosed (K : Set H)) :
    ((K : Set H).innerDualCone : Set H).innerDualCone = K := by
  ext x
  constructor
  · rw [mem_innerDualCone, ← SetLike.mem_coe]
    contrapose!
    

Proof state:
case h.mp
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
x : H
⊢ x ∉ ↑K → ∃ x_1 ∈ ↑(innerDualCone ↑K), inner x_1 x < 0

Next tactic:
exact K.hyperplane_separation_of_nonempty_of_isClosed_of_nmem ne hc
/-- The inner dual of inner dual of a non-empty, closed convex cone is itself.  -/
theorem ConvexCone.innerDualCone_of_innerDualCone_eq_self (K : ConvexCone ℝ H)
    (ne : (K : Set H).Nonempty) (hc : IsClosed (K : Set H)) :
    ((K : Set H).innerDualCone : Set H).innerDualCone = K := by
  ext x
  constructor
  · rw [mem_innerDualCone, ← SetLike.mem_coe]
    contrapose!
    exact K.hyperplane_separation_of_nonempty_of_isClosed_of_nmem ne hc
  · 

Proof state:
case h.mpr
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
x : H
⊢ x ∈ K → x ∈ innerDualCone ↑(innerDualCone ↑K)

Next tactic:
rintro hxK y h
/-- The inner dual of inner dual of a non-empty, closed convex cone is itself.  -/
theorem ConvexCone.innerDualCone_of_innerDualCone_eq_self (K : ConvexCone ℝ H)
    (ne : (K : Set H).Nonempty) (hc : IsClosed (K : Set H)) :
    ((K : Set H).innerDualCone : Set H).innerDualCone = K := by
  ext x
  constructor
  · rw [mem_innerDualCone, ← SetLike.mem_coe]
    contrapose!
    exact K.hyperplane_separation_of_nonempty_of_isClosed_of_nmem ne hc
  · rintro hxK y h
    

Proof state:
case h.mpr
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
x : H
hxK : x ∈ K
y : H
h : y ∈ ↑(innerDualCone ↑K)
⊢ 0 ≤ inner y x

Next tactic:
specialize h x hxK
/-- The inner dual of inner dual of a non-empty, closed convex cone is itself.  -/
theorem ConvexCone.innerDualCone_of_innerDualCone_eq_self (K : ConvexCone ℝ H)
    (ne : (K : Set H).Nonempty) (hc : IsClosed (K : Set H)) :
    ((K : Set H).innerDualCone : Set H).innerDualCone = K := by
  ext x
  constructor
  · rw [mem_innerDualCone, ← SetLike.mem_coe]
    contrapose!
    exact K.hyperplane_separation_of_nonempty_of_isClosed_of_nmem ne hc
  · rintro hxK y h
    specialize h x hxK
    

Proof state:
case h.mpr
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
x : H
hxK : x ∈ K
y : H
h : 0 ≤ inner x y
⊢ 0 ≤ inner y x

Next tactic:
rwa [real_inner_comm]
/-- A version of `measurable_div_const` that assumes `MeasurableMul` instead of
  `MeasurableDiv`. This can be nice to avoid unnecessary type-class assumptions. -/
@[to_additive " A version of `measurable_sub_const` that assumes `MeasurableAdd` instead of
  `MeasurableSub`. This can be nice to avoid unnecessary type-class assumptions. "]
theorem measurable_div_const' {G : Type*} [DivInvMonoid G] [MeasurableSpace G] [MeasurableMul G]
    (g : G) : Measurable fun h => h / g := by 

Proof state:
α : Type u_1
G : Type u_2
inst✝² : DivInvMonoid G
inst✝¹ : MeasurableSpace G
inst✝ : MeasurableMul G
g : G
⊢ Measurable fun h => h / g

Next tactic:
simp_rw [div_eq_mul_inv, measurable_mul_const]
/-- `Monoid.Pow` is measurable. -/
instance Monoid.measurablePow (M : Type*) [Monoid M] [MeasurableSpace M] [MeasurableMul₂ M] :
    MeasurablePow M ℕ :=
  ⟨measurable_from_prod_countable fun n => by
      

Proof state:
α : Type u_1
M : Type u_2
inst✝² : Monoid M
inst✝¹ : MeasurableSpace M
inst✝ : MeasurableMul₂ M
n : ℕ
⊢ Measurable fun x => (x, n).1 ^ (x, n).2

Next tactic:
induction' n with n ih
/-- `Monoid.Pow` is measurable. -/
instance Monoid.measurablePow (M : Type*) [Monoid M] [MeasurableSpace M] [MeasurableMul₂ M] :
    MeasurablePow M ℕ :=
  ⟨measurable_from_prod_countable fun n => by
      induction' n with n ih
      · 

Proof state:
case zero
α : Type u_1
M : Type u_2
inst✝² : Monoid M
inst✝¹ : MeasurableSpace M
inst✝ : MeasurableMul₂ M
⊢ Measurable fun x => (x, Nat.zero).1 ^ (x, Nat.zero).2

Next tactic:
simp only [Nat.zero_eq, pow_zero, ← Pi.one_def, measurable_one]
/-- `Monoid.Pow` is measurable. -/
instance Monoid.measurablePow (M : Type*) [Monoid M] [MeasurableSpace M] [MeasurableMul₂ M] :
    MeasurablePow M ℕ :=
  ⟨measurable_from_prod_countable fun n => by
      induction' n with n ih
      · simp only [Nat.zero_eq, pow_zero, ← Pi.one_def, measurable_one]
      · 

Proof state:
case succ
α : Type u_1
M : Type u_2
inst✝² : Monoid M
inst✝¹ : MeasurableSpace M
inst✝ : MeasurableMul₂ M
n : ℕ
ih : Measurable fun x => (x, n).1 ^ (x, n).2
⊢ Measurable fun x => (x, Nat.succ n).1 ^ (x, Nat.succ n).2

Next tactic:
simp only [pow_succ]
/-- `Monoid.Pow` is measurable. -/
instance Monoid.measurablePow (M : Type*) [Monoid M] [MeasurableSpace M] [MeasurableMul₂ M] :
    MeasurablePow M ℕ :=
  ⟨measurable_from_prod_countable fun n => by
      induction' n with n ih
      · simp only [Nat.zero_eq, pow_zero, ← Pi.one_def, measurable_one]
      · simp only [pow_succ]
        

Proof state:
case succ
α : Type u_1
M : Type u_2
inst✝² : Monoid M
inst✝¹ : MeasurableSpace M
inst✝ : MeasurableMul₂ M
n : ℕ
ih : Measurable fun x => (x, n).1 ^ (x, n).2
⊢ Measurable fun x => x * x ^ n

Next tactic:
exact measurable_id.mul ih
@[measurability]
theorem measurableSet_eq_fun {m : MeasurableSpace α} {E} [MeasurableSpace E] [AddGroup E]
    [MeasurableSingletonClass E] [MeasurableSub₂ E] {f g : α → E} (hf : Measurable f)
    (hg : Measurable g) : MeasurableSet { x | f x = g x } := by
  

Proof state:
α✝ : Type u_1
G : Type u_2
α : Type u_3
inst✝⁵ : MeasurableSpace G
inst✝⁴ : Div G
m✝ : MeasurableSpace α
f✝ g✝ : α → G
μ : Measure α
m : MeasurableSpace α
E : Type u_4
inst✝³ : MeasurableSpace E
inst✝² : AddGroup E
inst✝¹ : MeasurableSingletonClass E
inst✝ : MeasurableSub₂ E
f g : α → E
hf : Measurable f
hg : Measurable g
⊢ MeasurableSet {x | f x = g x}

Next tactic:
suffices h_set_eq : { x : α | f x = g x } = { x | (f - g) x = (0 : E) }
@[measurability]
theorem measurableSet_eq_fun {m : MeasurableSpace α} {E} [MeasurableSpace E] [AddGroup E]
    [MeasurableSingletonClass E] [MeasurableSub₂ E] {f g : α → E} (hf : Measurable f)
    (hg : Measurable g) : MeasurableSet { x | f x = g x } := by
  suffices h_set_eq : { x : α | f x = g x } = { x | (f - g) x = (0 : E) }
  · 

Proof state:
α✝ : Type u_1
G : Type u_2
α : Type u_3
inst✝⁵ : MeasurableSpace G
inst✝⁴ : Div G
m✝ : MeasurableSpace α
f✝ g✝ : α → G
μ : Measure α
m : MeasurableSpace α
E : Type u_4
inst✝³ : MeasurableSpace E
inst✝² : AddGroup E
inst✝¹ : MeasurableSingletonClass E
inst✝ : MeasurableSub₂ E
f g : α → E
hf : Measurable f
hg : Measurable g
h_set_eq : {x | f x = g x} = {x | (f - g) x = 0}
⊢ MeasurableSet {x | f x = g x}

Next tactic:
rw [h_set_eq]
@[measurability]
theorem measurableSet_eq_fun {m : MeasurableSpace α} {E} [MeasurableSpace E] [AddGroup E]
    [MeasurableSingletonClass E] [MeasurableSub₂ E] {f g : α → E} (hf : Measurable f)
    (hg : Measurable g) : MeasurableSet { x | f x = g x } := by
  suffices h_set_eq : { x : α | f x = g x } = { x | (f - g) x = (0 : E) }
  · rw [h_set_eq]
    

Proof state:
α✝ : Type u_1
G : Type u_2
α : Type u_3
inst✝⁵ : MeasurableSpace G
inst✝⁴ : Div G
m✝ : MeasurableSpace α
f✝ g✝ : α → G
μ : Measure α
m : MeasurableSpace α
E : Type u_4
inst✝³ : MeasurableSpace E
inst✝² : AddGroup E
inst✝¹ : MeasurableSingletonClass E
inst✝ : MeasurableSub₂ E
f g : α → E
hf : Measurable f
hg : Measurable g
h_set_eq : {x | f x = g x} = {x | (f - g) x = 0}
⊢ MeasurableSet {x | (f - g) x = 0}

Next tactic:
exact (hf.sub hg) measurableSet_eq
@[measurability]
theorem measurableSet_eq_fun {m : MeasurableSpace α} {E} [MeasurableSpace E] [AddGroup E]
    [MeasurableSingletonClass E] [MeasurableSub₂ E] {f g : α → E} (hf : Measurable f)
    (hg : Measurable g) : MeasurableSet { x | f x = g x } := by
  suffices h_set_eq : { x : α | f x = g x } = { x | (f - g) x = (0 : E) }
  · rw [h_set_eq]
    exact (hf.sub hg) measurableSet_eq
  

Proof state:
case h_set_eq
α✝ : Type u_1
G : Type u_2
α : Type u_3
inst✝⁵ : MeasurableSpace G
inst✝⁴ : Div G
m✝ : MeasurableSpace α
f✝ g✝ : α → G
μ : Measure α
m : MeasurableSpace α
E : Type u_4
inst✝³ : MeasurableSpace E
inst✝² : AddGroup E
inst✝¹ : MeasurableSingletonClass E
inst✝ : MeasurableSub₂ E
f g : α → E
hf : Measurable f
hg : Measurable g
⊢ {x | f x = g x} = {x | (f - g) x = 0}

Next tactic:
ext
@[measurability]
theorem measurableSet_eq_fun {m : MeasurableSpace α} {E} [MeasurableSpace E] [AddGroup E]
    [MeasurableSingletonClass E] [MeasurableSub₂ E] {f g : α → E} (hf : Measurable f)
    (hg : Measurable g) : MeasurableSet { x | f x = g x } := by
  suffices h_set_eq : { x : α | f x = g x } = { x | (f - g) x = (0 : E) }
  · rw [h_set_eq]
    exact (hf.sub hg) measurableSet_eq
  ext
  

Proof state:
case h_set_eq.h
α✝ : Type u_1
G : Type u_2
α : Type u_3
inst✝⁵ : MeasurableSpace G
inst✝⁴ : Div G
m✝ : MeasurableSpace α
f✝ g✝ : α → G
μ : Measure α
m : MeasurableSpace α
E : Type u_4
inst✝³ : MeasurableSpace E
inst✝² : AddGroup E
inst✝¹ : MeasurableSingletonClass E
inst✝ : MeasurableSub₂ E
f g : α → E
hf : Measurable f
hg : Measurable g
x✝ : α
⊢ x✝ ∈ {x | f x = g x} ↔ x✝ ∈ {x | (f - g) x = 0}

Next tactic:
simp_rw [Set.mem_setOf_eq, Pi.sub_apply, sub_eq_zero]
theorem nullMeasurableSet_eq_fun {E} [MeasurableSpace E] [AddGroup E] [MeasurableSingletonClass E]
    [MeasurableSub₂ E] {f g : α → E} (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
    NullMeasurableSet { x | f x = g x } μ := by
  

Proof state:
α✝ : Type u_1
G : Type u_2
α : Type u_3
inst✝⁵ : MeasurableSpace G
inst✝⁴ : Div G
m : MeasurableSpace α
f✝ g✝ : α → G
μ : Measure α
E : Type u_4
inst✝³ : MeasurableSpace E
inst✝² : AddGroup E
inst✝¹ : MeasurableSingletonClass E
inst✝ : MeasurableSub₂ E
f g : α → E
hf : AEMeasurable f
hg : AEMeasurable g
⊢ NullMeasurableSet {x | f x = g x}

Next tactic:
apply (measurableSet_eq_fun hf.measurable_mk hg.measurable_mk).nullMeasurableSet.congr
theorem nullMeasurableSet_eq_fun {E} [MeasurableSpace E] [AddGroup E] [MeasurableSingletonClass E]
    [MeasurableSub₂ E] {f g : α → E} (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
    NullMeasurableSet { x | f x = g x } μ := by
  apply (measurableSet_eq_fun hf.measurable_mk hg.measurable_mk).nullMeasurableSet.congr
  

Proof state:
α✝ : Type u_1
G : Type u_2
α : Type u_3
inst✝⁵ : MeasurableSpace G
inst✝⁴ : Div G
m : MeasurableSpace α
f✝ g✝ : α → G
μ : Measure α
E : Type u_4
inst✝³ : MeasurableSpace E
inst✝² : AddGroup E
inst✝¹ : MeasurableSingletonClass E
inst✝ : MeasurableSub₂ E
f g : α → E
hf : AEMeasurable f
hg : AEMeasurable g
⊢ {x | AEMeasurable.mk f hf x = AEMeasurable.mk g hg x} =ᵐ[μ] {x | f x = g x}

Next tactic:
filter_upwards [hf.ae_eq_mk, hg.ae_eq_mk] with x hfx hgx
theorem nullMeasurableSet_eq_fun {E} [MeasurableSpace E] [AddGroup E] [MeasurableSingletonClass E]
    [MeasurableSub₂ E] {f g : α → E} (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
    NullMeasurableSet { x | f x = g x } μ := by
  apply (measurableSet_eq_fun hf.measurable_mk hg.measurable_mk).nullMeasurableSet.congr
  filter_upwards [hf.ae_eq_mk, hg.ae_eq_mk] with x hfx hgx
  

Proof state:
case h
α✝ : Type u_1
G : Type u_2
α : Type u_3
inst✝⁵ : MeasurableSpace G
inst✝⁴ : Div G
m : MeasurableSpace α
f✝ g✝ : α → G
μ : Measure α
E : Type u_4
inst✝³ : MeasurableSpace E
inst✝² : AddGroup E
inst✝¹ : MeasurableSingletonClass E
inst✝ : MeasurableSub₂ E
f g : α → E
hf : AEMeasurable f
hg : AEMeasurable g
x : α
hfx : f x = AEMeasurable.mk f hf x
hgx : g x = AEMeasurable.mk g hg x
⊢ setOf (fun x => AEMeasurable.mk f hf x = AEMeasurable.mk g hg x) x = setOf (fun x => f x = g x) x

Next tactic:
change (hf.mk f x = hg.mk g x) = (f x = g x)
theorem nullMeasurableSet_eq_fun {E} [MeasurableSpace E] [AddGroup E] [MeasurableSingletonClass E]
    [MeasurableSub₂ E] {f g : α → E} (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
    NullMeasurableSet { x | f x = g x } μ := by
  apply (measurableSet_eq_fun hf.measurable_mk hg.measurable_mk).nullMeasurableSet.congr
  filter_upwards [hf.ae_eq_mk, hg.ae_eq_mk] with x hfx hgx
  change (hf.mk f x = hg.mk g x) = (f x = g x)
  

Proof state:
case h
α✝ : Type u_1
G : Type u_2
α : Type u_3
inst✝⁵ : MeasurableSpace G
inst✝⁴ : Div G
m : MeasurableSpace α
f✝ g✝ : α → G
μ : Measure α
E : Type u_4
inst✝³ : MeasurableSpace E
inst✝² : AddGroup E
inst✝¹ : MeasurableSingletonClass E
inst✝ : MeasurableSub₂ E
f g : α → E
hf : AEMeasurable f
hg : AEMeasurable g
x : α
hfx : f x = AEMeasurable.mk f hf x
hgx : g x = AEMeasurable.mk g hg x
⊢ (AEMeasurable.mk f hf x = AEMeasurable.mk g hg x) = (f x = g x)

Next tactic:
simp only [hfx, hgx]
theorem measurableSet_eq_fun_of_countable {m : MeasurableSpace α} {E} [MeasurableSpace E]
    [MeasurableSingletonClass E] [Countable E] {f g : α → E} (hf : Measurable f)
    (hg : Measurable g) : MeasurableSet { x | f x = g x } := by
  

Proof state:
α✝ : Type u_1
G : Type u_2
α : Type u_3
inst✝⁴ : MeasurableSpace G
inst✝³ : Div G
m✝ : MeasurableSpace α
f✝ g✝ : α → G
μ : Measure α
m : MeasurableSpace α
E : Type u_4
inst✝² : MeasurableSpace E
inst✝¹ : MeasurableSingletonClass E
inst✝ : Countable E
f g : α → E
hf : Measurable f
hg : Measurable g
⊢ MeasurableSet {x | f x = g x}

Next tactic:
have : { x | f x = g x } = ⋃ j, { x | f x = j } ∩ { x | g x = j } := by
    ext1 x
    simp only [Set.mem_setOf_eq, Set.mem_iUnion, Set.mem_inter_iff, exists_eq_right']
theorem measurableSet_eq_fun_of_countable {m : MeasurableSpace α} {E} [MeasurableSpace E]
    [MeasurableSingletonClass E] [Countable E] {f g : α → E} (hf : Measurable f)
    (hg : Measurable g) : MeasurableSet { x | f x = g x } := by
  have : { x | f x = g x } = ⋃ j, { x | f x = j } ∩ { x | g x = j } := by
    

Proof state:
α✝ : Type u_1
G : Type u_2
α : Type u_3
inst✝⁴ : MeasurableSpace G
inst✝³ : Div G
m✝ : MeasurableSpace α
f✝ g✝ : α → G
μ : Measure α
m : MeasurableSpace α
E : Type u_4
inst✝² : MeasurableSpace E
inst✝¹ : MeasurableSingletonClass E
inst✝ : Countable E
f g : α → E
hf : Measurable f
hg : Measurable g
⊢ {x | f x = g x} = ⋃ j, {x | f x = j} ∩ {x | g x = j}

Next tactic:
ext1 x
theorem measurableSet_eq_fun_of_countable {m : MeasurableSpace α} {E} [MeasurableSpace E]
    [MeasurableSingletonClass E] [Countable E] {f g : α → E} (hf : Measurable f)
    (hg : Measurable g) : MeasurableSet { x | f x = g x } := by
  have : { x | f x = g x } = ⋃ j, { x | f x = j } ∩ { x | g x = j } := by
    ext1 x
    

Proof state:
case h
α✝ : Type u_1
G : Type u_2
α : Type u_3
inst✝⁴ : MeasurableSpace G
inst✝³ : Div G
m✝ : MeasurableSpace α
f✝ g✝ : α → G
μ : Measure α
m : MeasurableSpace α
E : Type u_4
inst✝² : MeasurableSpace E
inst✝¹ : MeasurableSingletonClass E
inst✝ : Countable E
f g : α → E
hf : Measurable f
hg : Measurable g
x : α
⊢ x ∈ {x | f x = g x} ↔ x ∈ ⋃ j, {x | f x = j} ∩ {x | g x = j}

Next tactic:
simp only [Set.mem_setOf_eq, Set.mem_iUnion, Set.mem_inter_iff, exists_eq_right']
theorem measurableSet_eq_fun_of_countable {m : MeasurableSpace α} {E} [MeasurableSpace E]
    [MeasurableSingletonClass E] [Countable E] {f g : α → E} (hf : Measurable f)
    (hg : Measurable g) : MeasurableSet { x | f x = g x } := by
  have : { x | f x = g x } = ⋃ j, { x | f x = j } ∩ { x | g x = j } := by
    ext1 x
    simp only [Set.mem_setOf_eq, Set.mem_iUnion, Set.mem_inter_iff, exists_eq_right']
  

Proof state:
α✝ : Type u_1
G : Type u_2
α : Type u_3
inst✝⁴ : MeasurableSpace G
inst✝³ : Div G
m✝ : MeasurableSpace α
f✝ g✝ : α → G
μ : Measure α
m : MeasurableSpace α
E : Type u_4
inst✝² : MeasurableSpace E
inst✝¹ : MeasurableSingletonClass E
inst✝ : Countable E
f g : α → E
hf : Measurable f
hg : Measurable g
this : {x | f x = g x} = ⋃ j, {x | f x = j} ∩ {x | g x = j}
⊢ MeasurableSet {x | f x = g x}

Next tactic:
rw [this]
theorem measurableSet_eq_fun_of_countable {m : MeasurableSpace α} {E} [MeasurableSpace E]
    [MeasurableSingletonClass E] [Countable E] {f g : α → E} (hf : Measurable f)
    (hg : Measurable g) : MeasurableSet { x | f x = g x } := by
  have : { x | f x = g x } = ⋃ j, { x | f x = j } ∩ { x | g x = j } := by
    ext1 x
    simp only [Set.mem_setOf_eq, Set.mem_iUnion, Set.mem_inter_iff, exists_eq_right']
  rw [this]
  

Proof state:
α✝ : Type u_1
G : Type u_2
α : Type u_3
inst✝⁴ : MeasurableSpace G
inst✝³ : Div G
m✝ : MeasurableSpace α
f✝ g✝ : α → G
μ : Measure α
m : MeasurableSpace α
E : Type u_4
inst✝² : MeasurableSpace E
inst✝¹ : MeasurableSingletonClass E
inst✝ : Countable E
f g : α → E
hf : Measurable f
hg : Measurable g
this : {x | f x = g x} = ⋃ j, {x | f x = j} ∩ {x | g x = j}
⊢ MeasurableSet (⋃ j, {x | f x = j} ∩ {x | g x = j})

Next tactic:
refine' MeasurableSet.iUnion fun j => MeasurableSet.inter _ _
theorem measurableSet_eq_fun_of_countable {m : MeasurableSpace α} {E} [MeasurableSpace E]
    [MeasurableSingletonClass E] [Countable E] {f g : α → E} (hf : Measurable f)
    (hg : Measurable g) : MeasurableSet { x | f x = g x } := by
  have : { x | f x = g x } = ⋃ j, { x | f x = j } ∩ { x | g x = j } := by
    ext1 x
    simp only [Set.mem_setOf_eq, Set.mem_iUnion, Set.mem_inter_iff, exists_eq_right']
  rw [this]
  refine' MeasurableSet.iUnion fun j => MeasurableSet.inter _ _
  · 

Proof state:
case refine'_1
α✝ : Type u_1
G : Type u_2
α : Type u_3
inst✝⁴ : MeasurableSpace G
inst✝³ : Div G
m✝ : MeasurableSpace α
f✝ g✝ : α → G
μ : Measure α
m : MeasurableSpace α
E : Type u_4
inst✝² : MeasurableSpace E
inst✝¹ : MeasurableSingletonClass E
inst✝ : Countable E
f g : α → E
hf : Measurable f
hg : Measurable g
this : {x | f x = g x} = ⋃ j, {x | f x = j} ∩ {x | g x = j}
j : E
⊢ MeasurableSet {x | f x = j}

Next tactic:
exact hf (measurableSet_singleton j)
theorem measurableSet_eq_fun_of_countable {m : MeasurableSpace α} {E} [MeasurableSpace E]
    [MeasurableSingletonClass E] [Countable E] {f g : α → E} (hf : Measurable f)
    (hg : Measurable g) : MeasurableSet { x | f x = g x } := by
  have : { x | f x = g x } = ⋃ j, { x | f x = j } ∩ { x | g x = j } := by
    ext1 x
    simp only [Set.mem_setOf_eq, Set.mem_iUnion, Set.mem_inter_iff, exists_eq_right']
  rw [this]
  refine' MeasurableSet.iUnion fun j => MeasurableSet.inter _ _
  · exact hf (measurableSet_singleton j)
  · 

Proof state:
case refine'_2
α✝ : Type u_1
G : Type u_2
α : Type u_3
inst✝⁴ : MeasurableSpace G
inst✝³ : Div G
m✝ : MeasurableSpace α
f✝ g✝ : α → G
μ : Measure α
m : MeasurableSpace α
E : Type u_4
inst✝² : MeasurableSpace E
inst✝¹ : MeasurableSingletonClass E
inst✝ : Countable E
f g : α → E
hf : Measurable f
hg : Measurable g
this : {x | f x = g x} = ⋃ j, {x | f x = j} ∩ {x | g x = j}
j : E
⊢ MeasurableSet {x | g x = j}

Next tactic:
exact hg (measurableSet_singleton j)
theorem ae_eq_trim_of_measurable {α E} {m m0 : MeasurableSpace α} {μ : Measure α}
    [MeasurableSpace E] [AddGroup E] [MeasurableSingletonClass E] [MeasurableSub₂ E]
    (hm : m ≤ m0) {f g : α → E} (hf : Measurable[m] f) (hg : Measurable[m] g) (hfg : f =ᵐ[μ] g) :
    f =ᶠ[@Measure.ae α m (μ.trim hm)] g := by
  

Proof state:
α✝¹ : Type u_1
G : Type u_2
α✝ : Type u_3
inst✝⁵ : MeasurableSpace G
inst✝⁴ : Div G
m✝ : MeasurableSpace α✝
f✝ g✝ : α✝ → G
μ✝ : Measure α✝
α : Type u_4
E : Type u_5
m m0 : MeasurableSpace α
μ : Measure α
inst✝³ : MeasurableSpace E
inst✝² : AddGroup E
inst✝¹ : MeasurableSingletonClass E
inst✝ : MeasurableSub₂ E
hm : m ≤ m0
f g : α → E
hf : Measurable f
hg : Measurable g
hfg : f =ᵐ[μ] g
⊢ f =ᵐ[Measure.trim μ hm] g

Next tactic:
rwa [Filter.EventuallyEq, @ae_iff _ m, trim_measurableSet_eq hm _]
theorem ae_eq_trim_of_measurable {α E} {m m0 : MeasurableSpace α} {μ : Measure α}
    [MeasurableSpace E] [AddGroup E] [MeasurableSingletonClass E] [MeasurableSub₂ E]
    (hm : m ≤ m0) {f g : α → E} (hf : Measurable[m] f) (hg : Measurable[m] g) (hfg : f =ᵐ[μ] g) :
    f =ᶠ[@Measure.ae α m (μ.trim hm)] g := by
  rwa [Filter.EventuallyEq, @ae_iff _ m, trim_measurableSet_eq hm _]
  

Proof state:
α✝¹ : Type u_1
G : Type u_2
α✝ : Type u_3
inst✝⁵ : MeasurableSpace G
inst✝⁴ : Div G
m✝ : MeasurableSpace α✝
f✝ g✝ : α✝ → G
μ✝ : Measure α✝
α : Type u_4
E : Type u_5
m m0 : MeasurableSpace α
μ : Measure α
inst✝³ : MeasurableSpace E
inst✝² : AddGroup E
inst✝¹ : MeasurableSingletonClass E
inst✝ : MeasurableSub₂ E
hm : m ≤ m0
f g : α → E
hf : Measurable f
hg : Measurable g
hfg : f =ᵐ[μ] g
⊢ MeasurableSet {a | ¬f a = g a}

Next tactic:
exact @MeasurableSet.compl α _ m (@measurableSet_eq_fun α m E _ _ _ _ _ _ hf hg)
@[to_additive]
instance (priority := 100) measurableDiv_of_mul_inv (G : Type*) [MeasurableSpace G]
    [DivInvMonoid G] [MeasurableMul G] [MeasurableInv G] : MeasurableDiv G where
  measurable_const_div c := by
    

Proof state:
α : Type u_1
G : Type u_2
inst✝³ : MeasurableSpace G
inst✝² : DivInvMonoid G
inst✝¹ : MeasurableMul G
inst✝ : MeasurableInv G
c : G
⊢ Measurable fun x => c / x

Next tactic:
convert measurable_inv.const_mul c using 1
@[to_additive]
instance (priority := 100) measurableDiv_of_mul_inv (G : Type*) [MeasurableSpace G]
    [DivInvMonoid G] [MeasurableMul G] [MeasurableInv G] : MeasurableDiv G where
  measurable_const_div c := by
    convert measurable_inv.const_mul c using 1
    

Proof state:
case h.e'_5
α : Type u_1
G : Type u_2
inst✝³ : MeasurableSpace G
inst✝² : DivInvMonoid G
inst✝¹ : MeasurableMul G
inst✝ : MeasurableInv G
c : G
⊢ (fun x => c / x) = fun x => c * x⁻¹

Next tactic:
ext1
@[to_additive]
instance (priority := 100) measurableDiv_of_mul_inv (G : Type*) [MeasurableSpace G]
    [DivInvMonoid G] [MeasurableMul G] [MeasurableInv G] : MeasurableDiv G where
  measurable_const_div c := by
    convert measurable_inv.const_mul c using 1
    ext1
    

Proof state:
case h.e'_5.h
α : Type u_1
G : Type u_2
inst✝³ : MeasurableSpace G
inst✝² : DivInvMonoid G
inst✝¹ : MeasurableMul G
inst✝ : MeasurableInv G
c x✝ : G
⊢ c / x✝ = c * x✝⁻¹

Next tactic:
apply div_eq_mul_inv