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: α✝ : 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}
state_after: α✝ : 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}

tactic: rw [this]
state_before: α✝ : 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}
state_after: α✝ : 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})

tactic: refine MeasurableSet.iUnion fun j => MeasurableSet.inter ?_ ?_
state_before: α✝ : 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})
state_after: 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}

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}

tactic: ext1 x
state_before: α✝ : 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}
state_after: 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}

tactic: simp only [Set.mem_setOf_eq, Set.mem_iUnion, Set.mem_inter_iff, exists_eq_right']
state_before: 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}
state_after: no goals

tactic: exact hf (measurableSet_singleton j)
state_before: 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}
state_after: no goals

tactic: exact hg (measurableSet_singleton j)
state_before: 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}
state_after: no goals