l3lab/ntp-mathlib huggingface dataset:
theorem type_subrel_lt (o : Ordinal.{u}) :
    type (Subrel ((· < ·) : Ordinal → Ordinal → Prop) { o' : Ordinal | o' < o })
      = Ordinal.lift.{u + 1} o := by
  refine' Quotient.inductionOn o _
  rintro ⟨α, r, wo⟩; skip; 

Proof state:
case mk
α✝ : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α✝ → α✝ → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u}
α : Type u
r : α → α → Prop
wo : IsWellOrder α r
⊢ type (Subrel (fun x x_1 => x < x_1) {o' | o' < ⟦{ α := α, r := r, wo := wo }⟧}) =
    lift.{u + 1, u} ⟦{ α := α, r := r, wo := wo }⟧

Next tactic:
apply Quotient.sound
theorem type_subrel_lt (o : Ordinal.{u}) :
    type (Subrel ((· < ·) : Ordinal → Ordinal → Prop) { o' : Ordinal | o' < o })
      = Ordinal.lift.{u + 1} o := by
  refine' Quotient.inductionOn o _
  rintro ⟨α, r, wo⟩; skip; apply Quotient.sound
  -- Porting note: `symm; refine' [term]` → `refine' [term].symm`
  

Proof state:
case mk.a
α✝ : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α✝ → α✝ → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u}
α : Type u
r : α → α → Prop
wo : IsWellOrder α r
⊢ { α := ↑{o' | o' < ⟦{ α := α, r := r, wo := wo }⟧},
      r := Subrel (fun x x_1 => x < x_1) {o' | o' < ⟦{ α := α, r := r, wo := wo }⟧},
      wo :=
        (_ :
          IsWellOrder (↑{o' | o' < ⟦{ α := α, r := r, wo := wo }⟧})
            (Subrel (fun x x_1 => x < x_1) {o' | o' < ⟦{ α := α, r := r, wo := wo }⟧})) } ≈
    { α := ULift.{u + 1, u} { α := α, r := r, wo := wo }.α, r := ULift.down ⁻¹'o { α := α, r := r, wo := wo }.r,
      wo :=
        (_ :
          IsWellOrder (ULift.{u + 1, u} { α := α, r := r, wo := wo }.α)
            (ULift.down ⁻¹'o { α := α, r := r, wo := wo }.r)) }

Next tactic:
constructor
theorem type_subrel_lt (o : Ordinal.{u}) :
    type (Subrel ((· < ·) : Ordinal → Ordinal → Prop) { o' : Ordinal | o' < o })
      = Ordinal.lift.{u + 1} o := by
  refine' Quotient.inductionOn o _
  rintro ⟨α, r, wo⟩; skip; apply Quotient.sound
  -- Porting note: `symm; refine' [term]` → `refine' [term].symm`
  constructor; 

Proof state:
case mk.a.val
α✝ : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α✝ → α✝ → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u}
α : Type u
r : α → α → Prop
wo : IsWellOrder α r
⊢ Subrel (fun x x_1 => x < x_1) {o' | o' < ⟦{ α := α, r := r, wo := wo }⟧} ≃r
    ULift.down ⁻¹'o { α := α, r := r, wo := wo }.r

Next tactic:
refine' ((RelIso.preimage Equiv.ulift r).trans (enumIso r).symm).symm
theorem mk_initialSeg (o : Ordinal.{u}) :
    #{ o' : Ordinal | o' < o } = Cardinal.lift.{u + 1} o.card := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u}
⊢ #↑{o' | o' < o} = Cardinal.lift.{u + 1, u} (card o)

Next tactic:
rw [lift_card, ← type_subrel_lt, card_type]
theorem IsNormal.limit_lt {f} (H : IsNormal f) {o} (h : IsLimit o) {a} :
    a < f o ↔ ∃ b < o, a < f b :=
  not_iff_not.1 <| by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : Ordinal.{u_4} → Ordinal.{u_5}
H : IsNormal f
o : Ordinal.{u_4}
h : IsLimit o
a : Ordinal.{u_5}
⊢ ¬a < f o ↔ ¬∃ b < o, a < f b

Next tactic:
simpa only [exists_prop, not_exists, not_and, not_lt] using H.2 _ h a
theorem IsNormal.inj {f} (H : IsNormal f) {a b} : f a = f b ↔ a = b := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : Ordinal.{u_4} → Ordinal.{u_5}
H : IsNormal f
a b : Ordinal.{u_4}
⊢ f a = f b ↔ a = b

Next tactic:
simp only [le_antisymm_iff, H.le_iff]
theorem IsNormal.le_set {f o} (H : IsNormal f) (p : Set Ordinal) (p0 : p.Nonempty) (b)
    (H₂ : ∀ o, b ≤ o ↔ ∀ a ∈ p, a ≤ o) : f b ≤ o ↔ ∀ a ∈ p, f a ≤ o :=
  ⟨fun h a pa => (H.le_iff.2 ((H₂ _).1 le_rfl _ pa)).trans h, fun h => by
    -- Porting note: `refine'` didn't work well so `induction` is used
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : Ordinal.{u_4} → Ordinal.{u_5}
o : Ordinal.{u_5}
H : IsNormal f
p : Set Ordinal.{u_4}
p0 : Set.Nonempty p
b : Ordinal.{u_4}
H₂ : ∀ (o : Ordinal.{u_4}), b ≤ o ↔ ∀ a ∈ p, a ≤ o
h : ∀ a ∈ p, f a ≤ o
⊢ f b ≤ o

Next tactic:
induction b using limitRecOn with
    | H₁ =>
      cases' p0 with x px
      have := Ordinal.le_zero.1 ((H₂ _).1 (Ordinal.zero_le _) _ px)
      rw [this] at px
      exact h _ px
    | H₂ S _ =>
      rcases not_ball.1 (mt (H₂ S).2 <| (lt_succ S).not_le) with ⟨a, h₁, h₂⟩
      exact (H.le_iff.2 <| succ_le_of_lt <| not_le.1 h₂).trans (h _ h₁)
    | H₃ S L _ =>
      refine' (H.2 _ L _).2 fun a h' => _
      rcases not_ball.1 (mt (H₂ a).2 h'.not_le) with ⟨b, h₁, h₂⟩
      exact (H.le_iff.2 <| (not_le.1 h₂).le).trans (h _ h₁)
theorem IsNormal.le_set {f o} (H : IsNormal f) (p : Set Ordinal) (p0 : p.Nonempty) (b)
    (H₂ : ∀ o, b ≤ o ↔ ∀ a ∈ p, a ≤ o) : f b ≤ o ↔ ∀ a ∈ p, f a ≤ o :=
  ⟨fun h a pa => (H.le_iff.2 ((H₂ _).1 le_rfl _ pa)).trans h, fun h => by
    -- Porting note: `refine'` didn't work well so `induction` is used
    induction b using limitRecOn with
    

Proof state:
case H₁
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : Ordinal.{u_4} → Ordinal.{u_5}
o : Ordinal.{u_5}
H : IsNormal f
p : Set Ordinal.{u_4}
p0 : Set.Nonempty p
h : ∀ a ∈ p, f a ≤ o
H₂ : ∀ (o : Ordinal.{u_4}), 0 ≤ o ↔ ∀ a ∈ p, a ≤ o
⊢ f 0 ≤ o

Next tactic:
| H₁ =>
      cases' p0 with x px
      have := Ordinal.le_zero.1 ((H₂ _).1 (Ordinal.zero_le _) _ px)
      rw [this] at px
      exact h _ px
theorem IsNormal.le_set {f o} (H : IsNormal f) (p : Set Ordinal) (p0 : p.Nonempty) (b)
    (H₂ : ∀ o, b ≤ o ↔ ∀ a ∈ p, a ≤ o) : f b ≤ o ↔ ∀ a ∈ p, f a ≤ o :=
  ⟨fun h a pa => (H.le_iff.2 ((H₂ _).1 le_rfl _ pa)).trans h, fun h => by
    -- Porting note: `refine'` didn't work well so `induction` is used
    induction b using limitRecOn with
    | H₁ =>
      

Proof state:
case H₁
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : Ordinal.{u_4} → Ordinal.{u_5}
o : Ordinal.{u_5}
H : IsNormal f
p : Set Ordinal.{u_4}
p0 : Set.Nonempty p
h : ∀ a ∈ p, f a ≤ o
H₂ : ∀ (o : Ordinal.{u_4}), 0 ≤ o ↔ ∀ a ∈ p, a ≤ o
⊢ f 0 ≤ o

Next tactic:
cases' p0 with x px
theorem IsNormal.le_set {f o} (H : IsNormal f) (p : Set Ordinal) (p0 : p.Nonempty) (b)
    (H₂ : ∀ o, b ≤ o ↔ ∀ a ∈ p, a ≤ o) : f b ≤ o ↔ ∀ a ∈ p, f a ≤ o :=
  ⟨fun h a pa => (H.le_iff.2 ((H₂ _).1 le_rfl _ pa)).trans h, fun h => by
    -- Porting note: `refine'` didn't work well so `induction` is used
    induction b using limitRecOn with
    | H₁ =>
      cases' p0 with x px
      

Proof state:
case H₁.intro
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : Ordinal.{u_4} → Ordinal.{u_5}
o : Ordinal.{u_5}
H : IsNormal f
p : Set Ordinal.{u_4}
h : ∀ a ∈ p, f a ≤ o
H₂ : ∀ (o : Ordinal.{u_4}), 0 ≤ o ↔ ∀ a ∈ p, a ≤ o
x : Ordinal.{u_4}
px : x ∈ p
⊢ f 0 ≤ o

Next tactic:
have := Ordinal.le_zero.1 ((H₂ _).1 (Ordinal.zero_le _) _ px)
theorem IsNormal.le_set {f o} (H : IsNormal f) (p : Set Ordinal) (p0 : p.Nonempty) (b)
    (H₂ : ∀ o, b ≤ o ↔ ∀ a ∈ p, a ≤ o) : f b ≤ o ↔ ∀ a ∈ p, f a ≤ o :=
  ⟨fun h a pa => (H.le_iff.2 ((H₂ _).1 le_rfl _ pa)).trans h, fun h => by
    -- Porting note: `refine'` didn't work well so `induction` is used
    induction b using limitRecOn with
    | H₁ =>
      cases' p0 with x px
      have := Ordinal.le_zero.1 ((H₂ _).1 (Ordinal.zero_le _) _ px)
      

Proof state:
case H₁.intro
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : Ordinal.{u_4} → Ordinal.{u_5}
o : Ordinal.{u_5}
H : IsNormal f
p : Set Ordinal.{u_4}
h : ∀ a ∈ p, f a ≤ o
H₂ : ∀ (o : Ordinal.{u_4}), 0 ≤ o ↔ ∀ a ∈ p, a ≤ o
x : Ordinal.{u_4}
px : x ∈ p
this : x = 0
⊢ f 0 ≤ o

Next tactic:
rw [this] at px
theorem IsNormal.le_set {f o} (H : IsNormal f) (p : Set Ordinal) (p0 : p.Nonempty) (b)
    (H₂ : ∀ o, b ≤ o ↔ ∀ a ∈ p, a ≤ o) : f b ≤ o ↔ ∀ a ∈ p, f a ≤ o :=
  ⟨fun h a pa => (H.le_iff.2 ((H₂ _).1 le_rfl _ pa)).trans h, fun h => by
    -- Porting note: `refine'` didn't work well so `induction` is used
    induction b using limitRecOn with
    | H₁ =>
      cases' p0 with x px
      have := Ordinal.le_zero.1 ((H₂ _).1 (Ordinal.zero_le _) _ px)
      rw [this] at px
      

Proof state:
case H₁.intro
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : Ordinal.{u_4} → Ordinal.{u_5}
o : Ordinal.{u_5}
H : IsNormal f
p : Set Ordinal.{u_4}
h : ∀ a ∈ p, f a ≤ o
H₂ : ∀ (o : Ordinal.{u_4}), 0 ≤ o ↔ ∀ a ∈ p, a ≤ o
x : Ordinal.{u_4}
px : 0 ∈ p
this : x = 0
⊢ f 0 ≤ o

Next tactic:
exact h _ px
theorem IsNormal.le_set {f o} (H : IsNormal f) (p : Set Ordinal) (p0 : p.Nonempty) (b)
    (H₂ : ∀ o, b ≤ o ↔ ∀ a ∈ p, a ≤ o) : f b ≤ o ↔ ∀ a ∈ p, f a ≤ o :=
  ⟨fun h a pa => (H.le_iff.2 ((H₂ _).1 le_rfl _ pa)).trans h, fun h => by
    -- Porting note: `refine'` didn't work well so `induction` is used
    induction b using limitRecOn with
    | H₁ =>
      cases' p0 with x px
      have := Ordinal.le_zero.1 ((H₂ _).1 (Ordinal.zero_le _) _ px)
      rw [this] at px
      exact h _ px
    

Proof state:
case H₂
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : Ordinal.{u_4} → Ordinal.{u_5}
o : Ordinal.{u_5}
H : IsNormal f
p : Set Ordinal.{u_4}
p0 : Set.Nonempty p
h : ∀ a ∈ p, f a ≤ o
S : Ordinal.{u_4}
a✝ : (∀ (o : Ordinal.{u_4}), S ≤ o ↔ ∀ a ∈ p, a ≤ o) → f S ≤ o
H₂ : ∀ (o : Ordinal.{u_4}), succ S ≤ o ↔ ∀ a ∈ p, a ≤ o
⊢ f (succ S) ≤ o

Next tactic:
| H₂ S _ =>
      rcases not_ball.1 (mt (H₂ S).2 <| (lt_succ S).not_le) with ⟨a, h₁, h₂⟩
      exact (H.le_iff.2 <| succ_le_of_lt <| not_le.1 h₂).trans (h _ h₁)
theorem IsNormal.le_set {f o} (H : IsNormal f) (p : Set Ordinal) (p0 : p.Nonempty) (b)
    (H₂ : ∀ o, b ≤ o ↔ ∀ a ∈ p, a ≤ o) : f b ≤ o ↔ ∀ a ∈ p, f a ≤ o :=
  ⟨fun h a pa => (H.le_iff.2 ((H₂ _).1 le_rfl _ pa)).trans h, fun h => by
    -- Porting note: `refine'` didn't work well so `induction` is used
    induction b using limitRecOn with
    | H₁ =>
      cases' p0 with x px
      have := Ordinal.le_zero.1 ((H₂ _).1 (Ordinal.zero_le _) _ px)
      rw [this] at px
      exact h _ px
    | H₂ S _ =>
      

Proof state:
case H₂
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : Ordinal.{u_4} → Ordinal.{u_5}
o : Ordinal.{u_5}
H : IsNormal f
p : Set Ordinal.{u_4}
p0 : Set.Nonempty p
h : ∀ a ∈ p, f a ≤ o
S : Ordinal.{u_4}
a✝ : (∀ (o : Ordinal.{u_4}), S ≤ o ↔ ∀ a ∈ p, a ≤ o) → f S ≤ o
H₂ : ∀ (o : Ordinal.{u_4}), succ S ≤ o ↔ ∀ a ∈ p, a ≤ o
⊢ f (succ S) ≤ o

Next tactic:
rcases not_ball.1 (mt (H₂ S).2 <| (lt_succ S).not_le) with ⟨a, h₁, h₂⟩
theorem IsNormal.le_set {f o} (H : IsNormal f) (p : Set Ordinal) (p0 : p.Nonempty) (b)
    (H₂ : ∀ o, b ≤ o ↔ ∀ a ∈ p, a ≤ o) : f b ≤ o ↔ ∀ a ∈ p, f a ≤ o :=
  ⟨fun h a pa => (H.le_iff.2 ((H₂ _).1 le_rfl _ pa)).trans h, fun h => by
    -- Porting note: `refine'` didn't work well so `induction` is used
    induction b using limitRecOn with
    | H₁ =>
      cases' p0 with x px
      have := Ordinal.le_zero.1 ((H₂ _).1 (Ordinal.zero_le _) _ px)
      rw [this] at px
      exact h _ px
    | H₂ S _ =>
      rcases not_ball.1 (mt (H₂ S).2 <| (lt_succ S).not_le) with ⟨a, h₁, h₂⟩
      

Proof state:
case H₂.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : Ordinal.{u_4} → Ordinal.{u_5}
o : Ordinal.{u_5}
H : IsNormal f
p : Set Ordinal.{u_4}
p0 : Set.Nonempty p
h : ∀ a ∈ p, f a ≤ o
S : Ordinal.{u_4}
a✝ : (∀ (o : Ordinal.{u_4}), S ≤ o ↔ ∀ a ∈ p, a ≤ o) → f S ≤ o
H₂ : ∀ (o : Ordinal.{u_4}), succ S ≤ o ↔ ∀ a ∈ p, a ≤ o
a : Ordinal.{u_4}
h₁ : a ∈ p
h₂ : ¬a ≤ S
⊢ f (succ S) ≤ o

Next tactic:
exact (H.le_iff.2 <| succ_le_of_lt <| not_le.1 h₂).trans (h _ h₁)
theorem IsNormal.le_set {f o} (H : IsNormal f) (p : Set Ordinal) (p0 : p.Nonempty) (b)
    (H₂ : ∀ o, b ≤ o ↔ ∀ a ∈ p, a ≤ o) : f b ≤ o ↔ ∀ a ∈ p, f a ≤ o :=
  ⟨fun h a pa => (H.le_iff.2 ((H₂ _).1 le_rfl _ pa)).trans h, fun h => by
    -- Porting note: `refine'` didn't work well so `induction` is used
    induction b using limitRecOn with
    | H₁ =>
      cases' p0 with x px
      have := Ordinal.le_zero.1 ((H₂ _).1 (Ordinal.zero_le _) _ px)
      rw [this] at px
      exact h _ px
    | H₂ S _ =>
      rcases not_ball.1 (mt (H₂ S).2 <| (lt_succ S).not_le) with ⟨a, h₁, h₂⟩
      exact (H.le_iff.2 <| succ_le_of_lt <| not_le.1 h₂).trans (h _ h₁)
    

Proof state:
case H₃
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : Ordinal.{u_4} → Ordinal.{u_5}
o : Ordinal.{u_5}
H : IsNormal f
p : Set Ordinal.{u_4}
p0 : Set.Nonempty p
h : ∀ a ∈ p, f a ≤ o
S : Ordinal.{u_4}
L : IsLimit S
a✝ : ∀ o' < S, (∀ (o : Ordinal.{u_4}), o' ≤ o ↔ ∀ a ∈ p, a ≤ o) → f o' ≤ o
H₂ : ∀ (o : Ordinal.{u_4}), S ≤ o ↔ ∀ a ∈ p, a ≤ o
⊢ f S ≤ o

Next tactic:
| H₃ S L _ =>
      refine' (H.2 _ L _).2 fun a h' => _
      rcases not_ball.1 (mt (H₂ a).2 h'.not_le) with ⟨b, h₁, h₂⟩
      exact (H.le_iff.2 <| (not_le.1 h₂).le).trans (h _ h₁)
theorem IsNormal.le_set {f o} (H : IsNormal f) (p : Set Ordinal) (p0 : p.Nonempty) (b)
    (H₂ : ∀ o, b ≤ o ↔ ∀ a ∈ p, a ≤ o) : f b ≤ o ↔ ∀ a ∈ p, f a ≤ o :=
  ⟨fun h a pa => (H.le_iff.2 ((H₂ _).1 le_rfl _ pa)).trans h, fun h => by
    -- Porting note: `refine'` didn't work well so `induction` is used
    induction b using limitRecOn with
    | H₁ =>
      cases' p0 with x px
      have := Ordinal.le_zero.1 ((H₂ _).1 (Ordinal.zero_le _) _ px)
      rw [this] at px
      exact h _ px
    | H₂ S _ =>
      rcases not_ball.1 (mt (H₂ S).2 <| (lt_succ S).not_le) with ⟨a, h₁, h₂⟩
      exact (H.le_iff.2 <| succ_le_of_lt <| not_le.1 h₂).trans (h _ h₁)
    | H₃ S L _ =>
      

Proof state:
case H₃
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : Ordinal.{u_4} → Ordinal.{u_5}
o : Ordinal.{u_5}
H : IsNormal f
p : Set Ordinal.{u_4}
p0 : Set.Nonempty p
h : ∀ a ∈ p, f a ≤ o
S : Ordinal.{u_4}
L : IsLimit S
a✝ : ∀ o' < S, (∀ (o : Ordinal.{u_4}), o' ≤ o ↔ ∀ a ∈ p, a ≤ o) → f o' ≤ o
H₂ : ∀ (o : Ordinal.{u_4}), S ≤ o ↔ ∀ a ∈ p, a ≤ o
⊢ f S ≤ o

Next tactic:
refine' (H.2 _ L _).2 fun a h' => _
theorem IsNormal.le_set {f o} (H : IsNormal f) (p : Set Ordinal) (p0 : p.Nonempty) (b)
    (H₂ : ∀ o, b ≤ o ↔ ∀ a ∈ p, a ≤ o) : f b ≤ o ↔ ∀ a ∈ p, f a ≤ o :=
  ⟨fun h a pa => (H.le_iff.2 ((H₂ _).1 le_rfl _ pa)).trans h, fun h => by
    -- Porting note: `refine'` didn't work well so `induction` is used
    induction b using limitRecOn with
    | H₁ =>
      cases' p0 with x px
      have := Ordinal.le_zero.1 ((H₂ _).1 (Ordinal.zero_le _) _ px)
      rw [this] at px
      exact h _ px
    | H₂ S _ =>
      rcases not_ball.1 (mt (H₂ S).2 <| (lt_succ S).not_le) with ⟨a, h₁, h₂⟩
      exact (H.le_iff.2 <| succ_le_of_lt <| not_le.1 h₂).trans (h _ h₁)
    | H₃ S L _ =>
      refine' (H.2 _ L _).2 fun a h' => _
      

Proof state:
case H₃
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : Ordinal.{u_4} → Ordinal.{u_5}
o : Ordinal.{u_5}
H : IsNormal f
p : Set Ordinal.{u_4}
p0 : Set.Nonempty p
h : ∀ a ∈ p, f a ≤ o
S : Ordinal.{u_4}
L : IsLimit S
a✝ : ∀ o' < S, (∀ (o : Ordinal.{u_4}), o' ≤ o ↔ ∀ a ∈ p, a ≤ o) → f o' ≤ o
H₂ : ∀ (o : Ordinal.{u_4}), S ≤ o ↔ ∀ a ∈ p, a ≤ o
a : Ordinal.{u_4}
h' : a < S
⊢ f a ≤ o

Next tactic:
rcases not_ball.1 (mt (H₂ a).2 h'.not_le) with ⟨b, h₁, h₂⟩
theorem IsNormal.le_set {f o} (H : IsNormal f) (p : Set Ordinal) (p0 : p.Nonempty) (b)
    (H₂ : ∀ o, b ≤ o ↔ ∀ a ∈ p, a ≤ o) : f b ≤ o ↔ ∀ a ∈ p, f a ≤ o :=
  ⟨fun h a pa => (H.le_iff.2 ((H₂ _).1 le_rfl _ pa)).trans h, fun h => by
    -- Porting note: `refine'` didn't work well so `induction` is used
    induction b using limitRecOn with
    | H₁ =>
      cases' p0 with x px
      have := Ordinal.le_zero.1 ((H₂ _).1 (Ordinal.zero_le _) _ px)
      rw [this] at px
      exact h _ px
    | H₂ S _ =>
      rcases not_ball.1 (mt (H₂ S).2 <| (lt_succ S).not_le) with ⟨a, h₁, h₂⟩
      exact (H.le_iff.2 <| succ_le_of_lt <| not_le.1 h₂).trans (h _ h₁)
    | H₃ S L _ =>
      refine' (H.2 _ L _).2 fun a h' => _
      rcases not_ball.1 (mt (H₂ a).2 h'.not_le) with ⟨b, h₁, h₂⟩
      

Proof state:
case H₃.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : Ordinal.{u_4} → Ordinal.{u_5}
o : Ordinal.{u_5}
H : IsNormal f
p : Set Ordinal.{u_4}
p0 : Set.Nonempty p
h : ∀ a ∈ p, f a ≤ o
S : Ordinal.{u_4}
L : IsLimit S
a✝ : ∀ o' < S, (∀ (o : Ordinal.{u_4}), o' ≤ o ↔ ∀ a ∈ p, a ≤ o) → f o' ≤ o
H₂ : ∀ (o : Ordinal.{u_4}), S ≤ o ↔ ∀ a ∈ p, a ≤ o
a : Ordinal.{u_4}
h' : a < S
b : Ordinal.{u_4}
h₁ : b ∈ p
h₂ : ¬b ≤ a
⊢ f a ≤ o

Next tactic:
exact (H.le_iff.2 <| (not_le.1 h₂).le).trans (h _ h₁)
theorem IsNormal.le_set' {f o} (H : IsNormal f) (p : Set α) (p0 : p.Nonempty) (g : α → Ordinal) (b)
    (H₂ : ∀ o, b ≤ o ↔ ∀ a ∈ p, g a ≤ o) : f b ≤ o ↔ ∀ a ∈ p, f (g a) ≤ o := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : Ordinal.{u_4} → Ordinal.{u_5}
o : Ordinal.{u_5}
H : IsNormal f
p : Set α
p0 : Set.Nonempty p
g : α → Ordinal.{u_4}
b : Ordinal.{u_4}
H₂ : ∀ (o : Ordinal.{u_4}), b ≤ o ↔ ∀ a ∈ p, g a ≤ o
⊢ f b ≤ o ↔ ∀ a ∈ p, f (g a) ≤ o

Next tactic:
simpa [H₂] using H.le_set (g '' p) (p0.image g) b
theorem add_le_of_limit {a b c : Ordinal} (h : IsLimit b) : a + b ≤ c ↔ ∀ b' < b, a + b' ≤ c :=
  ⟨fun h b' l => (add_le_add_left l.le _).trans h, fun H =>
    le_of_not_lt <| by
      -- Porting note: `induction` tactics are required because of the parser bug.
      

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b c : Ordinal.{u_4}
h : IsLimit b
H : ∀ b' < b, a + b' ≤ c
⊢ ¬c < a + b

Next tactic:
induction a using inductionOn with
      | H α r =>
        induction b using inductionOn with
        | H β s =>
          intro l
          suffices ∀ x : β, Sum.Lex r s (Sum.inr x) (enum _ _ l) by
            -- Porting note: `revert` & `intro` is required because `cases'` doesn't replace
            --               `enum _ _ l` in `this`.
            revert this; cases' enum _ _ l with x x <;> intro this
            · cases this (enum s 0 h.pos)
            · exact irrefl _ (this _)
          intro x
          rw [← typein_lt_typein (Sum.Lex r s), typein_enum]
          have := H _ (h.2 _ (typein_lt_type s x))
          rw [add_succ, succ_le_iff] at this
          refine'
            (RelEmbedding.ofMonotone (fun a => _) fun a b => _).ordinal_type_le.trans_lt this
          · rcases a with ⟨a | b, h⟩
            · exact Sum.inl a
            · exact Sum.inr ⟨b, by cases h; assumption⟩
          · rcases a with ⟨a | a, h₁⟩ <;> rcases b with ⟨b | b, h₂⟩ <;> cases h₁ <;> cases h₂ <;>
              rintro ⟨⟩ <;> constructor <;> assumption
theorem add_le_of_limit {a b c : Ordinal} (h : IsLimit b) : a + b ≤ c ↔ ∀ b' < b, a + b' ≤ c :=
  ⟨fun h b' l => (add_le_add_left l.le _).trans h, fun H =>
    le_of_not_lt <| by
      -- Porting note: `induction` tactics are required because of the parser bug.
      induction a using inductionOn with
      

Proof state:
case H
α✝ : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α✝ → α✝ → Prop
s : β → β → Prop
t : γ → γ → Prop
b c : Ordinal.{u_4}
h : IsLimit b
α : Type u_4
r : α → α → Prop
inst✝ : IsWellOrder α r
H : ∀ b' < b, type r + b' ≤ c
⊢ ¬c < type r + b

Next tactic:
| H α r =>
        induction b using inductionOn with
        | H β s =>
          intro l
          suffices ∀ x : β, Sum.Lex r s (Sum.inr x) (enum _ _ l) by
            -- Porting note: `revert` & `intro` is required because `cases'` doesn't replace
            --               `enum _ _ l` in `this`.
            revert this; cases' enum _ _ l with x x <;> intro this
            · cases this (enum s 0 h.pos)
            · exact irrefl _ (this _)
          intro x
          rw [← typein_lt_typein (Sum.Lex r s), typein_enum]
          have := H _ (h.2 _ (typein_lt_type s x))
          rw [add_succ, succ_le_iff] at this
          refine'
            (RelEmbedding.ofMonotone (fun a => _) fun a b => _).ordinal_type_le.trans_lt this
          · rcases a with ⟨a | b, h⟩
            · exact Sum.inl a
            · exact Sum.inr ⟨b, by cases h; assumption⟩
          · rcases a with ⟨a | a, h₁⟩ <;> rcases b with ⟨b | b, h₂⟩ <;> cases h₁ <;> cases h₂ <;>
              rintro ⟨⟩ <;> constructor <;> assumption
theorem add_le_of_limit {a b c : Ordinal} (h : IsLimit b) : a + b ≤ c ↔ ∀ b' < b, a + b' ≤ c :=
  ⟨fun h b' l => (add_le_add_left l.le _).trans h, fun H =>
    le_of_not_lt <| by
      -- Porting note: `induction` tactics are required because of the parser bug.
      induction a using inductionOn with
      | H α r =>
        

Proof state:
case H
α✝ : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α✝ → α✝ → Prop
s : β → β → Prop
t : γ → γ → Prop
b c : Ordinal.{u_4}
h : IsLimit b
α : Type u_4
r : α → α → Prop
inst✝ : IsWellOrder α r
H : ∀ b' < b, type r + b' ≤ c
⊢ ¬c < type r + b

Next tactic:
induction b using inductionOn with
        | H β s =>
          intro l
          suffices ∀ x : β, Sum.Lex r s (Sum.inr x) (enum _ _ l) by
            -- Porting note: `revert` & `intro` is required because `cases'` doesn't replace
            --               `enum _ _ l` in `this`.
            revert this; cases' enum _ _ l with x x <;> intro this
            · cases this (enum s 0 h.pos)
            · exact irrefl _ (this _)
          intro x
          rw [← typein_lt_typein (Sum.Lex r s), typein_enum]
          have := H _ (h.2 _ (typein_lt_type s x))
          rw [add_succ, succ_le_iff] at this
          refine'
            (RelEmbedding.ofMonotone (fun a => _) fun a b => _).ordinal_type_le.trans_lt this
          · rcases a with ⟨a | b, h⟩
            · exact Sum.inl a
            · exact Sum.inr ⟨b, by cases h; assumption⟩
          · rcases a with ⟨a | a, h₁⟩ <;> rcases b with ⟨b | b, h₂⟩ <;> cases h₁ <;> cases h₂ <;>
              rintro ⟨⟩ <;> constructor <;> assumption
theorem add_le_of_limit {a b c : Ordinal} (h : IsLimit b) : a + b ≤ c ↔ ∀ b' < b, a + b' ≤ c :=
  ⟨fun h b' l => (add_le_add_left l.le _).trans h, fun H =>
    le_of_not_lt <| by
      -- Porting note: `induction` tactics are required because of the parser bug.
      induction a using inductionOn with
      | H α r =>
        induction b using inductionOn with
        

Proof state:
case H.H
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Ordinal.{u_4}
α : Type u_4
r : α → α → Prop
inst✝¹ : IsWellOrder α r
β : Type u_4
s : β → β → Prop
inst✝ : IsWellOrder β s
h : IsLimit (type s)
H : ∀ b' < type s, type r + b' ≤ c
⊢ ¬c < type r + type s

Next tactic:
| H β s =>
          intro l
          suffices ∀ x : β, Sum.Lex r s (Sum.inr x) (enum _ _ l) by
            -- Porting note: `revert` & `intro` is required because `cases'` doesn't replace
            --               `enum _ _ l` in `this`.
            revert this; cases' enum _ _ l with x x <;> intro this
            · cases this (enum s 0 h.pos)
            · exact irrefl _ (this _)
          intro x
          rw [← typein_lt_typein (Sum.Lex r s), typein_enum]
          have := H _ (h.2 _ (typein_lt_type s x))
          rw [add_succ, succ_le_iff] at this
          refine'
            (RelEmbedding.ofMonotone (fun a => _) fun a b => _).ordinal_type_le.trans_lt this
          · rcases a with ⟨a | b, h⟩
            · exact Sum.inl a
            · exact Sum.inr ⟨b, by cases h; assumption⟩
          · rcases a with ⟨a | a, h₁⟩ <;> rcases b with ⟨b | b, h₂⟩ <;> cases h₁ <;> cases h₂ <;>
              rintro ⟨⟩ <;> constructor <;> assumption
theorem add_le_of_limit {a b c : Ordinal} (h : IsLimit b) : a + b ≤ c ↔ ∀ b' < b, a + b' ≤ c :=
  ⟨fun h b' l => (add_le_add_left l.le _).trans h, fun H =>
    le_of_not_lt <| by
      -- Porting note: `induction` tactics are required because of the parser bug.
      induction a using inductionOn with
      | H α r =>
        induction b using inductionOn with
        | H β s =>
          

Proof state:
case H.H
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Ordinal.{u_4}
α : Type u_4
r : α → α → Prop
inst✝¹ : IsWellOrder α r
β : Type u_4
s : β → β → Prop
inst✝ : IsWellOrder β s
h : IsLimit (type s)
H : ∀ b' < type s, type r + b' ≤ c
⊢ ¬c < type r + type s

Next tactic:
intro l