l3lab/ntp-mathlib huggingface dataset:
/-- Every ordinal has a fundamental sequence. -/
theorem exists_fundamental_sequence (a : Ordinal.{u}) :
    ∃ f, IsFundamentalSequence a a.cof.ord f := by
  suffices h : ∃ o f, IsFundamentalSequence a o f
  · rcases h with ⟨o, f, hf⟩
    exact ⟨_, hf.ord_cof⟩
  rcases exists_lsub_cof a with ⟨ι, f, hf, hι⟩
  rcases ord_eq ι with ⟨r, wo, hr⟩
  haveI := wo
  let r' := Subrel r { i | ∀ j, r j i → f j < f i }
  let hrr' : r' ↪r r := Subrel.relEmbedding _ _
  haveI := hrr'.isWellOrder
  refine'
    ⟨_, _, hrr'.ordinal_type_le.trans _, @fun i j _ h _ => (enum r' j h).prop _ _,
      le_antisymm (blsub_le fun i hi => lsub_le_iff.1 hf.le _) _⟩
  · rw [← hι, hr]
  · change r (hrr'.1 _) (hrr'.1 _)
    rwa [hrr'.2, @enum_lt_enum _ r']
  · rw [← hf, lsub_le_iff]
    intro i
    suffices h : ∃ i' hi', f i ≤ bfamilyOfFamily' r' (fun i => f i) i' hi'
    · rcases h with ⟨i', hi', hfg⟩
      exact hfg.trans_lt (lt_blsub _ _ _)
    by_cases h : ∀ j, r j i → f j < f i
    · refine' ⟨typein r' ⟨i, h⟩, typein_lt_type _ _, _⟩
      

Proof state:
case pos
α : Type u_1
r✝ : α → α → Prop
a : Ordinal.{u}
ι : Type u
f : ι → Ordinal.{u}
hf : lsub f = a
hι : #ι = cof a
r : ι → ι → Prop
wo : IsWellOrder ι r
hr : ord #ι = type r
this✝ : IsWellOrder ι r
r' : ↑{i | ∀ (j : ι), r j i → f j < f i} → ↑{i | ∀ (j : ι), r j i → f j < f i} → Prop :=
  Subrel r {i | ∀ (j : ι), r j i → f j < f i}
hrr' : r' ↪r r := Subrel.relEmbedding r {i | ∀ (j : ι), r j i → f j < f i}
this : IsWellOrder (↑{i | ∀ (j : ι), r j i → f j < f i}) r'
i : ι
h : ∀ (j : ι), r j i → f j < f i
⊢ f i ≤
    bfamilyOfFamily' r' (fun i => f ↑i) (typein r' { val := i, property := h })
      (_ : typein r' { val := i, property := h } < type r')

Next tactic:
rw [bfamilyOfFamily'_typein]
/-- Every ordinal has a fundamental sequence. -/
theorem exists_fundamental_sequence (a : Ordinal.{u}) :
    ∃ f, IsFundamentalSequence a a.cof.ord f := by
  suffices h : ∃ o f, IsFundamentalSequence a o f
  · rcases h with ⟨o, f, hf⟩
    exact ⟨_, hf.ord_cof⟩
  rcases exists_lsub_cof a with ⟨ι, f, hf, hι⟩
  rcases ord_eq ι with ⟨r, wo, hr⟩
  haveI := wo
  let r' := Subrel r { i | ∀ j, r j i → f j < f i }
  let hrr' : r' ↪r r := Subrel.relEmbedding _ _
  haveI := hrr'.isWellOrder
  refine'
    ⟨_, _, hrr'.ordinal_type_le.trans _, @fun i j _ h _ => (enum r' j h).prop _ _,
      le_antisymm (blsub_le fun i hi => lsub_le_iff.1 hf.le _) _⟩
  · rw [← hι, hr]
  · change r (hrr'.1 _) (hrr'.1 _)
    rwa [hrr'.2, @enum_lt_enum _ r']
  · rw [← hf, lsub_le_iff]
    intro i
    suffices h : ∃ i' hi', f i ≤ bfamilyOfFamily' r' (fun i => f i) i' hi'
    · rcases h with ⟨i', hi', hfg⟩
      exact hfg.trans_lt (lt_blsub _ _ _)
    by_cases h : ∀ j, r j i → f j < f i
    · refine' ⟨typein r' ⟨i, h⟩, typein_lt_type _ _, _⟩
      rw [bfamilyOfFamily'_typein]
    · 

Proof state:
case neg
α : Type u_1
r✝ : α → α → Prop
a : Ordinal.{u}
ι : Type u
f : ι → Ordinal.{u}
hf : lsub f = a
hι : #ι = cof a
r : ι → ι → Prop
wo : IsWellOrder ι r
hr : ord #ι = type r
this✝ : IsWellOrder ι r
r' : ↑{i | ∀ (j : ι), r j i → f j < f i} → ↑{i | ∀ (j : ι), r j i → f j < f i} → Prop :=
  Subrel r {i | ∀ (j : ι), r j i → f j < f i}
hrr' : r' ↪r r := Subrel.relEmbedding r {i | ∀ (j : ι), r j i → f j < f i}
this : IsWellOrder (↑{i | ∀ (j : ι), r j i → f j < f i}) r'
i : ι
h : ¬∀ (j : ι), r j i → f j < f i
⊢ ∃ i', ∃ (hi' : i' < type r'), f i ≤ bfamilyOfFamily' r' (fun i => f ↑i) i' hi'

Next tactic:
push_neg at h
/-- Every ordinal has a fundamental sequence. -/
theorem exists_fundamental_sequence (a : Ordinal.{u}) :
    ∃ f, IsFundamentalSequence a a.cof.ord f := by
  suffices h : ∃ o f, IsFundamentalSequence a o f
  · rcases h with ⟨o, f, hf⟩
    exact ⟨_, hf.ord_cof⟩
  rcases exists_lsub_cof a with ⟨ι, f, hf, hι⟩
  rcases ord_eq ι with ⟨r, wo, hr⟩
  haveI := wo
  let r' := Subrel r { i | ∀ j, r j i → f j < f i }
  let hrr' : r' ↪r r := Subrel.relEmbedding _ _
  haveI := hrr'.isWellOrder
  refine'
    ⟨_, _, hrr'.ordinal_type_le.trans _, @fun i j _ h _ => (enum r' j h).prop _ _,
      le_antisymm (blsub_le fun i hi => lsub_le_iff.1 hf.le _) _⟩
  · rw [← hι, hr]
  · change r (hrr'.1 _) (hrr'.1 _)
    rwa [hrr'.2, @enum_lt_enum _ r']
  · rw [← hf, lsub_le_iff]
    intro i
    suffices h : ∃ i' hi', f i ≤ bfamilyOfFamily' r' (fun i => f i) i' hi'
    · rcases h with ⟨i', hi', hfg⟩
      exact hfg.trans_lt (lt_blsub _ _ _)
    by_cases h : ∀ j, r j i → f j < f i
    · refine' ⟨typein r' ⟨i, h⟩, typein_lt_type _ _, _⟩
      rw [bfamilyOfFamily'_typein]
    · push_neg at h
      

Proof state:
case neg
α : Type u_1
r✝ : α → α → Prop
a : Ordinal.{u}
ι : Type u
f : ι → Ordinal.{u}
hf : lsub f = a
hι : #ι = cof a
r : ι → ι → Prop
wo : IsWellOrder ι r
hr : ord #ι = type r
this✝ : IsWellOrder ι r
r' : ↑{i | ∀ (j : ι), r j i → f j < f i} → ↑{i | ∀ (j : ι), r j i → f j < f i} → Prop :=
  Subrel r {i | ∀ (j : ι), r j i → f j < f i}
hrr' : r' ↪r r := Subrel.relEmbedding r {i | ∀ (j : ι), r j i → f j < f i}
this : IsWellOrder (↑{i | ∀ (j : ι), r j i → f j < f i}) r'
i : ι
h : ∃ j, r j i ∧ f i ≤ f j
⊢ ∃ i', ∃ (hi' : i' < type r'), f i ≤ bfamilyOfFamily' r' (fun i => f ↑i) i' hi'

Next tactic:
cases' wo.wf.min_mem _ h with hji hij
/-- Every ordinal has a fundamental sequence. -/
theorem exists_fundamental_sequence (a : Ordinal.{u}) :
    ∃ f, IsFundamentalSequence a a.cof.ord f := by
  suffices h : ∃ o f, IsFundamentalSequence a o f
  · rcases h with ⟨o, f, hf⟩
    exact ⟨_, hf.ord_cof⟩
  rcases exists_lsub_cof a with ⟨ι, f, hf, hι⟩
  rcases ord_eq ι with ⟨r, wo, hr⟩
  haveI := wo
  let r' := Subrel r { i | ∀ j, r j i → f j < f i }
  let hrr' : r' ↪r r := Subrel.relEmbedding _ _
  haveI := hrr'.isWellOrder
  refine'
    ⟨_, _, hrr'.ordinal_type_le.trans _, @fun i j _ h _ => (enum r' j h).prop _ _,
      le_antisymm (blsub_le fun i hi => lsub_le_iff.1 hf.le _) _⟩
  · rw [← hι, hr]
  · change r (hrr'.1 _) (hrr'.1 _)
    rwa [hrr'.2, @enum_lt_enum _ r']
  · rw [← hf, lsub_le_iff]
    intro i
    suffices h : ∃ i' hi', f i ≤ bfamilyOfFamily' r' (fun i => f i) i' hi'
    · rcases h with ⟨i', hi', hfg⟩
      exact hfg.trans_lt (lt_blsub _ _ _)
    by_cases h : ∀ j, r j i → f j < f i
    · refine' ⟨typein r' ⟨i, h⟩, typein_lt_type _ _, _⟩
      rw [bfamilyOfFamily'_typein]
    · push_neg at h
      cases' wo.wf.min_mem _ h with hji hij
      

Proof state:
case neg.intro
α : Type u_1
r✝ : α → α → Prop
a : Ordinal.{u}
ι : Type u
f : ι → Ordinal.{u}
hf : lsub f = a
hι : #ι = cof a
r : ι → ι → Prop
wo : IsWellOrder ι r
hr : ord #ι = type r
this✝ : IsWellOrder ι r
r' : ↑{i | ∀ (j : ι), r j i → f j < f i} → ↑{i | ∀ (j : ι), r j i → f j < f i} → Prop :=
  Subrel r {i | ∀ (j : ι), r j i → f j < f i}
hrr' : r' ↪r r := Subrel.relEmbedding r {i | ∀ (j : ι), r j i → f j < f i}
this : IsWellOrder (↑{i | ∀ (j : ι), r j i → f j < f i}) r'
i : ι
h : ∃ j, r j i ∧ f i ≤ f j
hji : r (WellFounded.min (_ : WellFounded r) (fun x => r x i ∧ f i ≤ f x) h) i
hij : f i ≤ f (WellFounded.min (_ : WellFounded r) (fun x => r x i ∧ f i ≤ f x) h)
⊢ ∃ i', ∃ (hi' : i' < type r'), f i ≤ bfamilyOfFamily' r' (fun i => f ↑i) i' hi'

Next tactic:
refine' ⟨typein r' ⟨_, fun k hkj => lt_of_lt_of_le _ hij⟩, typein_lt_type _ _, _⟩
/-- Every ordinal has a fundamental sequence. -/
theorem exists_fundamental_sequence (a : Ordinal.{u}) :
    ∃ f, IsFundamentalSequence a a.cof.ord f := by
  suffices h : ∃ o f, IsFundamentalSequence a o f
  · rcases h with ⟨o, f, hf⟩
    exact ⟨_, hf.ord_cof⟩
  rcases exists_lsub_cof a with ⟨ι, f, hf, hι⟩
  rcases ord_eq ι with ⟨r, wo, hr⟩
  haveI := wo
  let r' := Subrel r { i | ∀ j, r j i → f j < f i }
  let hrr' : r' ↪r r := Subrel.relEmbedding _ _
  haveI := hrr'.isWellOrder
  refine'
    ⟨_, _, hrr'.ordinal_type_le.trans _, @fun i j _ h _ => (enum r' j h).prop _ _,
      le_antisymm (blsub_le fun i hi => lsub_le_iff.1 hf.le _) _⟩
  · rw [← hι, hr]
  · change r (hrr'.1 _) (hrr'.1 _)
    rwa [hrr'.2, @enum_lt_enum _ r']
  · rw [← hf, lsub_le_iff]
    intro i
    suffices h : ∃ i' hi', f i ≤ bfamilyOfFamily' r' (fun i => f i) i' hi'
    · rcases h with ⟨i', hi', hfg⟩
      exact hfg.trans_lt (lt_blsub _ _ _)
    by_cases h : ∀ j, r j i → f j < f i
    · refine' ⟨typein r' ⟨i, h⟩, typein_lt_type _ _, _⟩
      rw [bfamilyOfFamily'_typein]
    · push_neg at h
      cases' wo.wf.min_mem _ h with hji hij
      refine' ⟨typein r' ⟨_, fun k hkj => lt_of_lt_of_le _ hij⟩, typein_lt_type _ _, _⟩
      · 

Proof state:
case neg.intro.refine'_1
α : Type u_1
r✝ : α → α → Prop
a : Ordinal.{u}
ι : Type u
f : ι → Ordinal.{u}
hf : lsub f = a
hι : #ι = cof a
r : ι → ι → Prop
wo : IsWellOrder ι r
hr : ord #ι = type r
this✝ : IsWellOrder ι r
r' : ↑{i | ∀ (j : ι), r j i → f j < f i} → ↑{i | ∀ (j : ι), r j i → f j < f i} → Prop :=
  Subrel r {i | ∀ (j : ι), r j i → f j < f i}
hrr' : r' ↪r r := Subrel.relEmbedding r {i | ∀ (j : ι), r j i → f j < f i}
this : IsWellOrder (↑{i | ∀ (j : ι), r j i → f j < f i}) r'
i : ι
h : ∃ j, r j i ∧ f i ≤ f j
hji : r (WellFounded.min (_ : WellFounded r) (fun x => r x i ∧ f i ≤ f x) h) i
hij : f i ≤ f (WellFounded.min (_ : WellFounded r) (fun x => r x i ∧ f i ≤ f x) h)
k : ι
hkj : r k (WellFounded.min (_ : WellFounded r) (fun x => r x i ∧ f i ≤ f x) h)
⊢ f k < f i

Next tactic:
by_contra! H
/-- Every ordinal has a fundamental sequence. -/
theorem exists_fundamental_sequence (a : Ordinal.{u}) :
    ∃ f, IsFundamentalSequence a a.cof.ord f := by
  suffices h : ∃ o f, IsFundamentalSequence a o f
  · rcases h with ⟨o, f, hf⟩
    exact ⟨_, hf.ord_cof⟩
  rcases exists_lsub_cof a with ⟨ι, f, hf, hι⟩
  rcases ord_eq ι with ⟨r, wo, hr⟩
  haveI := wo
  let r' := Subrel r { i | ∀ j, r j i → f j < f i }
  let hrr' : r' ↪r r := Subrel.relEmbedding _ _
  haveI := hrr'.isWellOrder
  refine'
    ⟨_, _, hrr'.ordinal_type_le.trans _, @fun i j _ h _ => (enum r' j h).prop _ _,
      le_antisymm (blsub_le fun i hi => lsub_le_iff.1 hf.le _) _⟩
  · rw [← hι, hr]
  · change r (hrr'.1 _) (hrr'.1 _)
    rwa [hrr'.2, @enum_lt_enum _ r']
  · rw [← hf, lsub_le_iff]
    intro i
    suffices h : ∃ i' hi', f i ≤ bfamilyOfFamily' r' (fun i => f i) i' hi'
    · rcases h with ⟨i', hi', hfg⟩
      exact hfg.trans_lt (lt_blsub _ _ _)
    by_cases h : ∀ j, r j i → f j < f i
    · refine' ⟨typein r' ⟨i, h⟩, typein_lt_type _ _, _⟩
      rw [bfamilyOfFamily'_typein]
    · push_neg at h
      cases' wo.wf.min_mem _ h with hji hij
      refine' ⟨typein r' ⟨_, fun k hkj => lt_of_lt_of_le _ hij⟩, typein_lt_type _ _, _⟩
      · by_contra! H
        

Proof state:
case neg.intro.refine'_1
α : Type u_1
r✝ : α → α → Prop
a : Ordinal.{u}
ι : Type u
f : ι → Ordinal.{u}
hf : lsub f = a
hι : #ι = cof a
r : ι → ι → Prop
wo : IsWellOrder ι r
hr : ord #ι = type r
this✝ : IsWellOrder ι r
r' : ↑{i | ∀ (j : ι), r j i → f j < f i} → ↑{i | ∀ (j : ι), r j i → f j < f i} → Prop :=
  Subrel r {i | ∀ (j : ι), r j i → f j < f i}
hrr' : r' ↪r r := Subrel.relEmbedding r {i | ∀ (j : ι), r j i → f j < f i}
this : IsWellOrder (↑{i | ∀ (j : ι), r j i → f j < f i}) r'
i : ι
h : ∃ j, r j i ∧ f i ≤ f j
hji : r (WellFounded.min (_ : WellFounded r) (fun x => r x i ∧ f i ≤ f x) h) i
hij : f i ≤ f (WellFounded.min (_ : WellFounded r) (fun x => r x i ∧ f i ≤ f x) h)
k : ι
hkj : r k (WellFounded.min (_ : WellFounded r) (fun x => r x i ∧ f i ≤ f x) h)
H : f i ≤ f k
⊢ False

Next tactic:
exact (wo.wf.not_lt_min _ h ⟨IsTrans.trans _ _ _ hkj hji, H⟩) hkj
/-- Every ordinal has a fundamental sequence. -/
theorem exists_fundamental_sequence (a : Ordinal.{u}) :
    ∃ f, IsFundamentalSequence a a.cof.ord f := by
  suffices h : ∃ o f, IsFundamentalSequence a o f
  · rcases h with ⟨o, f, hf⟩
    exact ⟨_, hf.ord_cof⟩
  rcases exists_lsub_cof a with ⟨ι, f, hf, hι⟩
  rcases ord_eq ι with ⟨r, wo, hr⟩
  haveI := wo
  let r' := Subrel r { i | ∀ j, r j i → f j < f i }
  let hrr' : r' ↪r r := Subrel.relEmbedding _ _
  haveI := hrr'.isWellOrder
  refine'
    ⟨_, _, hrr'.ordinal_type_le.trans _, @fun i j _ h _ => (enum r' j h).prop _ _,
      le_antisymm (blsub_le fun i hi => lsub_le_iff.1 hf.le _) _⟩
  · rw [← hι, hr]
  · change r (hrr'.1 _) (hrr'.1 _)
    rwa [hrr'.2, @enum_lt_enum _ r']
  · rw [← hf, lsub_le_iff]
    intro i
    suffices h : ∃ i' hi', f i ≤ bfamilyOfFamily' r' (fun i => f i) i' hi'
    · rcases h with ⟨i', hi', hfg⟩
      exact hfg.trans_lt (lt_blsub _ _ _)
    by_cases h : ∀ j, r j i → f j < f i
    · refine' ⟨typein r' ⟨i, h⟩, typein_lt_type _ _, _⟩
      rw [bfamilyOfFamily'_typein]
    · push_neg at h
      cases' wo.wf.min_mem _ h with hji hij
      refine' ⟨typein r' ⟨_, fun k hkj => lt_of_lt_of_le _ hij⟩, typein_lt_type _ _, _⟩
      · by_contra! H
        exact (wo.wf.not_lt_min _ h ⟨IsTrans.trans _ _ _ hkj hji, H⟩) hkj
      · 

Proof state:
case neg.intro.refine'_2
α : Type u_1
r✝ : α → α → Prop
a : Ordinal.{u}
ι : Type u
f : ι → Ordinal.{u}
hf : lsub f = a
hι : #ι = cof a
r : ι → ι → Prop
wo : IsWellOrder ι r
hr : ord #ι = type r
this✝ : IsWellOrder ι r
r' : ↑{i | ∀ (j : ι), r j i → f j < f i} → ↑{i | ∀ (j : ι), r j i → f j < f i} → Prop :=
  Subrel r {i | ∀ (j : ι), r j i → f j < f i}
hrr' : r' ↪r r := Subrel.relEmbedding r {i | ∀ (j : ι), r j i → f j < f i}
this : IsWellOrder (↑{i | ∀ (j : ι), r j i → f j < f i}) r'
i : ι
h : ∃ j, r j i ∧ f i ≤ f j
hji : r (WellFounded.min (_ : WellFounded r) (fun x => r x i ∧ f i ≤ f x) h) i
hij : f i ≤ f (WellFounded.min (_ : WellFounded r) (fun x => r x i ∧ f i ≤ f x) h)
⊢ f i ≤
    bfamilyOfFamily' r' (fun i => f ↑i)
      (typein r'
        { val := WellFounded.min (_ : WellFounded r) (fun x => r x i ∧ f i ≤ f x) h,
          property :=
            (_ :
              ∀ (k : ι),
                r k (WellFounded.min (_ : WellFounded r) (fun x => r x i ∧ f i ≤ f x) h) →
                  f k < f (WellFounded.min (_ : WellFounded r) (fun x => r x i ∧ f i ≤ f x) h)) })
      (_ :
        typein r'
            { val := WellFounded.min (_ : WellFounded r) (fun x => r x i ∧ f i ≤ f x) h,
              property :=
                (_ :
                  ∀ (k : ι),
                    r k (WellFounded.min (_ : WellFounded r) (fun x => r x i ∧ f i ≤ f x) h) →
                      f k < f (WellFounded.min (_ : WellFounded r) (fun x => r x i ∧ f i ≤ f x) h)) } <
          type r')

Next tactic:
rwa [bfamilyOfFamily'_typein]
@[simp]
theorem cof_cof (a : Ordinal.{u}) : cof (cof a).ord = cof a := by
  

Proof state:
α : Type u_1
r : α → α → Prop
a : Ordinal.{u}
⊢ cof (ord (cof a)) = cof a

Next tactic:
cases' exists_fundamental_sequence a with f hf
@[simp]
theorem cof_cof (a : Ordinal.{u}) : cof (cof a).ord = cof a := by
  cases' exists_fundamental_sequence a with f hf
  

Proof state:
case intro
α : Type u_1
r : α → α → Prop
a : Ordinal.{u}
f : (b : Ordinal.{u}) → b < ord (cof a) → Ordinal.{u}
hf : IsFundamentalSequence a (ord (cof a)) f
⊢ cof (ord (cof a)) = cof a

Next tactic:
cases' exists_fundamental_sequence a.cof.ord with g hg
@[simp]
theorem cof_cof (a : Ordinal.{u}) : cof (cof a).ord = cof a := by
  cases' exists_fundamental_sequence a with f hf
  cases' exists_fundamental_sequence a.cof.ord with g hg
  

Proof state:
case intro.intro
α : Type u_1
r : α → α → Prop
a : Ordinal.{u}
f : (b : Ordinal.{u}) → b < ord (cof a) → Ordinal.{u}
hf : IsFundamentalSequence a (ord (cof a)) f
g : (b : Ordinal.{u}) → b < ord (cof (ord (cof a))) → Ordinal.{u}
hg : IsFundamentalSequence (ord (cof a)) (ord (cof (ord (cof a)))) g
⊢ cof (ord (cof a)) = cof a

Next tactic:
exact ord_injective (hf.trans hg).cof_eq.symm
protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
    {a o} (ha : IsLimit a) {g} (hg : IsFundamentalSequence a o g) :
    IsFundamentalSequence (f a) o fun b hb => f (g b hb) := by
  

Proof state:
α : Type u_1
r : α → α → Prop
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : IsLimit a
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : IsFundamentalSequence a o g
⊢ IsFundamentalSequence (f a) o fun b hb => f (g b hb)

Next tactic:
refine' ⟨_, @fun i j _ _ h => hf.strictMono (hg.2.1 _ _ h), _⟩
protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
    {a o} (ha : IsLimit a) {g} (hg : IsFundamentalSequence a o g) :
    IsFundamentalSequence (f a) o fun b hb => f (g b hb) := by
  refine' ⟨_, @fun i j _ _ h => hf.strictMono (hg.2.1 _ _ h), _⟩
  · 

Proof state:
case refine'_1
α : Type u_1
r : α → α → Prop
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : IsLimit a
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : IsFundamentalSequence a o g
⊢ o ≤ ord (cof (f a))

Next tactic:
rcases exists_lsub_cof (f a) with ⟨ι, f', hf', hι⟩
protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
    {a o} (ha : IsLimit a) {g} (hg : IsFundamentalSequence a o g) :
    IsFundamentalSequence (f a) o fun b hb => f (g b hb) := by
  refine' ⟨_, @fun i j _ _ h => hf.strictMono (hg.2.1 _ _ h), _⟩
  · rcases exists_lsub_cof (f a) with ⟨ι, f', hf', hι⟩
    

Proof state:
case refine'_1.intro.intro.intro
α : Type u_1
r : α → α → Prop
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : IsLimit a
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : IsFundamentalSequence a o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = cof (f a)
⊢ o ≤ ord (cof (f a))

Next tactic:
rw [← hg.cof_eq, ord_le_ord, ← hι]
protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
    {a o} (ha : IsLimit a) {g} (hg : IsFundamentalSequence a o g) :
    IsFundamentalSequence (f a) o fun b hb => f (g b hb) := by
  refine' ⟨_, @fun i j _ _ h => hf.strictMono (hg.2.1 _ _ h), _⟩
  · rcases exists_lsub_cof (f a) with ⟨ι, f', hf', hι⟩
    rw [← hg.cof_eq, ord_le_ord, ← hι]
    

Proof state:
case refine'_1.intro.intro.intro
α : Type u_1
r : α → α → Prop
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : IsLimit a
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : IsFundamentalSequence a o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = cof (f a)
⊢ cof a ≤ #ι

Next tactic:
suffices (lsub.{u, u} fun i => sInf { b : Ordinal | f' i ≤ f b }) = a by
      rw [← this]
      apply cof_lsub_le
protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
    {a o} (ha : IsLimit a) {g} (hg : IsFundamentalSequence a o g) :
    IsFundamentalSequence (f a) o fun b hb => f (g b hb) := by
  refine' ⟨_, @fun i j _ _ h => hf.strictMono (hg.2.1 _ _ h), _⟩
  · rcases exists_lsub_cof (f a) with ⟨ι, f', hf', hι⟩
    rw [← hg.cof_eq, ord_le_ord, ← hι]
    suffices (lsub.{u, u} fun i => sInf { b : Ordinal | f' i ≤ f b }) = a by
      

Proof state:
α : Type u_1
r : α → α → Prop
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : IsLimit a
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : IsFundamentalSequence a o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = cof (f a)
this : (lsub fun i => sInf {b | f' i ≤ f b}) = a
⊢ cof a ≤ #ι

Next tactic:
rw [← this]
protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
    {a o} (ha : IsLimit a) {g} (hg : IsFundamentalSequence a o g) :
    IsFundamentalSequence (f a) o fun b hb => f (g b hb) := by
  refine' ⟨_, @fun i j _ _ h => hf.strictMono (hg.2.1 _ _ h), _⟩
  · rcases exists_lsub_cof (f a) with ⟨ι, f', hf', hι⟩
    rw [← hg.cof_eq, ord_le_ord, ← hι]
    suffices (lsub.{u, u} fun i => sInf { b : Ordinal | f' i ≤ f b }) = a by
      rw [← this]
      

Proof state:
α : Type u_1
r : α → α → Prop
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : IsLimit a
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : IsFundamentalSequence a o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = cof (f a)
this : (lsub fun i => sInf {b | f' i ≤ f b}) = a
⊢ cof (lsub fun i => sInf {b | f' i ≤ f b}) ≤ #ι

Next tactic:
apply cof_lsub_le
protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
    {a o} (ha : IsLimit a) {g} (hg : IsFundamentalSequence a o g) :
    IsFundamentalSequence (f a) o fun b hb => f (g b hb) := by
  refine' ⟨_, @fun i j _ _ h => hf.strictMono (hg.2.1 _ _ h), _⟩
  · rcases exists_lsub_cof (f a) with ⟨ι, f', hf', hι⟩
    rw [← hg.cof_eq, ord_le_ord, ← hι]
    suffices (lsub.{u, u} fun i => sInf { b : Ordinal | f' i ≤ f b }) = a by
      rw [← this]
      apply cof_lsub_le
    

Proof state:
case refine'_1.intro.intro.intro
α : Type u_1
r : α → α → Prop
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : IsLimit a
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : IsFundamentalSequence a o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = cof (f a)
⊢ (lsub fun i => sInf {b | f' i ≤ f b}) = a

Next tactic:
have H : ∀ i, ∃ b < a, f' i ≤ f b := fun i => by
      have := lt_lsub.{u, u} f' i
      rw [hf', ← IsNormal.blsub_eq.{u, u} hf ha, lt_blsub_iff] at this
      simpa using this
protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
    {a o} (ha : IsLimit a) {g} (hg : IsFundamentalSequence a o g) :
    IsFundamentalSequence (f a) o fun b hb => f (g b hb) := by
  refine' ⟨_, @fun i j _ _ h => hf.strictMono (hg.2.1 _ _ h), _⟩
  · rcases exists_lsub_cof (f a) with ⟨ι, f', hf', hι⟩
    rw [← hg.cof_eq, ord_le_ord, ← hι]
    suffices (lsub.{u, u} fun i => sInf { b : Ordinal | f' i ≤ f b }) = a by
      rw [← this]
      apply cof_lsub_le
    have H : ∀ i, ∃ b < a, f' i ≤ f b := fun i => by
      

Proof state:
α : Type u_1
r : α → α → Prop
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : IsLimit a
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : IsFundamentalSequence a o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = cof (f a)
i : ι
⊢ ∃ b < a, f' i ≤ f b

Next tactic:
have := lt_lsub.{u, u} f' i
protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
    {a o} (ha : IsLimit a) {g} (hg : IsFundamentalSequence a o g) :
    IsFundamentalSequence (f a) o fun b hb => f (g b hb) := by
  refine' ⟨_, @fun i j _ _ h => hf.strictMono (hg.2.1 _ _ h), _⟩
  · rcases exists_lsub_cof (f a) with ⟨ι, f', hf', hι⟩
    rw [← hg.cof_eq, ord_le_ord, ← hι]
    suffices (lsub.{u, u} fun i => sInf { b : Ordinal | f' i ≤ f b }) = a by
      rw [← this]
      apply cof_lsub_le
    have H : ∀ i, ∃ b < a, f' i ≤ f b := fun i => by
      have := lt_lsub.{u, u} f' i
      

Proof state:
α : Type u_1
r : α → α → Prop
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : IsLimit a
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : IsFundamentalSequence a o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = cof (f a)
i : ι
this : f' i < lsub f'
⊢ ∃ b < a, f' i ≤ f b

Next tactic:
rw [hf', ← IsNormal.blsub_eq.{u, u} hf ha, lt_blsub_iff] at this
protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
    {a o} (ha : IsLimit a) {g} (hg : IsFundamentalSequence a o g) :
    IsFundamentalSequence (f a) o fun b hb => f (g b hb) := by
  refine' ⟨_, @fun i j _ _ h => hf.strictMono (hg.2.1 _ _ h), _⟩
  · rcases exists_lsub_cof (f a) with ⟨ι, f', hf', hι⟩
    rw [← hg.cof_eq, ord_le_ord, ← hι]
    suffices (lsub.{u, u} fun i => sInf { b : Ordinal | f' i ≤ f b }) = a by
      rw [← this]
      apply cof_lsub_le
    have H : ∀ i, ∃ b < a, f' i ≤ f b := fun i => by
      have := lt_lsub.{u, u} f' i
      rw [hf', ← IsNormal.blsub_eq.{u, u} hf ha, lt_blsub_iff] at this
      

Proof state:
α : Type u_1
r : α → α → Prop
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : IsLimit a
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : IsFundamentalSequence a o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = cof (f a)
i : ι
this : ∃ i_1, ∃ (_ : i_1 < a), f' i ≤ f i_1
⊢ ∃ b < a, f' i ≤ f b

Next tactic:
simpa using this