-- Mathlib/SetTheory/Cardinal/Cofinality.lean
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)

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

Tactic:
refine ⟨?_, @fun i j _ _ h => hf.strictMono (hg.2.1 _ _ h), ?_⟩

Result:
case refine_1
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : a.IsLimit
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : a.IsFundamentalSequence o g
⊢ o ≤ (f a).cof.ord

case refine_2
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : a.IsLimit
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : a.IsFundamentalSequence o g
⊢ (o.blsub fun b hb => f (g b hb)) = f a

Proof state:
case refine_1.intro.intro.intro.refine_2
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : a.IsLimit
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : a.IsFundamentalSequence o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = (f a).cof
H : ∀ (i : ι), ∃ b < a, f' i ≤ f b
b : Ordinal.{u}
hb : b < a
this : f b < f a
⊢ b < lsub fun i => sInf {b | f' i ≤ f b}

Tactic:
rw [← hf', lt_lsub_iff] at this

Result:
case refine_1.intro.intro.intro.refine_2
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : a.IsLimit
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : a.IsFundamentalSequence o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = (f a).cof
H : ∀ (i : ι), ∃ b < a, f' i ≤ f b
b : Ordinal.{u}
hb : b < a
this : ∃ i, f b ≤ f' i
⊢ b < lsub fun i => sInf {b | f' i ≤ f b}

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

Tactic:
have := lt_lsub.{u, u} f' i

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

Proof state:
case refine_1.intro.intro.intro.refine_2.intro.intro.intro
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : a.IsLimit
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : a.IsFundamentalSequence o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = (f a).cof
H : ∀ (i : ι), ∃ b < a, f' i ≤ f b
b✝ : Ordinal.{u}
hb✝ : b✝ < a
i : ι
hi : f b✝ ≤ f' i
b : Ordinal.{u}
left✝ : b < a
hb : f' i ≤ f b
⊢ b✝ < lsub fun i => sInf {b | f' i ≤ f b}

Tactic:
exact
  ((le_csInf_iff'' ⟨b, by exact hb⟩).2 fun c hc =>
    hf.strictMono.le_iff_le.1 (hi.trans hc)).trans_lt (lt_lsub _ i)

Result:
no goals

Proof state:
case refine_1.intro.intro.intro.refine_1
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : a.IsLimit
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : a.IsFundamentalSequence o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = (f a).cof
H : ∀ (i : ι), ∃ b < a, f' i ≤ f b
i : ι
⊢ sInf {b | f' i ≤ f b} < a

Tactic:
rcases H i with ⟨b, hb, hb'⟩

Result:
case refine_1.intro.intro.intro.refine_1.intro.intro
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : a.IsLimit
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : a.IsFundamentalSequence o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = (f a).cof
H : ∀ (i : ι), ∃ b < a, f' i ≤ f b
i : ι
b : Ordinal.{u}
hb : b < a
hb' : f' i ≤ f b
⊢ sInf {b | f' i ≤ f b} < a

Proof state:
case refine_2
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : a.IsLimit
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : a.IsFundamentalSequence o g
⊢ (o.blsub fun b hb => f (g b hb)) = f a

Tactic:
rw [@blsub_comp.{u, u, u} a _ (fun b _ => f b) (@fun i j _ _ h => hf.strictMono.monotone h) g
    hg.2.2]

Result:
case refine_2
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : a.IsLimit
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : a.IsFundamentalSequence o g
⊢ (a.blsub fun b x => f b) = f a

Proof state:
case refine_1.intro.intro.intro.refine_2.intro
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : a.IsLimit
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : a.IsFundamentalSequence o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = (f a).cof
H : ∀ (i : ι), ∃ b < a, f' i ≤ f b
b : Ordinal.{u}
hb : b < a
i : ι
hi : f b ≤ f' i
⊢ b < lsub fun i => sInf {b | f' i ≤ f b}

Tactic:
rcases H i with ⟨b, _, hb⟩

Result:
case refine_1.intro.intro.intro.refine_2.intro.intro.intro
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : a.IsLimit
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : a.IsFundamentalSequence o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = (f a).cof
H : ∀ (i : ι), ∃ b < a, f' i ≤ f b
b✝ : Ordinal.{u}
hb✝ : b✝ < a
i : ι
hi : f b✝ ≤ f' i
b : Ordinal.{u}
left✝ : b < a
hb : f' i ≤ f b
⊢ b✝ < lsub fun i => sInf {b | f' i ≤ f b}

Proof state:
case refine_1.intro.intro.intro
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : a.IsLimit
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : a.IsFundamentalSequence o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = (f a).cof
H : ∀ (i : ι), ∃ b < a, f' i ≤ f b
⊢ (lsub fun i => sInf {b | f' i ≤ f b}) = a

Tactic:
refine (lsub_le fun i => ?_).antisymm (le_of_forall_lt fun b hb => ?_)

Result:
case refine_1.intro.intro.intro.refine_1
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : a.IsLimit
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : a.IsFundamentalSequence o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = (f a).cof
H : ∀ (i : ι), ∃ b < a, f' i ≤ f b
i : ι
⊢ sInf {b | f' i ≤ f b} < a

case refine_1.intro.intro.intro.refine_2
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : a.IsLimit
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : a.IsFundamentalSequence o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = (f a).cof
H : ∀ (i : ι), ∃ b < a, f' i ≤ f b
b : Ordinal.{u}
hb : b < a
⊢ b < lsub fun i => sInf {b | f' i ≤ f b}

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

Tactic:
rw [← this]

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

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

Tactic:
rw [← hg.cof_eq, ord_le_ord, ← hι]

Result:
case refine_1.intro.intro.intro
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : a.IsLimit
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : a.IsFundamentalSequence o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = (f a).cof
⊢ a.cof ≤ #ι