Theorem: MeasurableSpace.measurableEquiv_nat_bool_of_countablyGenerated
File: Mathlib/MeasureTheory/MeasurableSpace/CountablyGenerated.lean

tactic: use range (mapNatBool α), Equiv.ofInjective _ $
  injective_mapNatBool _,
  Measurable.subtype_mk $ measurable_mapNatBool _
state_before: α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : CountablyGenerated α
inst✝ : SeparatesPoints α
⊢ ∃ s, Nonempty (α ≃ᵐ ↑s)
state_after: case measurable_invFun
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : CountablyGenerated α
inst✝ : SeparatesPoints α
⊢ Measurable ⇑(Equiv.ofInjective (mapNatBool α) ⋯).symm

tactic: apply measurable_generateFrom
state_before: case measurable_invFun
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : CountablyGenerated α
inst✝ : SeparatesPoints α
⊢ Measurable ⇑(Equiv.ofInjective (mapNatBool α) ⋯).symm
state_after: case measurable_invFun.h
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : CountablyGenerated α
inst✝ : SeparatesPoints α
⊢ ∀ t ∈ range (natGeneratingSequence α), MeasurableSet (⇑(Equiv.ofInjective (mapNatBool α) ⋯).symm ⁻¹' t)

tactic: rintro _ ⟨n, rfl⟩
state_before: case measurable_invFun.h
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : CountablyGenerated α
inst✝ : SeparatesPoints α
⊢ ∀ t ∈ range (natGeneratingSequence α), MeasurableSet (⇑(Equiv.ofInjective (mapNatBool α) ⋯).symm ⁻¹' t)
state_after: case measurable_invFun.h.intro
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : CountablyGenerated α
inst✝ : SeparatesPoints α
n : ℕ
⊢ MeasurableSet (⇑(Equiv.ofInjective (mapNatBool α) ⋯).symm ⁻¹' natGeneratingSequence α n)

tactic: rw [← Equiv.image_eq_preimage _ _]
state_before: case measurable_invFun.h.intro
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : CountablyGenerated α
inst✝ : SeparatesPoints α
n : ℕ
⊢ MeasurableSet (⇑(Equiv.ofInjective (mapNatBool α) ⋯).symm ⁻¹' natGeneratingSequence α n)
state_after: case measurable_invFun.h.intro
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : CountablyGenerated α
inst✝ : SeparatesPoints α
n : ℕ
⊢ MeasurableSet (⇑(Equiv.ofInjective (mapNatBool α) ⋯) '' natGeneratingSequence α n)

tactic: refine ⟨{y | y n}, by measurability, ?_⟩
state_before: case measurable_invFun.h.intro
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : CountablyGenerated α
inst✝ : SeparatesPoints α
n : ℕ
⊢ MeasurableSet (⇑(Equiv.ofInjective (mapNatBool α) ⋯) '' natGeneratingSequence α n)
state_after: case measurable_invFun.h.intro
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : CountablyGenerated α
inst✝ : SeparatesPoints α
n : ℕ
⊢ Subtype.val ⁻¹' {y | y n = true} = ⇑(Equiv.ofInjective (mapNatBool α) ⋯) '' natGeneratingSequence α n

tactic: rw [← Equiv.preimage_eq_iff_eq_image]
state_before: case measurable_invFun.h.intro
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : CountablyGenerated α
inst✝ : SeparatesPoints α
n : ℕ
⊢ Subtype.val ⁻¹' {y | y n = true} = ⇑(Equiv.ofInjective (mapNatBool α) ⋯) '' natGeneratingSequence α n
state_after: case measurable_invFun.h.intro
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : CountablyGenerated α
inst✝ : SeparatesPoints α
n : ℕ
⊢ ⇑(Equiv.ofInjective (mapNatBool α) ⋯) ⁻¹' (Subtype.val ⁻¹' {y | y n = true}) = natGeneratingSequence α n

tactic: simp [mapNatBool]
state_before: case measurable_invFun.h.intro
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : CountablyGenerated α
inst✝ : SeparatesPoints α
n : ℕ
⊢ ⇑(Equiv.ofInjective (mapNatBool α) ⋯) ⁻¹' (Subtype.val ⁻¹' {y | y n = true}) = natGeneratingSequence α n
state_after: no goals

tactic: measurability
state_before: α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : CountablyGenerated α
inst✝ : SeparatesPoints α
n : ℕ
⊢ MeasurableSet {y | y n = true}
state_after: no goals