Theorem: measurableSet_eq_fun_of_countable
File: Mathlib/MeasureTheory/Group/Arithmetic.lean

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']
state_before: G : Type ?u.2100312
α : Type u_1
inst✝⁴ : MeasurableSpace G
inst✝³ : Div G
m✝ : MeasurableSpace α
f✝ g✝ : α → G
μ : MeasureTheory.Measure α
m : MeasurableSpace α
E : Type u_2
inst✝² : MeasurableSpace E
inst✝¹ : MeasurableSingletonClass E
inst✝ : Countable E
f g : α → E
hf : Measurable f
hg : Measurable g
⊢ MeasurableSet {x | f x = g x}

tactic: rw [this]
state_before: G : Type ?u.2100312
α : Type u_1
inst✝⁴ : MeasurableSpace G
inst✝³ : Div G
m✝ : MeasurableSpace α
f✝ g✝ : α → G
μ : MeasureTheory.Measure α
m : MeasurableSpace α
E : Type u_2
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 : E), {x | f x = j} ∩ {x | g x = j}
⊢ MeasurableSet {x | f x = g x}

tactic: refine' MeasurableSet.iUnion fun j => MeasurableSet.inter _ _
state_before: G : Type ?u.2100312
α : Type u_1
inst✝⁴ : MeasurableSpace G
inst✝³ : Div G
m✝ : MeasurableSpace α
f✝ g✝ : α → G
μ : MeasureTheory.Measure α
m : MeasurableSpace α
E : Type u_2
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 : E), {x | f x = j} ∩ {x | g x = j}
⊢ MeasurableSet (⋃ (j : E), {x | f x = j} ∩ {x | g x = j})

tactic: ext1 x
state_before: G : Type ?u.2100312
α : Type u_1
inst✝⁴ : MeasurableSpace G
inst✝³ : Div G
m✝ : MeasurableSpace α
f✝ g✝ : α → G
μ : MeasureTheory.Measure α
m : MeasurableSpace α
E : Type u_2
inst✝² : MeasurableSpace E
inst✝¹ : MeasurableSingletonClass E
inst✝ : Countable E
f g : α → E
hf : Measurable f
hg : Measurable g
⊢ {x | f x = g x} = ⋃ (j : E), {x | f x = j} ∩ {x | g x = j}

tactic: simp only [Set.mem_setOf_eq, Set.mem_iUnion, Set.mem_inter_iff, exists_eq_right']
state_before: case h
G : Type ?u.2100312
α : Type u_1
inst✝⁴ : MeasurableSpace G
inst✝³ : Div G
m✝ : MeasurableSpace α
f✝ g✝ : α → G
μ : MeasureTheory.Measure α
m : MeasurableSpace α
E : Type u_2
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 : E), {x | f x = j} ∩ {x | g x = j}

tactic: exact hf (measurableSet_singleton j)
state_before: case refine'_1
G : Type ?u.2100312
α : Type u_1
inst✝⁴ : MeasurableSpace G
inst✝³ : Div G
m✝ : MeasurableSpace α
f✝ g✝ : α → G
μ : MeasureTheory.Measure α
m : MeasurableSpace α
E : Type u_2
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 : E), {x | f x = j} ∩ {x | g x = j}
j : E
⊢ MeasurableSet {x | f x = j}

tactic: exact hg (measurableSet_singleton j)
state_before: case refine'_2
G : Type ?u.2100312
α : Type u_1
inst✝⁴ : MeasurableSpace G
inst✝³ : Div G
m✝ : MeasurableSpace α
f✝ g✝ : α → G
μ : MeasureTheory.Measure α
m : MeasurableSpace α
E : Type u_2
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 : E), {x | f x = j} ∩ {x | g x = j}
j : E
⊢ MeasurableSet {x | g x = j}