Theorem: MeasurableSpace.measurable_injection_nat_bool_of_countablyGenerated
File: Mathlib/MeasureTheory/MeasurableSpace.lean

tactic: obtain ⟨b, bct, hb⟩ := h.IsCountablyGenerated
state_before: α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
⊢ ∃ f, Measurable f ∧ Injective f

tactic: obtain ⟨e, he⟩ := Set.Countable.exists_eq_range (bct.insert ∅) (insert_nonempty _ _)
state_before: case intro.intro
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb : inst✝¹ = generateFrom b
⊢ ∃ f, Measurable f ∧ Injective f

tactic: rw [← generateFrom_insert_empty, he] at hb
state_before: case intro.intro.intro
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb : inst✝¹ = generateFrom b
e : ℕ → Set α
he : insert ∅ b = range e
⊢ ∃ f, Measurable f ∧ Injective f

tactic: refine' ⟨fun x n => x ∈ e n, _, _⟩
state_before: case intro.intro.intro
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
⊢ ∃ f, Measurable f ∧ Injective f

tactic: . rw [measurable_pi_iff]
  intro n
  apply measurable_to_bool
  simp only [preimage, mem_singleton_iff, Bool.decide_iff]
  rw [hb]
  apply measurableSet_generateFrom
  exact ⟨n, rfl⟩
state_before: case intro.intro.intro.refine'_1
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
⊢ Measurable fun x n => decide (x ∈ e n)

case intro.intro.intro.refine'_2
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
⊢ Injective fun x n => decide (x ∈ e n)

tactic: intro x y hxy
state_before: case intro.intro.intro.refine'_2
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
⊢ Injective fun x n => decide (x ∈ e n)

tactic: specialize this {y} measurableSet_eq
state_before: case intro.intro.intro.refine'_2
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
x y : α
hxy : (fun x n => decide (x ∈ e n)) x = (fun x n => decide (x ∈ e n)) y
this : ∀ (s : Set α), MeasurableSet s → (x ∈ s ↔ y ∈ s)
⊢ x = y

tactic: simp only [mem_singleton, iff_true_iff] at this
state_before: case intro.intro.intro.refine'_2
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
x y : α
hxy : (fun x n => decide (x ∈ e n)) x = (fun x n => decide (x ∈ e n)) y
this : x ∈ {y} ↔ y ∈ {y}
⊢ x = y

tactic: exact this
state_before: case intro.intro.intro.refine'_2
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
x y : α
hxy : (fun x n => decide (x ∈ e n)) x = (fun x n => decide (x ∈ e n)) y
this : x ∈ {y}
⊢ x = y

tactic: rw [measurable_pi_iff]
state_before: case intro.intro.intro.refine'_1
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
⊢ Measurable fun x n => decide (x ∈ e n)

tactic: intro n
state_before: case intro.intro.intro.refine'_1
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
⊢ ∀ (a : ℕ), Measurable fun x => decide (x ∈ e a)

tactic: apply measurable_to_bool
state_before: case intro.intro.intro.refine'_1
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
n : ℕ
⊢ Measurable fun x => decide (x ∈ e n)

tactic: simp only [preimage, mem_singleton_iff, Bool.decide_iff]
state_before: case intro.intro.intro.refine'_1.h
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
n : ℕ
⊢ MeasurableSet ((fun x => decide (x ∈ e n)) ⁻¹' {true})

tactic: rw [hb]
state_before: case intro.intro.intro.refine'_1.h
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
n : ℕ
⊢ MeasurableSet {x | x ∈ e n}

tactic: apply measurableSet_generateFrom
state_before: case intro.intro.intro.refine'_1.h
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
n : ℕ
⊢ MeasurableSet {x | x ∈ e n}

tactic: exact ⟨n, rfl⟩
state_before: case intro.intro.intro.refine'_1.h.ht
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
n : ℕ
⊢ {x | x ∈ e n} ∈ range e

tactic: rw [hb]
state_before: α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s✝ t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
x y : α
hxy : (fun x n => decide (x ∈ e n)) x = (fun x n => decide (x ∈ e n)) y
s : Set α
⊢ MeasurableSet s → (x ∈ s ↔ y ∈ s)

tactic: apply generateFrom_induction
state_before: α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s✝ t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
x y : α
hxy : (fun x n => decide (x ∈ e n)) x = (fun x n => decide (x ∈ e n)) y
s : Set α
⊢ MeasurableSet s → (x ∈ s ↔ y ∈ s)

tactic: intro t ht
state_before: case h_Union
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s✝ t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
x y : α
hxy : (fun x n => decide (x ∈ e n)) x = (fun x n => decide (x ∈ e n)) y
s : Set α
⊢ ∀ (f : ℕ → Set α), (∀ (n : ℕ), x ∈ f n ↔ y ∈ f n) → ((x ∈ ⋃ (i : ℕ), f i) ↔ y ∈ ⋃ (i : ℕ), f i)

tactic: simp_rw [mem_iUnion, ht]
state_before: case h_Union
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s✝ t✝ u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
x y : α
hxy : (fun x n => decide (x ∈ e n)) x = (fun x n => decide (x ∈ e n)) y
s : Set α
t : ℕ → Set α
ht : ∀ (n : ℕ), x ∈ t n ↔ y ∈ t n
⊢ (x ∈ ⋃ (i : ℕ), t i) ↔ y ∈ ⋃ (i : ℕ), t i

tactic: rintro - ⟨n, rfl⟩
state_before: case hC
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s✝ t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
x y : α
hxy : (fun x n => decide (x ∈ e n)) x = (fun x n => decide (x ∈ e n)) y
s : Set α
⊢ ∀ (t : Set α), t ∈ range e → (x ∈ t ↔ y ∈ t)

tactic: rw [← decide_eq_decide]
state_before: case hC.intro
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s✝ t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
x y : α
hxy : (fun x n => decide (x ∈ e n)) x = (fun x n => decide (x ∈ e n)) y
s : Set α
n : ℕ
⊢ x ∈ e n ↔ y ∈ e n

tactic: rw [funext_iff] at hxy
state_before: case hC.intro
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s✝ t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
x y : α
hxy : (fun x n => decide (x ∈ e n)) x = (fun x n => decide (x ∈ e n)) y
s : Set α
n : ℕ
⊢ decide (x ∈ e n) = decide (y ∈ e n)

tactic: exact hxy n
state_before: case hC.intro
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s✝ t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
x y : α
hxy : ∀ (a : ℕ), (fun x n => decide (x ∈ e n)) x a = (fun x n => decide (x ∈ e n)) y a
s : Set α
n : ℕ
⊢ decide (x ∈ e n) = decide (y ∈ e n)

tactic: tauto
state_before: case h_empty
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s✝ t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
x y : α
hxy : (fun x n => decide (x ∈ e n)) x = (fun x n => decide (x ∈ e n)) y
s : Set α
⊢ x ∈ ∅ ↔ y ∈ ∅

tactic: intro t
state_before: case h_compl
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s✝ t u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
x y : α
hxy : (fun x n => decide (x ∈ e n)) x = (fun x n => decide (x ∈ e n)) y
s : Set α
⊢ ∀ (t : Set α), (x ∈ t ↔ y ∈ t) → (x ∈ tᶜ ↔ y ∈ tᶜ)

tactic: tauto
state_before: case h_compl
α : Type u_1
β : Type ?u.887190
γ : Type ?u.887193
δ : Type ?u.887196
δ' : Type ?u.887199
ι : Sort uι
s✝ t✝ u : Set α
inst✝¹ : MeasurableSpace α
h : CountablyGenerated α
inst✝ : MeasurableSingletonClass α
b : Set (Set α)
bct : Set.Countable b
hb✝ : inst✝¹ = generateFrom b
e : ℕ → Set α
hb : inst✝¹ = generateFrom (range e)
he : insert ∅ b = range e
x y : α
hxy : (fun x n => decide (x ∈ e n)) x = (fun x n => decide (x ∈ e n)) y
s t : Set α
⊢ (x ∈ t ↔ y ∈ t) → (x ∈ tᶜ ↔ y ∈ tᶜ)