l3lab/ntp-mathlib huggingface dataset:
theorem lt_univ {c} : c < univ.{u, u + 1} ↔ ∃ c', c = lift.{u + 1, u} c' :=
  ⟨fun h => by
    have := ord_lt_ord.2 h
    rw [ord_univ] at this
    cases' lift.principalSeg.{u, u + 1}.down.1 (by simpa only [lift.principalSeg_top] ) with o e
    have := card_ord c
    rw [← e, lift.principalSeg_coe, ← lift_card] at this
    

Proof state:
case intro
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
c : Cardinal.{u + 1}
h : c < univ.{u, u + 1}
this✝ : ord c < Ordinal.univ.{u, u + 1}
o : Ordinal.{u}
e : lift.principalSeg.toRelEmbedding o = ord c
this : lift.{u + 1, u} (card o) = c
⊢ ∃ c', c = lift.{u + 1, u} c'

Next tactic:
exact ⟨_, this.symm⟩
theorem lt_univ' {c} : c < univ.{u, v} ↔ ∃ c', c = lift.{max (u + 1) v, u} c' :=
  ⟨fun h => by
    

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
c : Cardinal.{max (u + 1) v}
h : c < univ.{u, v}
⊢ ∃ c', c = lift.{max (u + 1) v, u} c'

Next tactic:
let ⟨a, e, h'⟩ := lt_lift_iff.1 h
theorem lt_univ' {c} : c < univ.{u, v} ↔ ∃ c', c = lift.{max (u + 1) v, u} c' :=
  ⟨fun h => by
    let ⟨a, e, h'⟩ := lt_lift_iff.1 h
    

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
c : Cardinal.{max (u + 1) v}
h : c < univ.{u, v}
a : Cardinal.{u + 1}
e : lift.{v, u + 1} a = c
h' : a < #Ordinal.{u}
⊢ ∃ c', c = lift.{max (u + 1) v, u} c'

Next tactic:
rw [← univ_id] at h'
theorem lt_univ' {c} : c < univ.{u, v} ↔ ∃ c', c = lift.{max (u + 1) v, u} c' :=
  ⟨fun h => by
    let ⟨a, e, h'⟩ := lt_lift_iff.1 h
    rw [← univ_id] at h'
    

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
c : Cardinal.{max (u + 1) v}
h : c < univ.{u, v}
a : Cardinal.{u + 1}
e : lift.{v, u + 1} a = c
h' : a < univ.{u, u + 1}
⊢ ∃ c', c = lift.{max (u + 1) v, u} c'

Next tactic:
rcases lt_univ.{u}.1 h' with ⟨c', rfl⟩
theorem lt_univ' {c} : c < univ.{u, v} ↔ ∃ c', c = lift.{max (u + 1) v, u} c' :=
  ⟨fun h => by
    let ⟨a, e, h'⟩ := lt_lift_iff.1 h
    rw [← univ_id] at h'
    rcases lt_univ.{u}.1 h' with ⟨c', rfl⟩
    

Proof state:
case intro
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
c : Cardinal.{max (u + 1) v}
h : c < univ.{u, v}
c' : Cardinal.{u}
e : lift.{v, u + 1} (lift.{u + 1, u} c') = c
h' : lift.{u + 1, u} c' < univ.{u, u + 1}
⊢ ∃ c', c = lift.{max (u + 1) v, u} c'

Next tactic:
exact ⟨c', by simp only [e.symm, lift_lift]⟩
theorem lt_univ' {c} : c < univ.{u, v} ↔ ∃ c', c = lift.{max (u + 1) v, u} c' :=
  ⟨fun h => by
    let ⟨a, e, h'⟩ := lt_lift_iff.1 h
    rw [← univ_id] at h'
    rcases lt_univ.{u}.1 h' with ⟨c', rfl⟩
    exact ⟨c', by 

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
c : Cardinal.{max (u + 1) v}
h : c < univ.{u, v}
c' : Cardinal.{u}
e : lift.{v, u + 1} (lift.{u + 1, u} c') = c
h' : lift.{u + 1, u} c' < univ.{u, u + 1}
⊢ c = lift.{max (u + 1) v, u} c'

Next tactic:
simp only [e.symm, lift_lift]
theorem small_iff_lift_mk_lt_univ {α : Type u} :
    Small.{v} α ↔ Cardinal.lift.{v+1,_} #α < univ.{v, max u (v + 1)} := by
  

Proof state:
α✝ : Type u
β : Type u_1
γ : Type u_2
r : α✝ → α✝ → Prop
s : β → β → Prop
t : γ → γ → Prop
α : Type u
⊢ Small.{v, u} α ↔ lift.{v + 1, u} #α < univ.{v, max u (v + 1)}

Next tactic:
rw [lt_univ']
theorem small_iff_lift_mk_lt_univ {α : Type u} :
    Small.{v} α ↔ Cardinal.lift.{v+1,_} #α < univ.{v, max u (v + 1)} := by
  rw [lt_univ']
  

Proof state:
α✝ : Type u
β : Type u_1
γ : Type u_2
r : α✝ → α✝ → Prop
s : β → β → Prop
t : γ → γ → Prop
α : Type u
⊢ Small.{v, u} α ↔ ∃ c', lift.{v + 1, u} #α = lift.{max u (v + 1), v} c'

Next tactic:
constructor
theorem small_iff_lift_mk_lt_univ {α : Type u} :
    Small.{v} α ↔ Cardinal.lift.{v+1,_} #α < univ.{v, max u (v + 1)} := by
  rw [lt_univ']
  constructor
  · 

Proof state:
case mp
α✝ : Type u
β : Type u_1
γ : Type u_2
r : α✝ → α✝ → Prop
s : β → β → Prop
t : γ → γ → Prop
α : Type u
⊢ Small.{v, u} α → ∃ c', lift.{v + 1, u} #α = lift.{max u (v + 1), v} c'

Next tactic:
rintro ⟨β, e⟩
theorem small_iff_lift_mk_lt_univ {α : Type u} :
    Small.{v} α ↔ Cardinal.lift.{v+1,_} #α < univ.{v, max u (v + 1)} := by
  rw [lt_univ']
  constructor
  · rintro ⟨β, e⟩
    

Proof state:
case mp.mk.intro
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r : α✝ → α✝ → Prop
s : β✝ → β✝ → Prop
t : γ → γ → Prop
α : Type u
β : Type v
e : Nonempty (α ≃ β)
⊢ ∃ c', lift.{v + 1, u} #α = lift.{max u (v + 1), v} c'

Next tactic:
exact ⟨#β, lift_mk_eq.{u, _, v + 1}.2 e⟩
theorem small_iff_lift_mk_lt_univ {α : Type u} :
    Small.{v} α ↔ Cardinal.lift.{v+1,_} #α < univ.{v, max u (v + 1)} := by
  rw [lt_univ']
  constructor
  · rintro ⟨β, e⟩
    exact ⟨#β, lift_mk_eq.{u, _, v + 1}.2 e⟩
  · 

Proof state:
case mpr
α✝ : Type u
β : Type u_1
γ : Type u_2
r : α✝ → α✝ → Prop
s : β → β → Prop
t : γ → γ → Prop
α : Type u
⊢ (∃ c', lift.{v + 1, u} #α = lift.{max u (v + 1), v} c') → Small.{v, u} α

Next tactic:
rintro ⟨c, hc⟩
theorem small_iff_lift_mk_lt_univ {α : Type u} :
    Small.{v} α ↔ Cardinal.lift.{v+1,_} #α < univ.{v, max u (v + 1)} := by
  rw [lt_univ']
  constructor
  · rintro ⟨β, e⟩
    exact ⟨#β, lift_mk_eq.{u, _, v + 1}.2 e⟩
  · rintro ⟨c, hc⟩
    

Proof state:
case mpr.intro
α✝ : Type u
β : Type u_1
γ : Type u_2
r : α✝ → α✝ → Prop
s : β → β → Prop
t : γ → γ → Prop
α : Type u
c : Cardinal.{v}
hc : lift.{v + 1, u} #α = lift.{max u (v + 1), v} c
⊢ Small.{v, u} α

Next tactic:
exact ⟨⟨c.out, lift_mk_eq.{u, _, v + 1}.1 (hc.trans (congr rfl c.mk_out.symm))⟩⟩
@[simp]
theorem nat_le_card {o} {n : ℕ} : (n : Cardinal) ≤ card o ↔ (n : Ordinal) ≤ o := by
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_3}
n : ℕ
⊢ ↑n ≤ card o ↔ ↑n ≤ o

Next tactic:
rw [← Cardinal.ord_le, Cardinal.ord_nat]
@[simp]
theorem nat_lt_card {o} {n : ℕ} : (n : Cardinal) < card o ↔ (n : Ordinal) < o := by
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_3}
n : ℕ
⊢ ↑n < card o ↔ ↑n < o

Next tactic:
rw [← succ_le_iff, ← succ_le_iff, ← nat_succ, nat_le_card]
@[simp]
theorem nat_lt_card {o} {n : ℕ} : (n : Cardinal) < card o ↔ (n : Ordinal) < o := by
  rw [← succ_le_iff, ← succ_le_iff, ← nat_succ, nat_le_card]
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_3}
n : ℕ
⊢ ↑(Nat.succ n) ≤ o ↔ succ ↑n ≤ o

Next tactic:
rfl
@[simp]
theorem card_eq_nat {o} {n : ℕ} : card o = n ↔ o = n := by
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_3}
n : ℕ
⊢ card o = ↑n ↔ o = ↑n

Next tactic:
simp only [le_antisymm_iff, card_le_nat, nat_le_card]
@[simp]
theorem type_fintype (r : α → α → Prop) [IsWellOrder α r] [Fintype α] : type r = Fintype.card α :=
  by 

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r✝ : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
r : α → α → Prop
inst✝¹ : IsWellOrder α r
inst✝ : Fintype α
⊢ type r = ↑(Fintype.card α)

Next tactic:
rw [← card_eq_nat, card_type, mk_fintype]
theorem type_fin (n : ℕ) : @type (Fin n) (· < ·) _ = n := by 

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
n : ℕ
⊢ (type fun x x_1 => x < x_1) = ↑n

Next tactic:
simp
theorem List.Sorted.lt_ord_of_lt [LinearOrder α] [IsWellOrder α (· < ·)] {l m : List α}
    {o : Ordinal} (hl : l.Sorted (· > ·)) (hm : m.Sorted (· > ·)) (hmltl : m < l)
    (hlt : ∀ i ∈ l, Ordinal.typein (· < ·) i < o) : ∀ i ∈ m, Ordinal.typein (· < ·) i < o := by
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝¹ : LinearOrder α
inst✝ : IsWellOrder α fun x x_1 => x < x_1
l m : List α
o : Ordinal.{u}
hl : Sorted (fun x x_1 => x > x_1) l
hm : Sorted (fun x x_1 => x > x_1) m
hmltl : m < l
hlt : ∀ i ∈ l, Ordinal.typein (fun x x_1 => x < x_1) i < o
⊢ ∀ i ∈ m, Ordinal.typein (fun x x_1 => x < x_1) i < o

Next tactic:
replace hmltl : List.Lex (· < ·) m l := hmltl
theorem List.Sorted.lt_ord_of_lt [LinearOrder α] [IsWellOrder α (· < ·)] {l m : List α}
    {o : Ordinal} (hl : l.Sorted (· > ·)) (hm : m.Sorted (· > ·)) (hmltl : m < l)
    (hlt : ∀ i ∈ l, Ordinal.typein (· < ·) i < o) : ∀ i ∈ m, Ordinal.typein (· < ·) i < o := by
  replace hmltl : List.Lex (· < ·) m l := hmltl
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝¹ : LinearOrder α
inst✝ : IsWellOrder α fun x x_1 => x < x_1
l m : List α
o : Ordinal.{u}
hl : Sorted (fun x x_1 => x > x_1) l
hm : Sorted (fun x x_1 => x > x_1) m
hlt : ∀ i ∈ l, Ordinal.typein (fun x x_1 => x < x_1) i < o
hmltl : Lex (fun x x_1 => x < x_1) m l
⊢ ∀ i ∈ m, Ordinal.typein (fun x x_1 => x < x_1) i < o

Next tactic:
cases l with
  | nil => simp at hmltl
  | cons a as =>
    cases m with
    | nil => intro i hi; simp at hi
    | cons b bs =>
      intro i hi
      suffices h : i ≤ a by refine lt_of_le_of_lt ?_ (hlt a (mem_cons_self a as)); simpa
      cases hi with
      | head as => exact List.head_le_of_lt hmltl
      | tail b hi => exact le_of_lt (lt_of_lt_of_le (List.rel_of_sorted_cons hm _ hi)
          (List.head_le_of_lt hmltl))
theorem List.Sorted.lt_ord_of_lt [LinearOrder α] [IsWellOrder α (· < ·)] {l m : List α}
    {o : Ordinal} (hl : l.Sorted (· > ·)) (hm : m.Sorted (· > ·)) (hmltl : m < l)
    (hlt : ∀ i ∈ l, Ordinal.typein (· < ·) i < o) : ∀ i ∈ m, Ordinal.typein (· < ·) i < o := by
  replace hmltl : List.Lex (· < ·) m l := hmltl
  cases l with
  

Proof state:
case nil
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝¹ : LinearOrder α
inst✝ : IsWellOrder α fun x x_1 => x < x_1
m : List α
o : Ordinal.{u}
hm : Sorted (fun x x_1 => x > x_1) m
hl : Sorted (fun x x_1 => x > x_1) []
hlt : ∀ i ∈ [], Ordinal.typein (fun x x_1 => x < x_1) i < o
hmltl : Lex (fun x x_1 => x < x_1) m []
⊢ ∀ i ∈ m, Ordinal.typein (fun x x_1 => x < x_1) i < o

Next tactic:
| nil => simp at hmltl
theorem List.Sorted.lt_ord_of_lt [LinearOrder α] [IsWellOrder α (· < ·)] {l m : List α}
    {o : Ordinal} (hl : l.Sorted (· > ·)) (hm : m.Sorted (· > ·)) (hmltl : m < l)
    (hlt : ∀ i ∈ l, Ordinal.typein (· < ·) i < o) : ∀ i ∈ m, Ordinal.typein (· < ·) i < o := by
  replace hmltl : List.Lex (· < ·) m l := hmltl
  cases l with
  | nil => 

Proof state:
case nil
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝¹ : LinearOrder α
inst✝ : IsWellOrder α fun x x_1 => x < x_1
m : List α
o : Ordinal.{u}
hm : Sorted (fun x x_1 => x > x_1) m
hl : Sorted (fun x x_1 => x > x_1) []
hlt : ∀ i ∈ [], Ordinal.typein (fun x x_1 => x < x_1) i < o
hmltl : Lex (fun x x_1 => x < x_1) m []
⊢ ∀ i ∈ m, Ordinal.typein (fun x x_1 => x < x_1) i < o

Next tactic:
simp at hmltl
theorem List.Sorted.lt_ord_of_lt [LinearOrder α] [IsWellOrder α (· < ·)] {l m : List α}
    {o : Ordinal} (hl : l.Sorted (· > ·)) (hm : m.Sorted (· > ·)) (hmltl : m < l)
    (hlt : ∀ i ∈ l, Ordinal.typein (· < ·) i < o) : ∀ i ∈ m, Ordinal.typein (· < ·) i < o := by
  replace hmltl : List.Lex (· < ·) m l := hmltl
  cases l with
  | nil => simp at hmltl
  

Proof state:
case cons
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝¹ : LinearOrder α
inst✝ : IsWellOrder α fun x x_1 => x < x_1
m : List α
o : Ordinal.{u}
hm : Sorted (fun x x_1 => x > x_1) m
a : α
as : List α
hl : Sorted (fun x x_1 => x > x_1) (a :: as)
hlt : ∀ i ∈ a :: as, Ordinal.typein (fun x x_1 => x < x_1) i < o
hmltl : Lex (fun x x_1 => x < x_1) m (a :: as)
⊢ ∀ i ∈ m, Ordinal.typein (fun x x_1 => x < x_1) i < o

Next tactic:
| cons a as =>
    cases m with
    | nil => intro i hi; simp at hi
    | cons b bs =>
      intro i hi
      suffices h : i ≤ a by refine lt_of_le_of_lt ?_ (hlt a (mem_cons_self a as)); simpa
      cases hi with
      | head as => exact List.head_le_of_lt hmltl
      | tail b hi => exact le_of_lt (lt_of_lt_of_le (List.rel_of_sorted_cons hm _ hi)
          (List.head_le_of_lt hmltl))
theorem List.Sorted.lt_ord_of_lt [LinearOrder α] [IsWellOrder α (· < ·)] {l m : List α}
    {o : Ordinal} (hl : l.Sorted (· > ·)) (hm : m.Sorted (· > ·)) (hmltl : m < l)
    (hlt : ∀ i ∈ l, Ordinal.typein (· < ·) i < o) : ∀ i ∈ m, Ordinal.typein (· < ·) i < o := by
  replace hmltl : List.Lex (· < ·) m l := hmltl
  cases l with
  | nil => simp at hmltl
  | cons a as =>
    

Proof state:
case cons
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝¹ : LinearOrder α
inst✝ : IsWellOrder α fun x x_1 => x < x_1
m : List α
o : Ordinal.{u}
hm : Sorted (fun x x_1 => x > x_1) m
a : α
as : List α
hl : Sorted (fun x x_1 => x > x_1) (a :: as)
hlt : ∀ i ∈ a :: as, Ordinal.typein (fun x x_1 => x < x_1) i < o
hmltl : Lex (fun x x_1 => x < x_1) m (a :: as)
⊢ ∀ i ∈ m, Ordinal.typein (fun x x_1 => x < x_1) i < o

Next tactic:
cases m with
    | nil => intro i hi; simp at hi
    | cons b bs =>
      intro i hi
      suffices h : i ≤ a by refine lt_of_le_of_lt ?_ (hlt a (mem_cons_self a as)); simpa
      cases hi with
      | head as => exact List.head_le_of_lt hmltl
      | tail b hi => exact le_of_lt (lt_of_lt_of_le (List.rel_of_sorted_cons hm _ hi)
          (List.head_le_of_lt hmltl))
theorem List.Sorted.lt_ord_of_lt [LinearOrder α] [IsWellOrder α (· < ·)] {l m : List α}
    {o : Ordinal} (hl : l.Sorted (· > ·)) (hm : m.Sorted (· > ·)) (hmltl : m < l)
    (hlt : ∀ i ∈ l, Ordinal.typein (· < ·) i < o) : ∀ i ∈ m, Ordinal.typein (· < ·) i < o := by
  replace hmltl : List.Lex (· < ·) m l := hmltl
  cases l with
  | nil => simp at hmltl
  | cons a as =>
    cases m with
    

Proof state:
case cons.nil
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝¹ : LinearOrder α
inst✝ : IsWellOrder α fun x x_1 => x < x_1
o : Ordinal.{u}
a : α
as : List α
hl : Sorted (fun x x_1 => x > x_1) (a :: as)
hlt : ∀ i ∈ a :: as, Ordinal.typein (fun x x_1 => x < x_1) i < o
hm : Sorted (fun x x_1 => x > x_1) []
hmltl : Lex (fun x x_1 => x < x_1) [] (a :: as)
⊢ ∀ i ∈ [], Ordinal.typein (fun x x_1 => x < x_1) i < o

Next tactic:
| nil => intro i hi; simp at hi
theorem List.Sorted.lt_ord_of_lt [LinearOrder α] [IsWellOrder α (· < ·)] {l m : List α}
    {o : Ordinal} (hl : l.Sorted (· > ·)) (hm : m.Sorted (· > ·)) (hmltl : m < l)
    (hlt : ∀ i ∈ l, Ordinal.typein (· < ·) i < o) : ∀ i ∈ m, Ordinal.typein (· < ·) i < o := by
  replace hmltl : List.Lex (· < ·) m l := hmltl
  cases l with
  | nil => simp at hmltl
  | cons a as =>
    cases m with
    | nil => 

Proof state:
case cons.nil
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝¹ : LinearOrder α
inst✝ : IsWellOrder α fun x x_1 => x < x_1
o : Ordinal.{u}
a : α
as : List α
hl : Sorted (fun x x_1 => x > x_1) (a :: as)
hlt : ∀ i ∈ a :: as, Ordinal.typein (fun x x_1 => x < x_1) i < o
hm : Sorted (fun x x_1 => x > x_1) []
hmltl : Lex (fun x x_1 => x < x_1) [] (a :: as)
⊢ ∀ i ∈ [], Ordinal.typein (fun x x_1 => x < x_1) i < o

Next tactic:
intro i hi
theorem List.Sorted.lt_ord_of_lt [LinearOrder α] [IsWellOrder α (· < ·)] {l m : List α}
    {o : Ordinal} (hl : l.Sorted (· > ·)) (hm : m.Sorted (· > ·)) (hmltl : m < l)
    (hlt : ∀ i ∈ l, Ordinal.typein (· < ·) i < o) : ∀ i ∈ m, Ordinal.typein (· < ·) i < o := by
  replace hmltl : List.Lex (· < ·) m l := hmltl
  cases l with
  | nil => simp at hmltl
  | cons a as =>
    cases m with
    | nil => intro i hi; 

Proof state:
case cons.nil
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝¹ : LinearOrder α
inst✝ : IsWellOrder α fun x x_1 => x < x_1
o : Ordinal.{u}
a : α
as : List α
hl : Sorted (fun x x_1 => x > x_1) (a :: as)
hlt : ∀ i ∈ a :: as, Ordinal.typein (fun x x_1 => x < x_1) i < o
hm : Sorted (fun x x_1 => x > x_1) []
hmltl : Lex (fun x x_1 => x < x_1) [] (a :: as)
i : α
hi : i ∈ []
⊢ Ordinal.typein (fun x x_1 => x < x_1) i < o

Next tactic:
simp at hi
theorem List.Sorted.lt_ord_of_lt [LinearOrder α] [IsWellOrder α (· < ·)] {l m : List α}
    {o : Ordinal} (hl : l.Sorted (· > ·)) (hm : m.Sorted (· > ·)) (hmltl : m < l)
    (hlt : ∀ i ∈ l, Ordinal.typein (· < ·) i < o) : ∀ i ∈ m, Ordinal.typein (· < ·) i < o := by
  replace hmltl : List.Lex (· < ·) m l := hmltl
  cases l with
  | nil => simp at hmltl
  | cons a as =>
    cases m with
    | nil => intro i hi; simp at hi
    

Proof state:
case cons.cons
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝¹ : LinearOrder α
inst✝ : IsWellOrder α fun x x_1 => x < x_1
o : Ordinal.{u}
a : α
as : List α
hl : Sorted (fun x x_1 => x > x_1) (a :: as)
hlt : ∀ i ∈ a :: as, Ordinal.typein (fun x x_1 => x < x_1) i < o
b : α
bs : List α
hm : Sorted (fun x x_1 => x > x_1) (b :: bs)
hmltl : Lex (fun x x_1 => x < x_1) (b :: bs) (a :: as)
⊢ ∀ i ∈ b :: bs, Ordinal.typein (fun x x_1 => x < x_1) i < o

Next tactic:
| cons b bs =>
      intro i hi
      suffices h : i ≤ a by refine lt_of_le_of_lt ?_ (hlt a (mem_cons_self a as)); simpa
      cases hi with
      | head as => exact List.head_le_of_lt hmltl
      | tail b hi => exact le_of_lt (lt_of_lt_of_le (List.rel_of_sorted_cons hm _ hi)
          (List.head_le_of_lt hmltl))
theorem List.Sorted.lt_ord_of_lt [LinearOrder α] [IsWellOrder α (· < ·)] {l m : List α}
    {o : Ordinal} (hl : l.Sorted (· > ·)) (hm : m.Sorted (· > ·)) (hmltl : m < l)
    (hlt : ∀ i ∈ l, Ordinal.typein (· < ·) i < o) : ∀ i ∈ m, Ordinal.typein (· < ·) i < o := by
  replace hmltl : List.Lex (· < ·) m l := hmltl
  cases l with
  | nil => simp at hmltl
  | cons a as =>
    cases m with
    | nil => intro i hi; simp at hi
    | cons b bs =>
      

Proof state:
case cons.cons
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝¹ : LinearOrder α
inst✝ : IsWellOrder α fun x x_1 => x < x_1
o : Ordinal.{u}
a : α
as : List α
hl : Sorted (fun x x_1 => x > x_1) (a :: as)
hlt : ∀ i ∈ a :: as, Ordinal.typein (fun x x_1 => x < x_1) i < o
b : α
bs : List α
hm : Sorted (fun x x_1 => x > x_1) (b :: bs)
hmltl : Lex (fun x x_1 => x < x_1) (b :: bs) (a :: as)
⊢ ∀ i ∈ b :: bs, Ordinal.typein (fun x x_1 => x < x_1) i < o

Next tactic:
intro i hi
theorem List.Sorted.lt_ord_of_lt [LinearOrder α] [IsWellOrder α (· < ·)] {l m : List α}
    {o : Ordinal} (hl : l.Sorted (· > ·)) (hm : m.Sorted (· > ·)) (hmltl : m < l)
    (hlt : ∀ i ∈ l, Ordinal.typein (· < ·) i < o) : ∀ i ∈ m, Ordinal.typein (· < ·) i < o := by
  replace hmltl : List.Lex (· < ·) m l := hmltl
  cases l with
  | nil => simp at hmltl
  | cons a as =>
    cases m with
    | nil => intro i hi; simp at hi
    | cons b bs =>
      intro i hi
      

Proof state:
case cons.cons
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝¹ : LinearOrder α
inst✝ : IsWellOrder α fun x x_1 => x < x_1
o : Ordinal.{u}
a : α
as : List α
hl : Sorted (fun x x_1 => x > x_1) (a :: as)
hlt : ∀ i ∈ a :: as, Ordinal.typein (fun x x_1 => x < x_1) i < o
b : α
bs : List α
hm : Sorted (fun x x_1 => x > x_1) (b :: bs)
hmltl : Lex (fun x x_1 => x < x_1) (b :: bs) (a :: as)
i : α
hi : i ∈ b :: bs
⊢ Ordinal.typein (fun x x_1 => x < x_1) i < o

Next tactic:
suffices h : i ≤ a by refine lt_of_le_of_lt ?_ (hlt a (mem_cons_self a as)); simpa
theorem List.Sorted.lt_ord_of_lt [LinearOrder α] [IsWellOrder α (· < ·)] {l m : List α}
    {o : Ordinal} (hl : l.Sorted (· > ·)) (hm : m.Sorted (· > ·)) (hmltl : m < l)
    (hlt : ∀ i ∈ l, Ordinal.typein (· < ·) i < o) : ∀ i ∈ m, Ordinal.typein (· < ·) i < o := by
  replace hmltl : List.Lex (· < ·) m l := hmltl
  cases l with
  | nil => simp at hmltl
  | cons a as =>
    cases m with
    | nil => intro i hi; simp at hi
    | cons b bs =>
      intro i hi
      suffices h : i ≤ a by 

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝¹ : LinearOrder α
inst✝ : IsWellOrder α fun x x_1 => x < x_1
o : Ordinal.{u}
a : α
as : List α
hl : Sorted (fun x x_1 => x > x_1) (a :: as)
hlt : ∀ i ∈ a :: as, Ordinal.typein (fun x x_1 => x < x_1) i < o
b : α
bs : List α
hm : Sorted (fun x x_1 => x > x_1) (b :: bs)
hmltl : Lex (fun x x_1 => x < x_1) (b :: bs) (a :: as)
i : α
hi : i ∈ b :: bs
h : i ≤ a
⊢ Ordinal.typein (fun x x_1 => x < x_1) i < o

Next tactic:
refine lt_of_le_of_lt ?_ (hlt a (mem_cons_self a as))
theorem List.Sorted.lt_ord_of_lt [LinearOrder α] [IsWellOrder α (· < ·)] {l m : List α}
    {o : Ordinal} (hl : l.Sorted (· > ·)) (hm : m.Sorted (· > ·)) (hmltl : m < l)
    (hlt : ∀ i ∈ l, Ordinal.typein (· < ·) i < o) : ∀ i ∈ m, Ordinal.typein (· < ·) i < o := by
  replace hmltl : List.Lex (· < ·) m l := hmltl
  cases l with
  | nil => simp at hmltl
  | cons a as =>
    cases m with
    | nil => intro i hi; simp at hi
    | cons b bs =>
      intro i hi
      suffices h : i ≤ a by refine lt_of_le_of_lt ?_ (hlt a (mem_cons_self a as)); 

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝¹ : LinearOrder α
inst✝ : IsWellOrder α fun x x_1 => x < x_1
o : Ordinal.{u}
a : α
as : List α
hl : Sorted (fun x x_1 => x > x_1) (a :: as)
hlt : ∀ i ∈ a :: as, Ordinal.typein (fun x x_1 => x < x_1) i < o
b : α
bs : List α
hm : Sorted (fun x x_1 => x > x_1) (b :: bs)
hmltl : Lex (fun x x_1 => x < x_1) (b :: bs) (a :: as)
i : α
hi : i ∈ b :: bs
h : i ≤ a
⊢ Ordinal.typein (fun x x_1 => x < x_1) i ≤ Ordinal.typein (fun x x_1 => x < x_1) a

Next tactic:
simpa
theorem List.Sorted.lt_ord_of_lt [LinearOrder α] [IsWellOrder α (· < ·)] {l m : List α}
    {o : Ordinal} (hl : l.Sorted (· > ·)) (hm : m.Sorted (· > ·)) (hmltl : m < l)
    (hlt : ∀ i ∈ l, Ordinal.typein (· < ·) i < o) : ∀ i ∈ m, Ordinal.typein (· < ·) i < o := by
  replace hmltl : List.Lex (· < ·) m l := hmltl
  cases l with
  | nil => simp at hmltl
  | cons a as =>
    cases m with
    | nil => intro i hi; simp at hi
    | cons b bs =>
      intro i hi
      suffices h : i ≤ a by refine lt_of_le_of_lt ?_ (hlt a (mem_cons_self a as)); simpa
      

Proof state:
case cons.cons
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝¹ : LinearOrder α
inst✝ : IsWellOrder α fun x x_1 => x < x_1
o : Ordinal.{u}
a : α
as : List α
hl : Sorted (fun x x_1 => x > x_1) (a :: as)
hlt : ∀ i ∈ a :: as, Ordinal.typein (fun x x_1 => x < x_1) i < o
b : α
bs : List α
hm : Sorted (fun x x_1 => x > x_1) (b :: bs)
hmltl : Lex (fun x x_1 => x < x_1) (b :: bs) (a :: as)
i : α
hi : i ∈ b :: bs
⊢ i ≤ a

Next tactic:
cases hi with
      | head as => exact List.head_le_of_lt hmltl
      | tail b hi => exact le_of_lt (lt_of_lt_of_le (List.rel_of_sorted_cons hm _ hi)
          (List.head_le_of_lt hmltl))
theorem List.Sorted.lt_ord_of_lt [LinearOrder α] [IsWellOrder α (· < ·)] {l m : List α}
    {o : Ordinal} (hl : l.Sorted (· > ·)) (hm : m.Sorted (· > ·)) (hmltl : m < l)
    (hlt : ∀ i ∈ l, Ordinal.typein (· < ·) i < o) : ∀ i ∈ m, Ordinal.typein (· < ·) i < o := by
  replace hmltl : List.Lex (· < ·) m l := hmltl
  cases l with
  | nil => simp at hmltl
  | cons a as =>
    cases m with
    | nil => intro i hi; simp at hi
    | cons b bs =>
      intro i hi
      suffices h : i ≤ a by refine lt_of_le_of_lt ?_ (hlt a (mem_cons_self a as)); simpa
      cases hi with
      

Proof state:
case cons.cons.head
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝¹ : LinearOrder α
inst✝ : IsWellOrder α fun x x_1 => x < x_1
o : Ordinal.{u}
a : α
as : List α
hl : Sorted (fun x x_1 => x > x_1) (a :: as)
hlt : ∀ i ∈ a :: as, Ordinal.typein (fun x x_1 => x < x_1) i < o
b : α
bs : List α
hm : Sorted (fun x x_1 => x > x_1) (b :: bs)
hmltl : Lex (fun x x_1 => x < x_1) (b :: bs) (a :: as)
⊢ b ≤ a

Next tactic:
| head as => exact List.head_le_of_lt hmltl