l3lab/ntp-mathlib huggingface dataset:
/-- `generateMeasurableRec s` generates precisely the smallest sigma-algebra containing `s`. -/
theorem generateMeasurable_eq_rec (s : Set (Set α)) :
    { t | GenerateMeasurable s t } =
        ⋃ (i : (Quotient.out (aleph 1).ord).α), generateMeasurableRec s i := by
  ext t; refine' ⟨fun ht => _, fun ht => _⟩
  · inhabit ω₁
    induction' ht with u hu u _ IH f _ IH
    · exact mem_iUnion.2 ⟨default, self_subset_generateMeasurableRec s _ hu⟩
    · exact mem_iUnion.2 ⟨default, empty_mem_generateMeasurableRec s _⟩
    · rcases mem_iUnion.1 IH with ⟨i, hi⟩
      obtain ⟨j, hj⟩ := exists_gt i
      exact mem_iUnion.2 ⟨j, compl_mem_generateMeasurableRec hj hi⟩
    · have : ∀ n, ∃ i, f n ∈ generateMeasurableRec s i := fun n => by simpa using IH n
      choose I hI using this
      have : IsWellOrder (ω₁ : Type u) (· < ·) := isWellOrder_out_lt _
      

Proof state:
case h.refine'_1.iUnion
α : Type u
s : Set (Set α)
t : Set α
inhabited_h : Inhabited (Quotient.out (ord (aleph 1))).α
f : ℕ → Set α
a✝ : ∀ (n : ℕ), GenerateMeasurable s (f n)
IH : ∀ (n : ℕ), f n ∈ ⋃ i, generateMeasurableRec s i
I : ℕ → (Quotient.out (ord (aleph 1))).α
hI : ∀ (n : ℕ), f n ∈ generateMeasurableRec s (I n)
this : IsWellOrder (Quotient.out (ord (aleph 1))).α fun x x_1 => x < x_1
⊢ ⋃ i, f i ∈ ⋃ i, generateMeasurableRec s i

Next tactic:
refine' mem_iUnion.2
        ⟨Ordinal.enum (· < ·) (Ordinal.lsub fun n => Ordinal.typein.{u} (· < ·) (I n)) _,
          iUnion_mem_generateMeasurableRec fun n => ⟨I n, _, hI n⟩⟩
/-- `generateMeasurableRec s` generates precisely the smallest sigma-algebra containing `s`. -/
theorem generateMeasurable_eq_rec (s : Set (Set α)) :
    { t | GenerateMeasurable s t } =
        ⋃ (i : (Quotient.out (aleph 1).ord).α), generateMeasurableRec s i := by
  ext t; refine' ⟨fun ht => _, fun ht => _⟩
  · inhabit ω₁
    induction' ht with u hu u _ IH f _ IH
    · exact mem_iUnion.2 ⟨default, self_subset_generateMeasurableRec s _ hu⟩
    · exact mem_iUnion.2 ⟨default, empty_mem_generateMeasurableRec s _⟩
    · rcases mem_iUnion.1 IH with ⟨i, hi⟩
      obtain ⟨j, hj⟩ := exists_gt i
      exact mem_iUnion.2 ⟨j, compl_mem_generateMeasurableRec hj hi⟩
    · have : ∀ n, ∃ i, f n ∈ generateMeasurableRec s i := fun n => by simpa using IH n
      choose I hI using this
      have : IsWellOrder (ω₁ : Type u) (· < ·) := isWellOrder_out_lt _
      refine' mem_iUnion.2
        ⟨Ordinal.enum (· < ·) (Ordinal.lsub fun n => Ordinal.typein.{u} (· < ·) (I n)) _,
          iUnion_mem_generateMeasurableRec fun n => ⟨I n, _, hI n⟩⟩
      · 

Proof state:
case h.refine'_1.iUnion.refine'_1
α : Type u
s : Set (Set α)
t : Set α
inhabited_h : Inhabited (Quotient.out (ord (aleph 1))).α
f : ℕ → Set α
a✝ : ∀ (n : ℕ), GenerateMeasurable s (f n)
IH : ∀ (n : ℕ), f n ∈ ⋃ i, generateMeasurableRec s i
I : ℕ → (Quotient.out (ord (aleph 1))).α
hI : ∀ (n : ℕ), f n ∈ generateMeasurableRec s (I n)
this : IsWellOrder (Quotient.out (ord (aleph 1))).α fun x x_1 => x < x_1
⊢ (Ordinal.lsub fun n => Ordinal.typein (fun x x_1 => x < x_1) (I n)) < Ordinal.type fun x x_1 => x < x_1

Next tactic:
rw [Ordinal.type_lt]
/-- `generateMeasurableRec s` generates precisely the smallest sigma-algebra containing `s`. -/
theorem generateMeasurable_eq_rec (s : Set (Set α)) :
    { t | GenerateMeasurable s t } =
        ⋃ (i : (Quotient.out (aleph 1).ord).α), generateMeasurableRec s i := by
  ext t; refine' ⟨fun ht => _, fun ht => _⟩
  · inhabit ω₁
    induction' ht with u hu u _ IH f _ IH
    · exact mem_iUnion.2 ⟨default, self_subset_generateMeasurableRec s _ hu⟩
    · exact mem_iUnion.2 ⟨default, empty_mem_generateMeasurableRec s _⟩
    · rcases mem_iUnion.1 IH with ⟨i, hi⟩
      obtain ⟨j, hj⟩ := exists_gt i
      exact mem_iUnion.2 ⟨j, compl_mem_generateMeasurableRec hj hi⟩
    · have : ∀ n, ∃ i, f n ∈ generateMeasurableRec s i := fun n => by simpa using IH n
      choose I hI using this
      have : IsWellOrder (ω₁ : Type u) (· < ·) := isWellOrder_out_lt _
      refine' mem_iUnion.2
        ⟨Ordinal.enum (· < ·) (Ordinal.lsub fun n => Ordinal.typein.{u} (· < ·) (I n)) _,
          iUnion_mem_generateMeasurableRec fun n => ⟨I n, _, hI n⟩⟩
      · rw [Ordinal.type_lt]
        

Proof state:
case h.refine'_1.iUnion.refine'_1
α : Type u
s : Set (Set α)
t : Set α
inhabited_h : Inhabited (Quotient.out (ord (aleph 1))).α
f : ℕ → Set α
a✝ : ∀ (n : ℕ), GenerateMeasurable s (f n)
IH : ∀ (n : ℕ), f n ∈ ⋃ i, generateMeasurableRec s i
I : ℕ → (Quotient.out (ord (aleph 1))).α
hI : ∀ (n : ℕ), f n ∈ generateMeasurableRec s (I n)
this : IsWellOrder (Quotient.out (ord (aleph 1))).α fun x x_1 => x < x_1
⊢ (Ordinal.lsub fun n => Ordinal.typein (fun x x_1 => x < x_1) (I n)) < ord (aleph 1)

Next tactic:
refine' Ordinal.lsub_lt_ord_lift _ fun i => Ordinal.typein_lt_self _
/-- `generateMeasurableRec s` generates precisely the smallest sigma-algebra containing `s`. -/
theorem generateMeasurable_eq_rec (s : Set (Set α)) :
    { t | GenerateMeasurable s t } =
        ⋃ (i : (Quotient.out (aleph 1).ord).α), generateMeasurableRec s i := by
  ext t; refine' ⟨fun ht => _, fun ht => _⟩
  · inhabit ω₁
    induction' ht with u hu u _ IH f _ IH
    · exact mem_iUnion.2 ⟨default, self_subset_generateMeasurableRec s _ hu⟩
    · exact mem_iUnion.2 ⟨default, empty_mem_generateMeasurableRec s _⟩
    · rcases mem_iUnion.1 IH with ⟨i, hi⟩
      obtain ⟨j, hj⟩ := exists_gt i
      exact mem_iUnion.2 ⟨j, compl_mem_generateMeasurableRec hj hi⟩
    · have : ∀ n, ∃ i, f n ∈ generateMeasurableRec s i := fun n => by simpa using IH n
      choose I hI using this
      have : IsWellOrder (ω₁ : Type u) (· < ·) := isWellOrder_out_lt _
      refine' mem_iUnion.2
        ⟨Ordinal.enum (· < ·) (Ordinal.lsub fun n => Ordinal.typein.{u} (· < ·) (I n)) _,
          iUnion_mem_generateMeasurableRec fun n => ⟨I n, _, hI n⟩⟩
      · rw [Ordinal.type_lt]
        refine' Ordinal.lsub_lt_ord_lift _ fun i => Ordinal.typein_lt_self _
        

Proof state:
case h.refine'_1.iUnion.refine'_1
α : Type u
s : Set (Set α)
t : Set α
inhabited_h : Inhabited (Quotient.out (ord (aleph 1))).α
f : ℕ → Set α
a✝ : ∀ (n : ℕ), GenerateMeasurable s (f n)
IH : ∀ (n : ℕ), f n ∈ ⋃ i, generateMeasurableRec s i
I : ℕ → (Quotient.out (ord (aleph 1))).α
hI : ∀ (n : ℕ), f n ∈ generateMeasurableRec s (I n)
this : IsWellOrder (Quotient.out (ord (aleph 1))).α fun x x_1 => x < x_1
⊢ lift.{u, 0} #ℕ < Ordinal.cof (ord (aleph 1))

Next tactic:
rw [mk_denumerable, lift_aleph0, isRegular_aleph_one.cof_eq]
/-- `generateMeasurableRec s` generates precisely the smallest sigma-algebra containing `s`. -/
theorem generateMeasurable_eq_rec (s : Set (Set α)) :
    { t | GenerateMeasurable s t } =
        ⋃ (i : (Quotient.out (aleph 1).ord).α), generateMeasurableRec s i := by
  ext t; refine' ⟨fun ht => _, fun ht => _⟩
  · inhabit ω₁
    induction' ht with u hu u _ IH f _ IH
    · exact mem_iUnion.2 ⟨default, self_subset_generateMeasurableRec s _ hu⟩
    · exact mem_iUnion.2 ⟨default, empty_mem_generateMeasurableRec s _⟩
    · rcases mem_iUnion.1 IH with ⟨i, hi⟩
      obtain ⟨j, hj⟩ := exists_gt i
      exact mem_iUnion.2 ⟨j, compl_mem_generateMeasurableRec hj hi⟩
    · have : ∀ n, ∃ i, f n ∈ generateMeasurableRec s i := fun n => by simpa using IH n
      choose I hI using this
      have : IsWellOrder (ω₁ : Type u) (· < ·) := isWellOrder_out_lt _
      refine' mem_iUnion.2
        ⟨Ordinal.enum (· < ·) (Ordinal.lsub fun n => Ordinal.typein.{u} (· < ·) (I n)) _,
          iUnion_mem_generateMeasurableRec fun n => ⟨I n, _, hI n⟩⟩
      · rw [Ordinal.type_lt]
        refine' Ordinal.lsub_lt_ord_lift _ fun i => Ordinal.typein_lt_self _
        rw [mk_denumerable, lift_aleph0, isRegular_aleph_one.cof_eq]
        

Proof state:
case h.refine'_1.iUnion.refine'_1
α : Type u
s : Set (Set α)
t : Set α
inhabited_h : Inhabited (Quotient.out (ord (aleph 1))).α
f : ℕ → Set α
a✝ : ∀ (n : ℕ), GenerateMeasurable s (f n)
IH : ∀ (n : ℕ), f n ∈ ⋃ i, generateMeasurableRec s i
I : ℕ → (Quotient.out (ord (aleph 1))).α
hI : ∀ (n : ℕ), f n ∈ generateMeasurableRec s (I n)
this : IsWellOrder (Quotient.out (ord (aleph 1))).α fun x x_1 => x < x_1
⊢ ℵ₀ < aleph 1

Next tactic:
exact aleph0_lt_aleph_one
/-- `generateMeasurableRec s` generates precisely the smallest sigma-algebra containing `s`. -/
theorem generateMeasurable_eq_rec (s : Set (Set α)) :
    { t | GenerateMeasurable s t } =
        ⋃ (i : (Quotient.out (aleph 1).ord).α), generateMeasurableRec s i := by
  ext t; refine' ⟨fun ht => _, fun ht => _⟩
  · inhabit ω₁
    induction' ht with u hu u _ IH f _ IH
    · exact mem_iUnion.2 ⟨default, self_subset_generateMeasurableRec s _ hu⟩
    · exact mem_iUnion.2 ⟨default, empty_mem_generateMeasurableRec s _⟩
    · rcases mem_iUnion.1 IH with ⟨i, hi⟩
      obtain ⟨j, hj⟩ := exists_gt i
      exact mem_iUnion.2 ⟨j, compl_mem_generateMeasurableRec hj hi⟩
    · have : ∀ n, ∃ i, f n ∈ generateMeasurableRec s i := fun n => by simpa using IH n
      choose I hI using this
      have : IsWellOrder (ω₁ : Type u) (· < ·) := isWellOrder_out_lt _
      refine' mem_iUnion.2
        ⟨Ordinal.enum (· < ·) (Ordinal.lsub fun n => Ordinal.typein.{u} (· < ·) (I n)) _,
          iUnion_mem_generateMeasurableRec fun n => ⟨I n, _, hI n⟩⟩
      · rw [Ordinal.type_lt]
        refine' Ordinal.lsub_lt_ord_lift _ fun i => Ordinal.typein_lt_self _
        rw [mk_denumerable, lift_aleph0, isRegular_aleph_one.cof_eq]
        exact aleph0_lt_aleph_one
      · 

Proof state:
case h.refine'_1.iUnion.refine'_2
α : Type u
s : Set (Set α)
t : Set α
inhabited_h : Inhabited (Quotient.out (ord (aleph 1))).α
f : ℕ → Set α
a✝ : ∀ (n : ℕ), GenerateMeasurable s (f n)
IH : ∀ (n : ℕ), f n ∈ ⋃ i, generateMeasurableRec s i
I : ℕ → (Quotient.out (ord (aleph 1))).α
hI : ∀ (n : ℕ), f n ∈ generateMeasurableRec s (I n)
this : IsWellOrder (Quotient.out (ord (aleph 1))).α fun x x_1 => x < x_1
n : ℕ
⊢ I n <
    Ordinal.enum (fun x x_1 => x < x_1) (Ordinal.lsub fun n => Ordinal.typein (fun x x_1 => x < x_1) (I n))
      (_ : (Ordinal.lsub fun n => Ordinal.typein (fun x x_1 => x < x_1) (I n)) < Ordinal.type fun x x_1 => x < x_1)

Next tactic:
rw [← Ordinal.typein_lt_typein (· < ·), Ordinal.typein_enum]
/-- `generateMeasurableRec s` generates precisely the smallest sigma-algebra containing `s`. -/
theorem generateMeasurable_eq_rec (s : Set (Set α)) :
    { t | GenerateMeasurable s t } =
        ⋃ (i : (Quotient.out (aleph 1).ord).α), generateMeasurableRec s i := by
  ext t; refine' ⟨fun ht => _, fun ht => _⟩
  · inhabit ω₁
    induction' ht with u hu u _ IH f _ IH
    · exact mem_iUnion.2 ⟨default, self_subset_generateMeasurableRec s _ hu⟩
    · exact mem_iUnion.2 ⟨default, empty_mem_generateMeasurableRec s _⟩
    · rcases mem_iUnion.1 IH with ⟨i, hi⟩
      obtain ⟨j, hj⟩ := exists_gt i
      exact mem_iUnion.2 ⟨j, compl_mem_generateMeasurableRec hj hi⟩
    · have : ∀ n, ∃ i, f n ∈ generateMeasurableRec s i := fun n => by simpa using IH n
      choose I hI using this
      have : IsWellOrder (ω₁ : Type u) (· < ·) := isWellOrder_out_lt _
      refine' mem_iUnion.2
        ⟨Ordinal.enum (· < ·) (Ordinal.lsub fun n => Ordinal.typein.{u} (· < ·) (I n)) _,
          iUnion_mem_generateMeasurableRec fun n => ⟨I n, _, hI n⟩⟩
      · rw [Ordinal.type_lt]
        refine' Ordinal.lsub_lt_ord_lift _ fun i => Ordinal.typein_lt_self _
        rw [mk_denumerable, lift_aleph0, isRegular_aleph_one.cof_eq]
        exact aleph0_lt_aleph_one
      · rw [← Ordinal.typein_lt_typein (· < ·), Ordinal.typein_enum]
        

Proof state:
case h.refine'_1.iUnion.refine'_2
α : Type u
s : Set (Set α)
t : Set α
inhabited_h : Inhabited (Quotient.out (ord (aleph 1))).α
f : ℕ → Set α
a✝ : ∀ (n : ℕ), GenerateMeasurable s (f n)
IH : ∀ (n : ℕ), f n ∈ ⋃ i, generateMeasurableRec s i
I : ℕ → (Quotient.out (ord (aleph 1))).α
hI : ∀ (n : ℕ), f n ∈ generateMeasurableRec s (I n)
this : IsWellOrder (Quotient.out (ord (aleph 1))).α fun x x_1 => x < x_1
n : ℕ
⊢ Ordinal.typein (fun x x_1 => x < x_1) (I n) < Ordinal.lsub fun n => Ordinal.typein (fun x x_1 => x < x_1) (I n)

Next tactic:
apply Ordinal.lt_lsub fun n : ℕ => _
/-- `generateMeasurableRec s` generates precisely the smallest sigma-algebra containing `s`. -/
theorem generateMeasurable_eq_rec (s : Set (Set α)) :
    { t | GenerateMeasurable s t } =
        ⋃ (i : (Quotient.out (aleph 1).ord).α), generateMeasurableRec s i := by
  ext t; refine' ⟨fun ht => _, fun ht => _⟩
  · inhabit ω₁
    induction' ht with u hu u _ IH f _ IH
    · exact mem_iUnion.2 ⟨default, self_subset_generateMeasurableRec s _ hu⟩
    · exact mem_iUnion.2 ⟨default, empty_mem_generateMeasurableRec s _⟩
    · rcases mem_iUnion.1 IH with ⟨i, hi⟩
      obtain ⟨j, hj⟩ := exists_gt i
      exact mem_iUnion.2 ⟨j, compl_mem_generateMeasurableRec hj hi⟩
    · have : ∀ n, ∃ i, f n ∈ generateMeasurableRec s i := fun n => by simpa using IH n
      choose I hI using this
      have : IsWellOrder (ω₁ : Type u) (· < ·) := isWellOrder_out_lt _
      refine' mem_iUnion.2
        ⟨Ordinal.enum (· < ·) (Ordinal.lsub fun n => Ordinal.typein.{u} (· < ·) (I n)) _,
          iUnion_mem_generateMeasurableRec fun n => ⟨I n, _, hI n⟩⟩
      · rw [Ordinal.type_lt]
        refine' Ordinal.lsub_lt_ord_lift _ fun i => Ordinal.typein_lt_self _
        rw [mk_denumerable, lift_aleph0, isRegular_aleph_one.cof_eq]
        exact aleph0_lt_aleph_one
      · rw [← Ordinal.typein_lt_typein (· < ·), Ordinal.typein_enum]
        apply Ordinal.lt_lsub fun n : ℕ => _
  · 

Proof state:
case h.refine'_2
α : Type u
s : Set (Set α)
t : Set α
ht : t ∈ ⋃ i, generateMeasurableRec s i
⊢ t ∈ {t | GenerateMeasurable s t}

Next tactic:
rcases ht with ⟨t, ⟨i, rfl⟩, hx⟩
/-- `generateMeasurableRec s` generates precisely the smallest sigma-algebra containing `s`. -/
theorem generateMeasurable_eq_rec (s : Set (Set α)) :
    { t | GenerateMeasurable s t } =
        ⋃ (i : (Quotient.out (aleph 1).ord).α), generateMeasurableRec s i := by
  ext t; refine' ⟨fun ht => _, fun ht => _⟩
  · inhabit ω₁
    induction' ht with u hu u _ IH f _ IH
    · exact mem_iUnion.2 ⟨default, self_subset_generateMeasurableRec s _ hu⟩
    · exact mem_iUnion.2 ⟨default, empty_mem_generateMeasurableRec s _⟩
    · rcases mem_iUnion.1 IH with ⟨i, hi⟩
      obtain ⟨j, hj⟩ := exists_gt i
      exact mem_iUnion.2 ⟨j, compl_mem_generateMeasurableRec hj hi⟩
    · have : ∀ n, ∃ i, f n ∈ generateMeasurableRec s i := fun n => by simpa using IH n
      choose I hI using this
      have : IsWellOrder (ω₁ : Type u) (· < ·) := isWellOrder_out_lt _
      refine' mem_iUnion.2
        ⟨Ordinal.enum (· < ·) (Ordinal.lsub fun n => Ordinal.typein.{u} (· < ·) (I n)) _,
          iUnion_mem_generateMeasurableRec fun n => ⟨I n, _, hI n⟩⟩
      · rw [Ordinal.type_lt]
        refine' Ordinal.lsub_lt_ord_lift _ fun i => Ordinal.typein_lt_self _
        rw [mk_denumerable, lift_aleph0, isRegular_aleph_one.cof_eq]
        exact aleph0_lt_aleph_one
      · rw [← Ordinal.typein_lt_typein (· < ·), Ordinal.typein_enum]
        apply Ordinal.lt_lsub fun n : ℕ => _
  · rcases ht with ⟨t, ⟨i, rfl⟩, hx⟩
    

Proof state:
case h.refine'_2.intro.intro.intro
α : Type u
s : Set (Set α)
t : Set α
i : (Quotient.out (ord (aleph 1))).α
hx : t ∈ (fun i => generateMeasurableRec s i) i
⊢ t ∈ {t | GenerateMeasurable s t}

Next tactic:
revert t
/-- `generateMeasurableRec s` generates precisely the smallest sigma-algebra containing `s`. -/
theorem generateMeasurable_eq_rec (s : Set (Set α)) :
    { t | GenerateMeasurable s t } =
        ⋃ (i : (Quotient.out (aleph 1).ord).α), generateMeasurableRec s i := by
  ext t; refine' ⟨fun ht => _, fun ht => _⟩
  · inhabit ω₁
    induction' ht with u hu u _ IH f _ IH
    · exact mem_iUnion.2 ⟨default, self_subset_generateMeasurableRec s _ hu⟩
    · exact mem_iUnion.2 ⟨default, empty_mem_generateMeasurableRec s _⟩
    · rcases mem_iUnion.1 IH with ⟨i, hi⟩
      obtain ⟨j, hj⟩ := exists_gt i
      exact mem_iUnion.2 ⟨j, compl_mem_generateMeasurableRec hj hi⟩
    · have : ∀ n, ∃ i, f n ∈ generateMeasurableRec s i := fun n => by simpa using IH n
      choose I hI using this
      have : IsWellOrder (ω₁ : Type u) (· < ·) := isWellOrder_out_lt _
      refine' mem_iUnion.2
        ⟨Ordinal.enum (· < ·) (Ordinal.lsub fun n => Ordinal.typein.{u} (· < ·) (I n)) _,
          iUnion_mem_generateMeasurableRec fun n => ⟨I n, _, hI n⟩⟩
      · rw [Ordinal.type_lt]
        refine' Ordinal.lsub_lt_ord_lift _ fun i => Ordinal.typein_lt_self _
        rw [mk_denumerable, lift_aleph0, isRegular_aleph_one.cof_eq]
        exact aleph0_lt_aleph_one
      · rw [← Ordinal.typein_lt_typein (· < ·), Ordinal.typein_enum]
        apply Ordinal.lt_lsub fun n : ℕ => _
  · rcases ht with ⟨t, ⟨i, rfl⟩, hx⟩
    revert t
    

Proof state:
case h.refine'_2.intro.intro.intro
α : Type u
s : Set (Set α)
i : (Quotient.out (ord (aleph 1))).α
⊢ ∀ t ∈ (fun i => generateMeasurableRec s i) i, t ∈ {t | GenerateMeasurable s t}

Next tactic:
apply (aleph 1).ord.out.wo.wf.induction i
/-- `generateMeasurableRec s` generates precisely the smallest sigma-algebra containing `s`. -/
theorem generateMeasurable_eq_rec (s : Set (Set α)) :
    { t | GenerateMeasurable s t } =
        ⋃ (i : (Quotient.out (aleph 1).ord).α), generateMeasurableRec s i := by
  ext t; refine' ⟨fun ht => _, fun ht => _⟩
  · inhabit ω₁
    induction' ht with u hu u _ IH f _ IH
    · exact mem_iUnion.2 ⟨default, self_subset_generateMeasurableRec s _ hu⟩
    · exact mem_iUnion.2 ⟨default, empty_mem_generateMeasurableRec s _⟩
    · rcases mem_iUnion.1 IH with ⟨i, hi⟩
      obtain ⟨j, hj⟩ := exists_gt i
      exact mem_iUnion.2 ⟨j, compl_mem_generateMeasurableRec hj hi⟩
    · have : ∀ n, ∃ i, f n ∈ generateMeasurableRec s i := fun n => by simpa using IH n
      choose I hI using this
      have : IsWellOrder (ω₁ : Type u) (· < ·) := isWellOrder_out_lt _
      refine' mem_iUnion.2
        ⟨Ordinal.enum (· < ·) (Ordinal.lsub fun n => Ordinal.typein.{u} (· < ·) (I n)) _,
          iUnion_mem_generateMeasurableRec fun n => ⟨I n, _, hI n⟩⟩
      · rw [Ordinal.type_lt]
        refine' Ordinal.lsub_lt_ord_lift _ fun i => Ordinal.typein_lt_self _
        rw [mk_denumerable, lift_aleph0, isRegular_aleph_one.cof_eq]
        exact aleph0_lt_aleph_one
      · rw [← Ordinal.typein_lt_typein (· < ·), Ordinal.typein_enum]
        apply Ordinal.lt_lsub fun n : ℕ => _
  · rcases ht with ⟨t, ⟨i, rfl⟩, hx⟩
    revert t
    apply (aleph 1).ord.out.wo.wf.induction i
    

Proof state:
case h.refine'_2.intro.intro.intro
α : Type u
s : Set (Set α)
i : (Quotient.out (ord (aleph 1))).α
⊢ ∀ (x : (Quotient.out (ord (aleph 1))).α),
    (∀ (y : (Quotient.out (ord (aleph 1))).α),
        WellOrder.r (Quotient.out (ord (aleph 1))) y x →
          ∀ t ∈ (fun i => generateMeasurableRec s i) y, t ∈ {t | GenerateMeasurable s t}) →
      ∀ t ∈ (fun i => generateMeasurableRec s i) x, t ∈ {t | GenerateMeasurable s t}

Next tactic:
intro j H t ht
/-- `generateMeasurableRec s` generates precisely the smallest sigma-algebra containing `s`. -/
theorem generateMeasurable_eq_rec (s : Set (Set α)) :
    { t | GenerateMeasurable s t } =
        ⋃ (i : (Quotient.out (aleph 1).ord).α), generateMeasurableRec s i := by
  ext t; refine' ⟨fun ht => _, fun ht => _⟩
  · inhabit ω₁
    induction' ht with u hu u _ IH f _ IH
    · exact mem_iUnion.2 ⟨default, self_subset_generateMeasurableRec s _ hu⟩
    · exact mem_iUnion.2 ⟨default, empty_mem_generateMeasurableRec s _⟩
    · rcases mem_iUnion.1 IH with ⟨i, hi⟩
      obtain ⟨j, hj⟩ := exists_gt i
      exact mem_iUnion.2 ⟨j, compl_mem_generateMeasurableRec hj hi⟩
    · have : ∀ n, ∃ i, f n ∈ generateMeasurableRec s i := fun n => by simpa using IH n
      choose I hI using this
      have : IsWellOrder (ω₁ : Type u) (· < ·) := isWellOrder_out_lt _
      refine' mem_iUnion.2
        ⟨Ordinal.enum (· < ·) (Ordinal.lsub fun n => Ordinal.typein.{u} (· < ·) (I n)) _,
          iUnion_mem_generateMeasurableRec fun n => ⟨I n, _, hI n⟩⟩
      · rw [Ordinal.type_lt]
        refine' Ordinal.lsub_lt_ord_lift _ fun i => Ordinal.typein_lt_self _
        rw [mk_denumerable, lift_aleph0, isRegular_aleph_one.cof_eq]
        exact aleph0_lt_aleph_one
      · rw [← Ordinal.typein_lt_typein (· < ·), Ordinal.typein_enum]
        apply Ordinal.lt_lsub fun n : ℕ => _
  · rcases ht with ⟨t, ⟨i, rfl⟩, hx⟩
    revert t
    apply (aleph 1).ord.out.wo.wf.induction i
    intro j H t ht
    

Proof state:
case h.refine'_2.intro.intro.intro
α : Type u
s : Set (Set α)
i j : (Quotient.out (ord (aleph 1))).α
H :
  ∀ (y : (Quotient.out (ord (aleph 1))).α),
    WellOrder.r (Quotient.out (ord (aleph 1))) y j →
      ∀ t ∈ (fun i => generateMeasurableRec s i) y, t ∈ {t | GenerateMeasurable s t}
t : Set α
ht : t ∈ (fun i => generateMeasurableRec s i) j
⊢ t ∈ {t | GenerateMeasurable s t}

Next tactic:
unfold generateMeasurableRec at ht
/-- `generateMeasurableRec s` generates precisely the smallest sigma-algebra containing `s`. -/
theorem generateMeasurable_eq_rec (s : Set (Set α)) :
    { t | GenerateMeasurable s t } =
        ⋃ (i : (Quotient.out (aleph 1).ord).α), generateMeasurableRec s i := by
  ext t; refine' ⟨fun ht => _, fun ht => _⟩
  · inhabit ω₁
    induction' ht with u hu u _ IH f _ IH
    · exact mem_iUnion.2 ⟨default, self_subset_generateMeasurableRec s _ hu⟩
    · exact mem_iUnion.2 ⟨default, empty_mem_generateMeasurableRec s _⟩
    · rcases mem_iUnion.1 IH with ⟨i, hi⟩
      obtain ⟨j, hj⟩ := exists_gt i
      exact mem_iUnion.2 ⟨j, compl_mem_generateMeasurableRec hj hi⟩
    · have : ∀ n, ∃ i, f n ∈ generateMeasurableRec s i := fun n => by simpa using IH n
      choose I hI using this
      have : IsWellOrder (ω₁ : Type u) (· < ·) := isWellOrder_out_lt _
      refine' mem_iUnion.2
        ⟨Ordinal.enum (· < ·) (Ordinal.lsub fun n => Ordinal.typein.{u} (· < ·) (I n)) _,
          iUnion_mem_generateMeasurableRec fun n => ⟨I n, _, hI n⟩⟩
      · rw [Ordinal.type_lt]
        refine' Ordinal.lsub_lt_ord_lift _ fun i => Ordinal.typein_lt_self _
        rw [mk_denumerable, lift_aleph0, isRegular_aleph_one.cof_eq]
        exact aleph0_lt_aleph_one
      · rw [← Ordinal.typein_lt_typein (· < ·), Ordinal.typein_enum]
        apply Ordinal.lt_lsub fun n : ℕ => _
  · rcases ht with ⟨t, ⟨i, rfl⟩, hx⟩
    revert t
    apply (aleph 1).ord.out.wo.wf.induction i
    intro j H t ht
    unfold generateMeasurableRec at ht
    

Proof state:
case h.refine'_2.intro.intro.intro
α : Type u
s : Set (Set α)
i j : (Quotient.out (ord (aleph 1))).α
H :
  ∀ (y : (Quotient.out (ord (aleph 1))).α),
    WellOrder.r (Quotient.out (ord (aleph 1))) y j →
      ∀ t ∈ (fun i => generateMeasurableRec s i) y, t ∈ {t | GenerateMeasurable s t}
t : Set α
ht :
  t ∈
    let i := j;
    let S := ⋃ j, generateMeasurableRec s ↑j;
    s ∪ {∅} ∪ compl '' S ∪ range fun f => ⋃ n, ↑(f n)
⊢ t ∈ {t | GenerateMeasurable s t}

Next tactic:
rcases ht with (((h | (rfl : t = ∅)) | ⟨u, ⟨-, ⟨⟨k, hk⟩, rfl⟩, hu⟩, rfl⟩) | ⟨f, rfl⟩)