l3lab/ntp-mathlib huggingface dataset:
instance add_contravariantClass_le : ContravariantClass Ordinal.{u} Ordinal.{u} (· + ·) (· ≤ ·) :=
  ⟨fun a b c =>
    inductionOn a fun α r hr =>
      inductionOn b fun β₁ s₁ hs₁ =>
        inductionOn c fun β₂ s₂ hs₂ ⟨f⟩ =>
          ⟨have fl : ∀ a, f (Sum.inl a) = Sum.inl a := fun a => by
              simpa only [InitialSeg.trans_apply, InitialSeg.leAdd_apply] using
                @InitialSeg.eq _ _ _ _ _
                  ((InitialSeg.leAdd r s₁).trans f) (InitialSeg.leAdd r s₂) a
            have : ∀ b, { b' // f (Sum.inr b) = Sum.inr b' } := by
              intro b; cases e : f (Sum.inr b)
              · rw [← fl] at e
                have := f.inj' e
                contradiction
              · exact ⟨_, rfl⟩
            let g (b) := (this b).1
            have fr : ∀ b, f (Sum.inr b) = Sum.inr (g b) := fun b => (this b).2
            ⟨⟨⟨g, fun x y h => by
                  injection f.inj' (by rw [fr, fr, h] : f (Sum.inr x) = f (Sum.inr y))⟩,
                @fun a b => by
                  -- Porting note:
                  --  `relEmbedding.coe_fn_to_embedding` & `initial_seg.coe_fn_to_rel_embedding`
                  --  → `InitialSeg.coe_coe_fn`
                  simpa only [Sum.lex_inr_inr, fr, InitialSeg.coe_coe_fn, Embedding.coeFn_mk] using
                    @RelEmbedding.map_rel_iff _ _ _ _ f.toRelEmbedding (Sum.inr a) (Sum.inr b)⟩,
              fun a b H => by
                rcases f.init (by rw [fr] <;> exact Sum.lex_inr_inr.2 H) with ⟨a' | a', h⟩
                · 

Proof state:
case intro.inl
α✝ : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α✝ → α✝ → Prop
s : β → β → Prop
t : γ → γ → Prop
a✝ b✝ c : Ordinal.{u}
α : Type u
r : α → α → Prop
hr : IsWellOrder α r
β₁ : Type u
s₁ : β₁ → β₁ → Prop
hs₁ : IsWellOrder β₁ s₁
β₂ : Type u
s₂ : β₂ → β₂ → Prop
hs₂ : IsWellOrder β₂ s₂
x✝ : type r + type s₁ ≤ type r + type s₂
f : Sum.Lex r s₁ ≼i Sum.Lex r s₂
fl : ∀ (a : α), f (Sum.inl a) = Sum.inl a
this : (b : β₁) → { b' // f (Sum.inr b) = Sum.inr b' }
g : β₁ → β₂ := fun b => ↑(this b)
fr : ∀ (b : β₁), f (Sum.inr b) = Sum.inr (g b)
a : β₁
b : β₂
H :
  s₂ b
    ({ toEmbedding := { toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) },
        map_rel_iff' :=
          (_ :
            ∀ (a b : β₁),
              s₂ ({ toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) } a)
                  ({ toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) } b) ↔
                s₁ a b) }
      a)
a' : α
h : f (Sum.inl a') = Sum.inr b
⊢ ∃ a',
    { toEmbedding := { toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) },
          map_rel_iff' :=
            (_ :
              ∀ (a b : β₁),
                s₂ ({ toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) } a)
                    ({ toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) } b) ↔
                  s₁ a b) }
        a' =
      b

Next tactic:
rw [fl] at h
instance add_contravariantClass_le : ContravariantClass Ordinal.{u} Ordinal.{u} (· + ·) (· ≤ ·) :=
  ⟨fun a b c =>
    inductionOn a fun α r hr =>
      inductionOn b fun β₁ s₁ hs₁ =>
        inductionOn c fun β₂ s₂ hs₂ ⟨f⟩ =>
          ⟨have fl : ∀ a, f (Sum.inl a) = Sum.inl a := fun a => by
              simpa only [InitialSeg.trans_apply, InitialSeg.leAdd_apply] using
                @InitialSeg.eq _ _ _ _ _
                  ((InitialSeg.leAdd r s₁).trans f) (InitialSeg.leAdd r s₂) a
            have : ∀ b, { b' // f (Sum.inr b) = Sum.inr b' } := by
              intro b; cases e : f (Sum.inr b)
              · rw [← fl] at e
                have := f.inj' e
                contradiction
              · exact ⟨_, rfl⟩
            let g (b) := (this b).1
            have fr : ∀ b, f (Sum.inr b) = Sum.inr (g b) := fun b => (this b).2
            ⟨⟨⟨g, fun x y h => by
                  injection f.inj' (by rw [fr, fr, h] : f (Sum.inr x) = f (Sum.inr y))⟩,
                @fun a b => by
                  -- Porting note:
                  --  `relEmbedding.coe_fn_to_embedding` & `initial_seg.coe_fn_to_rel_embedding`
                  --  → `InitialSeg.coe_coe_fn`
                  simpa only [Sum.lex_inr_inr, fr, InitialSeg.coe_coe_fn, Embedding.coeFn_mk] using
                    @RelEmbedding.map_rel_iff _ _ _ _ f.toRelEmbedding (Sum.inr a) (Sum.inr b)⟩,
              fun a b H => by
                rcases f.init (by rw [fr] <;> exact Sum.lex_inr_inr.2 H) with ⟨a' | a', h⟩
                · rw [fl] at h
                  

Proof state:
case intro.inl
α✝ : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α✝ → α✝ → Prop
s : β → β → Prop
t : γ → γ → Prop
a✝ b✝ c : Ordinal.{u}
α : Type u
r : α → α → Prop
hr : IsWellOrder α r
β₁ : Type u
s₁ : β₁ → β₁ → Prop
hs₁ : IsWellOrder β₁ s₁
β₂ : Type u
s₂ : β₂ → β₂ → Prop
hs₂ : IsWellOrder β₂ s₂
x✝ : type r + type s₁ ≤ type r + type s₂
f : Sum.Lex r s₁ ≼i Sum.Lex r s₂
fl : ∀ (a : α), f (Sum.inl a) = Sum.inl a
this : (b : β₁) → { b' // f (Sum.inr b) = Sum.inr b' }
g : β₁ → β₂ := fun b => ↑(this b)
fr : ∀ (b : β₁), f (Sum.inr b) = Sum.inr (g b)
a : β₁
b : β₂
H :
  s₂ b
    ({ toEmbedding := { toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) },
        map_rel_iff' :=
          (_ :
            ∀ (a b : β₁),
              s₂ ({ toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) } a)
                  ({ toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) } b) ↔
                s₁ a b) }
      a)
a' : α
h : Sum.inl a' = Sum.inr b
⊢ ∃ a',
    { toEmbedding := { toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) },
          map_rel_iff' :=
            (_ :
              ∀ (a b : β₁),
                s₂ ({ toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) } a)
                    ({ toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) } b) ↔
                  s₁ a b) }
        a' =
      b

Next tactic:
cases h
instance add_contravariantClass_le : ContravariantClass Ordinal.{u} Ordinal.{u} (· + ·) (· ≤ ·) :=
  ⟨fun a b c =>
    inductionOn a fun α r hr =>
      inductionOn b fun β₁ s₁ hs₁ =>
        inductionOn c fun β₂ s₂ hs₂ ⟨f⟩ =>
          ⟨have fl : ∀ a, f (Sum.inl a) = Sum.inl a := fun a => by
              simpa only [InitialSeg.trans_apply, InitialSeg.leAdd_apply] using
                @InitialSeg.eq _ _ _ _ _
                  ((InitialSeg.leAdd r s₁).trans f) (InitialSeg.leAdd r s₂) a
            have : ∀ b, { b' // f (Sum.inr b) = Sum.inr b' } := by
              intro b; cases e : f (Sum.inr b)
              · rw [← fl] at e
                have := f.inj' e
                contradiction
              · exact ⟨_, rfl⟩
            let g (b) := (this b).1
            have fr : ∀ b, f (Sum.inr b) = Sum.inr (g b) := fun b => (this b).2
            ⟨⟨⟨g, fun x y h => by
                  injection f.inj' (by rw [fr, fr, h] : f (Sum.inr x) = f (Sum.inr y))⟩,
                @fun a b => by
                  -- Porting note:
                  --  `relEmbedding.coe_fn_to_embedding` & `initial_seg.coe_fn_to_rel_embedding`
                  --  → `InitialSeg.coe_coe_fn`
                  simpa only [Sum.lex_inr_inr, fr, InitialSeg.coe_coe_fn, Embedding.coeFn_mk] using
                    @RelEmbedding.map_rel_iff _ _ _ _ f.toRelEmbedding (Sum.inr a) (Sum.inr b)⟩,
              fun a b H => by
                rcases f.init (by rw [fr] <;> exact Sum.lex_inr_inr.2 H) with ⟨a' | a', h⟩
                · rw [fl] at h
                  cases h
                · 

Proof state:
case intro.inr
α✝ : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α✝ → α✝ → Prop
s : β → β → Prop
t : γ → γ → Prop
a✝ b✝ c : Ordinal.{u}
α : Type u
r : α → α → Prop
hr : IsWellOrder α r
β₁ : Type u
s₁ : β₁ → β₁ → Prop
hs₁ : IsWellOrder β₁ s₁
β₂ : Type u
s₂ : β₂ → β₂ → Prop
hs₂ : IsWellOrder β₂ s₂
x✝ : type r + type s₁ ≤ type r + type s₂
f : Sum.Lex r s₁ ≼i Sum.Lex r s₂
fl : ∀ (a : α), f (Sum.inl a) = Sum.inl a
this : (b : β₁) → { b' // f (Sum.inr b) = Sum.inr b' }
g : β₁ → β₂ := fun b => ↑(this b)
fr : ∀ (b : β₁), f (Sum.inr b) = Sum.inr (g b)
a : β₁
b : β₂
H :
  s₂ b
    ({ toEmbedding := { toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) },
        map_rel_iff' :=
          (_ :
            ∀ (a b : β₁),
              s₂ ({ toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) } a)
                  ({ toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) } b) ↔
                s₁ a b) }
      a)
a' : β₁
h : f (Sum.inr a') = Sum.inr b
⊢ ∃ a',
    { toEmbedding := { toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) },
          map_rel_iff' :=
            (_ :
              ∀ (a b : β₁),
                s₂ ({ toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) } a)
                    ({ toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) } b) ↔
                  s₁ a b) }
        a' =
      b

Next tactic:
rw [fr] at h
instance add_contravariantClass_le : ContravariantClass Ordinal.{u} Ordinal.{u} (· + ·) (· ≤ ·) :=
  ⟨fun a b c =>
    inductionOn a fun α r hr =>
      inductionOn b fun β₁ s₁ hs₁ =>
        inductionOn c fun β₂ s₂ hs₂ ⟨f⟩ =>
          ⟨have fl : ∀ a, f (Sum.inl a) = Sum.inl a := fun a => by
              simpa only [InitialSeg.trans_apply, InitialSeg.leAdd_apply] using
                @InitialSeg.eq _ _ _ _ _
                  ((InitialSeg.leAdd r s₁).trans f) (InitialSeg.leAdd r s₂) a
            have : ∀ b, { b' // f (Sum.inr b) = Sum.inr b' } := by
              intro b; cases e : f (Sum.inr b)
              · rw [← fl] at e
                have := f.inj' e
                contradiction
              · exact ⟨_, rfl⟩
            let g (b) := (this b).1
            have fr : ∀ b, f (Sum.inr b) = Sum.inr (g b) := fun b => (this b).2
            ⟨⟨⟨g, fun x y h => by
                  injection f.inj' (by rw [fr, fr, h] : f (Sum.inr x) = f (Sum.inr y))⟩,
                @fun a b => by
                  -- Porting note:
                  --  `relEmbedding.coe_fn_to_embedding` & `initial_seg.coe_fn_to_rel_embedding`
                  --  → `InitialSeg.coe_coe_fn`
                  simpa only [Sum.lex_inr_inr, fr, InitialSeg.coe_coe_fn, Embedding.coeFn_mk] using
                    @RelEmbedding.map_rel_iff _ _ _ _ f.toRelEmbedding (Sum.inr a) (Sum.inr b)⟩,
              fun a b H => by
                rcases f.init (by rw [fr] <;> exact Sum.lex_inr_inr.2 H) with ⟨a' | a', h⟩
                · rw [fl] at h
                  cases h
                · rw [fr] at h
                  

Proof state:
case intro.inr
α✝ : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α✝ → α✝ → Prop
s : β → β → Prop
t : γ → γ → Prop
a✝ b✝ c : Ordinal.{u}
α : Type u
r : α → α → Prop
hr : IsWellOrder α r
β₁ : Type u
s₁ : β₁ → β₁ → Prop
hs₁ : IsWellOrder β₁ s₁
β₂ : Type u
s₂ : β₂ → β₂ → Prop
hs₂ : IsWellOrder β₂ s₂
x✝ : type r + type s₁ ≤ type r + type s₂
f : Sum.Lex r s₁ ≼i Sum.Lex r s₂
fl : ∀ (a : α), f (Sum.inl a) = Sum.inl a
this : (b : β₁) → { b' // f (Sum.inr b) = Sum.inr b' }
g : β₁ → β₂ := fun b => ↑(this b)
fr : ∀ (b : β₁), f (Sum.inr b) = Sum.inr (g b)
a : β₁
b : β₂
H :
  s₂ b
    ({ toEmbedding := { toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) },
        map_rel_iff' :=
          (_ :
            ∀ (a b : β₁),
              s₂ ({ toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) } a)
                  ({ toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) } b) ↔
                s₁ a b) }
      a)
a' : β₁
h : Sum.inr (g a') = Sum.inr b
⊢ ∃ a',
    { toEmbedding := { toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) },
          map_rel_iff' :=
            (_ :
              ∀ (a b : β₁),
                s₂ ({ toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) } a)
                    ({ toFun := g, inj' := (_ : ∀ (x y : β₁), g x = g y → x = y) } b) ↔
                  s₁ a b) }
        a' =
      b

Next tactic:
exact ⟨a', Sum.inr.inj h⟩
theorem add_left_cancel (a) {b c : Ordinal} : a + b = a + c ↔ b = c := by
  

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

Next tactic:
simp only [le_antisymm_iff, add_le_add_iff_left]
private theorem add_lt_add_iff_left' (a) {b c : Ordinal} : a + b < a + c ↔ b < c := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b c : Ordinal.{u_4}
⊢ a + b < a + c ↔ b < c

Next tactic:
rw [← not_le, ← not_le, add_le_add_iff_left]
theorem add_le_add_iff_right {a b : Ordinal} : ∀ n : ℕ, a + n ≤ b + n ↔ a ≤ b
  | 0 => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b : Ordinal.{u_4}
⊢ a + ↑0 ≤ b + ↑0 ↔ a ≤ b

Next tactic:
simp
theorem add_le_add_iff_right {a b : Ordinal} : ∀ n : ℕ, a + n ≤ b + n ↔ a ≤ b
  | 0 => by simp
  | n + 1 => by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b : Ordinal.{u_4}
n : ℕ
⊢ a + ↑(n + 1) ≤ b + ↑(n + 1) ↔ a ≤ b

Next tactic:
simp only [nat_cast_succ, add_succ, add_succ, succ_le_succ_iff, add_le_add_iff_right]
theorem add_right_cancel {a b : Ordinal} (n : ℕ) : a + n = b + n ↔ a = b := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b : Ordinal.{u_4}
n : ℕ
⊢ a + ↑n = b + ↑n ↔ a = b

Next tactic:
simp only [le_antisymm_iff, add_le_add_iff_right]
theorem add_eq_zero_iff {a b : Ordinal} : a + b = 0 ↔ a = 0 ∧ b = 0 :=
  inductionOn a fun α r _ =>
    inductionOn b fun β s _ => by
      

Proof state:
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
a b : Ordinal.{u_4}
α : Type u_4
r : α → α → Prop
x✝¹ : IsWellOrder α r
β : Type u_4
s : β → β → Prop
x✝ : IsWellOrder β s
⊢ type r + type s = 0 ↔ type r = 0 ∧ type s = 0

Next tactic:
simp_rw [← type_sum_lex, type_eq_zero_iff_isEmpty]
theorem add_eq_zero_iff {a b : Ordinal} : a + b = 0 ↔ a = 0 ∧ b = 0 :=
  inductionOn a fun α r _ =>
    inductionOn b fun β s _ => by
      simp_rw [← type_sum_lex, type_eq_zero_iff_isEmpty]
      

Proof state:
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
a b : Ordinal.{u_4}
α : Type u_4
r : α → α → Prop
x✝¹ : IsWellOrder α r
β : Type u_4
s : β → β → Prop
x✝ : IsWellOrder β s
⊢ IsEmpty (α ⊕ β) ↔ IsEmpty α ∧ IsEmpty β

Next tactic:
exact isEmpty_sum
@[simp]
theorem pred_succ (o) : pred (succ o) = o := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_4}
⊢ pred (succ o) = o

Next tactic:
have h : ∃ a, succ o = succ a := ⟨_, rfl⟩
@[simp]
theorem pred_succ (o) : pred (succ o) = o := by
  have h : ∃ a, succ o = succ a := ⟨_, rfl⟩;
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_4}
h : ∃ a, succ o = succ a
⊢ pred (succ o) = o

Next tactic:
simpa only [pred, dif_pos h] using (succ_injective <| Classical.choose_spec h).symm
theorem pred_le_self (o) : pred o ≤ o :=
  if h : ∃ a, o = succ a then by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_4}
h : ∃ a, o = succ a
⊢ pred o ≤ o

Next tactic:
let ⟨a, e⟩ := h
theorem pred_le_self (o) : pred o ≤ o :=
  if h : ∃ a, o = succ a then by
    let ⟨a, e⟩ := h
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_4}
h : ∃ a, o = succ a
a : Ordinal.{u_4}
e : o = succ a
⊢ pred o ≤ o

Next tactic:
rw [e, pred_succ]
theorem pred_le_self (o) : pred o ≤ o :=
  if h : ∃ a, o = succ a then by
    let ⟨a, e⟩ := h
    rw [e, pred_succ]; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_4}
h : ∃ a, o = succ a
a : Ordinal.{u_4}
e : o = succ a
⊢ a ≤ succ a

Next tactic:
exact le_succ a
theorem pred_le_self (o) : pred o ≤ o :=
  if h : ∃ a, o = succ a then by
    let ⟨a, e⟩ := h
    rw [e, pred_succ]; exact le_succ a
  else by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_4}
h : ¬∃ a, o = succ a
⊢ pred o ≤ o

Next tactic:
rw [pred, dif_neg h]
theorem pred_eq_iff_not_succ {o} : pred o = o ↔ ¬∃ a, o = succ a :=
  ⟨fun e ⟨a, e'⟩ => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_4}
e : pred o = o
x✝ : ∃ a, o = succ a
a : Ordinal.{u_4}
e' : o = succ a
⊢ False

Next tactic:
rw [e', pred_succ] at e
theorem pred_eq_iff_not_succ {o} : pred o = o ↔ ¬∃ a, o = succ a :=
  ⟨fun e ⟨a, e'⟩ => by rw [e', pred_succ] at e; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_4}
x✝ : ∃ a, o = succ a
a : Ordinal.{u_4}
e : a = succ a
e' : o = succ a
⊢ False

Next tactic:
exact (lt_succ a).ne e
theorem pred_eq_iff_not_succ' {o} : pred o = o ↔ ∀ a, o ≠ succ a := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_4}
⊢ pred o = o ↔ ∀ (a : Ordinal.{u_4}), o ≠ succ a

Next tactic:
simpa using pred_eq_iff_not_succ
theorem pred_lt_iff_is_succ {o} : pred o < o ↔ ∃ a, o = succ a :=
  Iff.trans (by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_4}
⊢ pred o < o ↔ ¬pred o = o

Next tactic:
simp only [le_antisymm_iff, pred_le_self, true_and_iff, not_le]
theorem succ_pred_iff_is_succ {o} : succ (pred o) = o ↔ ∃ a, o = succ a :=
  ⟨fun e => ⟨_, e.symm⟩, fun ⟨a, e⟩ => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_4}
x✝ : ∃ a, o = succ a
a : Ordinal.{u_4}
e : o = succ a
⊢ succ (pred o) = o

Next tactic:
simp only [e, pred_succ]
theorem lt_pred {a b} : a < pred b ↔ succ a < b :=
  if h : ∃ a, b = succ a then by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b : Ordinal.{u_4}
h : ∃ a, b = succ a
⊢ a < pred b ↔ succ a < b

Next tactic:
let ⟨c, e⟩ := h
theorem lt_pred {a b} : a < pred b ↔ succ a < b :=
  if h : ∃ a, b = succ a then by
    let ⟨c, e⟩ := h
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b : Ordinal.{u_4}
h : ∃ a, b = succ a
c : Ordinal.{u_4}
e : b = succ c
⊢ a < pred b ↔ succ a < b

Next tactic:
rw [e, pred_succ, succ_lt_succ_iff]
theorem lt_pred {a b} : a < pred b ↔ succ a < b :=
  if h : ∃ a, b = succ a then by
    let ⟨c, e⟩ := h
    rw [e, pred_succ, succ_lt_succ_iff]
  else by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b : Ordinal.{u_4}
h : ¬∃ a, b = succ a
⊢ a < pred b ↔ succ a < b

Next tactic:
simp only [pred, dif_neg h, succ_lt_of_not_succ h]
@[simp]
theorem lift_is_succ {o : Ordinal.{v}} : (∃ a, lift.{u} o = succ a) ↔ ∃ a, o = succ a :=
  ⟨fun ⟨a, h⟩ =>
    let ⟨b, e⟩ := lift_down <| show a ≤ lift.{u} o from le_of_lt <| h.symm ▸ lt_succ a
    ⟨b, lift_inj.1 <| by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{v}
x✝ : ∃ a, lift.{u, v} o = succ a
a : Ordinal.{max v u}
h : lift.{u, v} o = succ a
b : Ordinal.{v}
e : lift.{u, v} b = a
⊢ lift.{?u.92157, v} o = lift.{?u.92157, v} (succ b)

Next tactic:
rw [h, ← e, lift_succ]
@[simp]
theorem lift_is_succ {o : Ordinal.{v}} : (∃ a, lift.{u} o = succ a) ↔ ∃ a, o = succ a :=
  ⟨fun ⟨a, h⟩ =>
    let ⟨b, e⟩ := lift_down <| show a ≤ lift.{u} o from le_of_lt <| h.symm ▸ lt_succ a
    ⟨b, lift_inj.1 <| by rw [h, ← e, lift_succ]⟩,
    fun ⟨a, h⟩ => ⟨lift.{u} a, by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{v}
x✝ : ∃ a, o = succ a
a : Ordinal.{v}
h : o = succ a
⊢ lift.{u, v} o = succ (lift.{u, v} a)

Next tactic:
simp only [h, lift_succ]
@[simp]
theorem lift_pred (o : Ordinal.{v}) : lift.{u} (pred o) = pred (lift.{u} o) :=
  if h : ∃ a, o = succ a then by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{v}
h : ∃ a, o = succ a
⊢ lift.{u, v} (pred o) = pred (lift.{u, v} o)

Next tactic:
cases' h with a e
@[simp]
theorem lift_pred (o : Ordinal.{v}) : lift.{u} (pred o) = pred (lift.{u} o) :=
  if h : ∃ a, o = succ a then by cases' h with a e; 

Proof state:
case intro
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o a : Ordinal.{v}
e : o = succ a
⊢ lift.{u, v} (pred o) = pred (lift.{u, v} o)

Next tactic:
simp only [e, pred_succ, lift_succ]
@[simp]
theorem lift_pred (o : Ordinal.{v}) : lift.{u} (pred o) = pred (lift.{u} o) :=
  if h : ∃ a, o = succ a then by cases' h with a e; simp only [e, pred_succ, lift_succ]
  else by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{v}
h : ¬∃ a, o = succ a
⊢ lift.{u, v} (pred o) = pred (lift.{u, v} o)

Next tactic:
rw [pred_eq_iff_not_succ.2 h, pred_eq_iff_not_succ.2 (mt lift_is_succ.1 h)]
theorem lt_limit {o} (h : IsLimit o) {a} : a < o ↔ ∃ x < o, a < x := by
  -- Porting note: `bex_def` is required.
  

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

Next tactic:
simpa only [not_ball, not_le, bex_def] using not_congr (@limit_le _ h a)
@[simp]
theorem lift_isLimit (o) : IsLimit (lift o) ↔ IsLimit o :=
  and_congr (not_congr <| by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_4}
⊢ lift.{u_5, u_4} o = 0 ↔ o = 0

Next tactic:
simpa only [lift_zero] using @lift_inj o 0
@[simp]
theorem lift_isLimit (o) : IsLimit (lift o) ↔ IsLimit o :=
  and_congr (not_congr <| by simpa only [lift_zero] using @lift_inj o 0)
    ⟨fun H a h => lift_lt.1 <| by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_4}
H : ∀ a < lift.{u_5, u_4} o, succ a < lift.{u_5, u_4} o
a : Ordinal.{u_4}
h : a < o
⊢ lift.{?u.95923, u_4} (succ a) < lift.{?u.95923, u_4} o

Next tactic:
simpa only [lift_succ] using H _ (lift_lt.2 h)
@[simp]
theorem lift_isLimit (o) : IsLimit (lift o) ↔ IsLimit o :=
  and_congr (not_congr <| by simpa only [lift_zero] using @lift_inj o 0)
    ⟨fun H a h => lift_lt.1 <| by simpa only [lift_succ] using H _ (lift_lt.2 h), fun H a h => by
      

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_4}
H : ∀ a < o, succ a < o
a : Ordinal.{max u_4 u_5}
h : a < lift.{u_5, u_4} o
⊢ succ a < lift.{u_5, u_4} o

Next tactic:
obtain ⟨a', rfl⟩ := lift_down h.le
@[simp]
theorem lift_isLimit (o) : IsLimit (lift o) ↔ IsLimit o :=
  and_congr (not_congr <| by simpa only [lift_zero] using @lift_inj o 0)
    ⟨fun H a h => lift_lt.1 <| by simpa only [lift_succ] using H _ (lift_lt.2 h), fun H a h => by
      obtain ⟨a', rfl⟩ := lift_down h.le
      

Proof state:
case intro
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_4}
H : ∀ a < o, succ a < o
a' : Ordinal.{u_4}
h : lift.{u_5, u_4} a' < lift.{u_5, u_4} o
⊢ succ (lift.{u_5, u_4} a') < lift.{u_5, u_4} o

Next tactic:
rw [← lift_succ, lift_lt]
@[simp]
theorem lift_isLimit (o) : IsLimit (lift o) ↔ IsLimit o :=
  and_congr (not_congr <| by simpa only [lift_zero] using @lift_inj o 0)
    ⟨fun H a h => lift_lt.1 <| by simpa only [lift_succ] using H _ (lift_lt.2 h), fun H a h => by
      obtain ⟨a', rfl⟩ := lift_down h.le
      rw [← lift_succ, lift_lt]
      

Proof state:
case intro
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_4}
H : ∀ a < o, succ a < o
a' : Ordinal.{u_4}
h : lift.{u_5, u_4} a' < lift.{u_5, u_4} o
⊢ succ a' < o

Next tactic:
exact H a' (lift_lt.1 h)
theorem IsLimit.one_lt {o : Ordinal} (h : IsLimit o) : 1 < o := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_4}
h : IsLimit o
⊢ 1 < o

Next tactic:
simpa only [succ_zero] using h.2 _ h.pos