l3lab/ntp-mathlib huggingface dataset:
/-- The ordinal corresponding to a cardinal `c` is the least ordinal
  whose cardinal is `c`. For the order-embedding version, see `ord.order_embedding`. -/
def ord (c : Cardinal) : Ordinal :=
  let F := fun α : Type u => ⨅ r : { r // IsWellOrder α r }, @type α r.1 r.2
  Quot.liftOn c F
    (by
      suffices : ∀ {α β}, α ≈ β → F α ≤ F β
      exact fun α β h => (this h).antisymm (this (Setoid.symm h))
      rintro α β ⟨f⟩
      

Proof state:
case this.intro
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r : α✝ → α✝ → Prop
s : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Cardinal.{u}
F : Type u → Ordinal.{u} := fun α => ⨅ r, type ↑r
α β : Type u
f : α ≃ β
⊢ F α ≤ F β

Next tactic:
refine' le_ciInf_iff'.2 fun i => _
/-- The ordinal corresponding to a cardinal `c` is the least ordinal
  whose cardinal is `c`. For the order-embedding version, see `ord.order_embedding`. -/
def ord (c : Cardinal) : Ordinal :=
  let F := fun α : Type u => ⨅ r : { r // IsWellOrder α r }, @type α r.1 r.2
  Quot.liftOn c F
    (by
      suffices : ∀ {α β}, α ≈ β → F α ≤ F β
      exact fun α β h => (this h).antisymm (this (Setoid.symm h))
      rintro α β ⟨f⟩
      refine' le_ciInf_iff'.2 fun i => _
      

Proof state:
case this.intro
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r : α✝ → α✝ → Prop
s : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Cardinal.{u}
F : Type u → Ordinal.{u} := fun α => ⨅ r, type ↑r
α β : Type u
f : α ≃ β
i : { r // IsWellOrder β r }
⊢ F α ≤ type ↑i

Next tactic:
haveI := @RelEmbedding.isWellOrder _ _ (f ⁻¹'o i.1) _ (↑(RelIso.preimage f i.1)) i.2
/-- The ordinal corresponding to a cardinal `c` is the least ordinal
  whose cardinal is `c`. For the order-embedding version, see `ord.order_embedding`. -/
def ord (c : Cardinal) : Ordinal :=
  let F := fun α : Type u => ⨅ r : { r // IsWellOrder α r }, @type α r.1 r.2
  Quot.liftOn c F
    (by
      suffices : ∀ {α β}, α ≈ β → F α ≤ F β
      exact fun α β h => (this h).antisymm (this (Setoid.symm h))
      rintro α β ⟨f⟩
      refine' le_ciInf_iff'.2 fun i => _
      haveI := @RelEmbedding.isWellOrder _ _ (f ⁻¹'o i.1) _ (↑(RelIso.preimage f i.1)) i.2
      

Proof state:
case this.intro
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r : α✝ → α✝ → Prop
s : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Cardinal.{u}
F : Type u → Ordinal.{u} := fun α => ⨅ r, type ↑r
α β : Type u
f : α ≃ β
i : { r // IsWellOrder β r }
this : IsWellOrder α (⇑f ⁻¹'o ↑i)
⊢ F α ≤ type ↑i

Next tactic:
exact
        (ciInf_le' _
              (Subtype.mk (f ⁻¹'o i.val)
                (@RelEmbedding.isWellOrder _ _ _ _ (↑(RelIso.preimage f i.1)) i.2))).trans_eq
          (Quot.sound ⟨RelIso.preimage f i.1⟩)
theorem ord_le {c o} : ord c ≤ o ↔ c ≤ o.card :=
  inductionOn c fun α =>
    Ordinal.inductionOn o fun β s _ => by
      

Proof state:
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Cardinal.{u_3}
o : Ordinal.{u_3}
α β : Type u_3
s : β → β → Prop
x✝ : IsWellOrder β s
⊢ ord #α ≤ type s ↔ #α ≤ card (type s)

Next tactic:
let ⟨r, _, e⟩ := ord_eq α
theorem ord_le {c o} : ord c ≤ o ↔ c ≤ o.card :=
  inductionOn c fun α =>
    Ordinal.inductionOn o fun β s _ => by
      let ⟨r, _, e⟩ := ord_eq α
      

Proof state:
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Cardinal.{u_3}
o : Ordinal.{u_3}
α β : Type u_3
s : β → β → Prop
x✝ : IsWellOrder β s
r : α → α → Prop
w✝ : IsWellOrder α r
e : ord #α = type r
⊢ ord #α ≤ type s ↔ #α ≤ card (type s)

Next tactic:
skip
theorem ord_le {c o} : ord c ≤ o ↔ c ≤ o.card :=
  inductionOn c fun α =>
    Ordinal.inductionOn o fun β s _ => by
      let ⟨r, _, e⟩ := ord_eq α
      skip; 

Proof state:
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Cardinal.{u_3}
o : Ordinal.{u_3}
α β : Type u_3
s : β → β → Prop
x✝ : IsWellOrder β s
r : α → α → Prop
w✝ : IsWellOrder α r
e : ord #α = type r
⊢ ord #α ≤ type s ↔ #α ≤ card (type s)

Next tactic:
simp only [card_type]
theorem ord_le {c o} : ord c ≤ o ↔ c ≤ o.card :=
  inductionOn c fun α =>
    Ordinal.inductionOn o fun β s _ => by
      let ⟨r, _, e⟩ := ord_eq α
      skip; simp only [card_type]; 

Proof state:
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Cardinal.{u_3}
o : Ordinal.{u_3}
α β : Type u_3
s : β → β → Prop
x✝ : IsWellOrder β s
r : α → α → Prop
w✝ : IsWellOrder α r
e : ord #α = type r
⊢ ord #α ≤ type s ↔ #α ≤ #β

Next tactic:
constructor
theorem ord_le {c o} : ord c ≤ o ↔ c ≤ o.card :=
  inductionOn c fun α =>
    Ordinal.inductionOn o fun β s _ => by
      let ⟨r, _, e⟩ := ord_eq α
      skip; simp only [card_type]; constructor <;> 

Proof state:
case mp
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Cardinal.{u_3}
o : Ordinal.{u_3}
α β : Type u_3
s : β → β → Prop
x✝ : IsWellOrder β s
r : α → α → Prop
w✝ : IsWellOrder α r
e : ord #α = type r
⊢ ord #α ≤ type s → #α ≤ #β

Next tactic:
intro h
theorem ord_le {c o} : ord c ≤ o ↔ c ≤ o.card :=
  inductionOn c fun α =>
    Ordinal.inductionOn o fun β s _ => by
      let ⟨r, _, e⟩ := ord_eq α
      skip; simp only [card_type]; constructor <;> 

Proof state:
case mpr
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Cardinal.{u_3}
o : Ordinal.{u_3}
α β : Type u_3
s : β → β → Prop
x✝ : IsWellOrder β s
r : α → α → Prop
w✝ : IsWellOrder α r
e : ord #α = type r
⊢ #α ≤ #β → ord #α ≤ type s

Next tactic:
intro h
theorem ord_le {c o} : ord c ≤ o ↔ c ≤ o.card :=
  inductionOn c fun α =>
    Ordinal.inductionOn o fun β s _ => by
      let ⟨r, _, e⟩ := ord_eq α
      skip; simp only [card_type]; constructor <;> intro h
      · 

Proof state:
case mp
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Cardinal.{u_3}
o : Ordinal.{u_3}
α β : Type u_3
s : β → β → Prop
x✝ : IsWellOrder β s
r : α → α → Prop
w✝ : IsWellOrder α r
e : ord #α = type r
h : ord #α ≤ type s
⊢ #α ≤ #β

Next tactic:
rw [e] at h
theorem ord_le {c o} : ord c ≤ o ↔ c ≤ o.card :=
  inductionOn c fun α =>
    Ordinal.inductionOn o fun β s _ => by
      let ⟨r, _, e⟩ := ord_eq α
      skip; simp only [card_type]; constructor <;> intro h
      · rw [e] at h
        

Proof state:
case mp
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Cardinal.{u_3}
o : Ordinal.{u_3}
α β : Type u_3
s : β → β → Prop
x✝ : IsWellOrder β s
r : α → α → Prop
w✝ : IsWellOrder α r
e : ord #α = type r
h : type r ≤ type s
⊢ #α ≤ #β

Next tactic:
exact
          let ⟨f⟩ := h
          ⟨f.toEmbedding⟩
theorem ord_le {c o} : ord c ≤ o ↔ c ≤ o.card :=
  inductionOn c fun α =>
    Ordinal.inductionOn o fun β s _ => by
      let ⟨r, _, e⟩ := ord_eq α
      skip; simp only [card_type]; constructor <;> intro h
      · rw [e] at h
        exact
          let ⟨f⟩ := h
          ⟨f.toEmbedding⟩
      · 

Proof state:
case mpr
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Cardinal.{u_3}
o : Ordinal.{u_3}
α β : Type u_3
s : β → β → Prop
x✝ : IsWellOrder β s
r : α → α → Prop
w✝ : IsWellOrder α r
e : ord #α = type r
h : #α ≤ #β
⊢ ord #α ≤ type s

Next tactic:
cases' h with f
theorem ord_le {c o} : ord c ≤ o ↔ c ≤ o.card :=
  inductionOn c fun α =>
    Ordinal.inductionOn o fun β s _ => by
      let ⟨r, _, e⟩ := ord_eq α
      skip; simp only [card_type]; constructor <;> intro h
      · rw [e] at h
        exact
          let ⟨f⟩ := h
          ⟨f.toEmbedding⟩
      · cases' h with f
        

Proof state:
case mpr.intro
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Cardinal.{u_3}
o : Ordinal.{u_3}
α β : Type u_3
s : β → β → Prop
x✝ : IsWellOrder β s
r : α → α → Prop
w✝ : IsWellOrder α r
e : ord #α = type r
f : α ↪ β
⊢ ord #α ≤ type s

Next tactic:
have g := RelEmbedding.preimage f s
theorem ord_le {c o} : ord c ≤ o ↔ c ≤ o.card :=
  inductionOn c fun α =>
    Ordinal.inductionOn o fun β s _ => by
      let ⟨r, _, e⟩ := ord_eq α
      skip; simp only [card_type]; constructor <;> intro h
      · rw [e] at h
        exact
          let ⟨f⟩ := h
          ⟨f.toEmbedding⟩
      · cases' h with f
        have g := RelEmbedding.preimage f s
        

Proof state:
case mpr.intro
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Cardinal.{u_3}
o : Ordinal.{u_3}
α β : Type u_3
s : β → β → Prop
x✝ : IsWellOrder β s
r : α → α → Prop
w✝ : IsWellOrder α r
e : ord #α = type r
f : α ↪ β
g : ⇑f ⁻¹'o s ↪r s
⊢ ord #α ≤ type s

Next tactic:
haveI := RelEmbedding.isWellOrder g
theorem ord_le {c o} : ord c ≤ o ↔ c ≤ o.card :=
  inductionOn c fun α =>
    Ordinal.inductionOn o fun β s _ => by
      let ⟨r, _, e⟩ := ord_eq α
      skip; simp only [card_type]; constructor <;> intro h
      · rw [e] at h
        exact
          let ⟨f⟩ := h
          ⟨f.toEmbedding⟩
      · cases' h with f
        have g := RelEmbedding.preimage f s
        haveI := RelEmbedding.isWellOrder g
        

Proof state:
case mpr.intro
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Cardinal.{u_3}
o : Ordinal.{u_3}
α β : Type u_3
s : β → β → Prop
x✝ : IsWellOrder β s
r : α → α → Prop
w✝ : IsWellOrder α r
e : ord #α = type r
f : α ↪ β
g : ⇑f ⁻¹'o s ↪r s
this : IsWellOrder α (⇑f ⁻¹'o s)
⊢ ord #α ≤ type s

Next tactic:
exact le_trans (ord_le_type _) g.ordinal_type_le
@[simp]
theorem card_ord (c) : (ord c).card = c :=
  Quotient.inductionOn c fun α => by
    

Proof state:
α✝ : Type u
β : Type u_1
γ : Type u_2
r : α✝ → α✝ → Prop
s : β → β → Prop
t : γ → γ → Prop
c : Cardinal.{u_3}
α : Type u_3
⊢ card (ord ⟦α⟧) = ⟦α⟧

Next tactic:
let ⟨r, _, e⟩ := ord_eq α
@[simp]
theorem card_ord (c) : (ord c).card = c :=
  Quotient.inductionOn c fun α => by
    let ⟨r, _, e⟩ := ord_eq α
    -- Porting note: cardinal.mk_def is now Cardinal.mk'_def, not sure why
    

Proof state:
α✝ : Type u
β : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s : β → β → Prop
t : γ → γ → Prop
c : Cardinal.{u_3}
α : Type u_3
r : α → α → Prop
w✝ : IsWellOrder α r
e : ord #α = type r
⊢ card (ord ⟦α⟧) = ⟦α⟧

Next tactic:
simp only [mk'_def, e, card_type]
theorem card_le_iff {o : Ordinal} {c : Cardinal} : o.card ≤ c ↔ o < (succ c).ord := by
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_3}
c : Cardinal.{u_3}
⊢ card o ≤ c ↔ o < ord (succ c)

Next tactic:
rw [lt_ord, lt_succ_iff]
/--
A variation on `Cardinal.lt_ord` using `≤`: If `o` is no greater than the
initial ordinal of cardinality `c`, then its cardinal is no greater than `c`.

The converse, however, is false (for instance, `o = ω+1` and `c = ℵ₀`).
-/
lemma card_le_of_le_ord {o : Ordinal} {c : Cardinal} (ho : o ≤ c.ord) :
    o.card ≤ c := by
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_3}
c : Cardinal.{u_3}
ho : o ≤ ord c
⊢ card o ≤ c

Next tactic:
rw [← card_ord c]
/--
A variation on `Cardinal.lt_ord` using `≤`: If `o` is no greater than the
initial ordinal of cardinality `c`, then its cardinal is no greater than `c`.

The converse, however, is false (for instance, `o = ω+1` and `c = ℵ₀`).
-/
lemma card_le_of_le_ord {o : Ordinal} {c : Cardinal} (ho : o ≤ c.ord) :
    o.card ≤ c := by
  rw [← card_ord c]; 

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_3}
c : Cardinal.{u_3}
ho : o ≤ ord c
⊢ card o ≤ card (ord c)

Next tactic:
exact Ordinal.card_le_card ho
@[simp]
theorem ord_nat (n : ℕ) : ord n = n :=
  (ord_le.2 (card_nat n).ge).antisymm
    (by
      

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
n : ℕ
⊢ ↑n ≤ ord ↑n

Next tactic:
induction' n with n IH
@[simp]
theorem ord_nat (n : ℕ) : ord n = n :=
  (ord_le.2 (card_nat n).ge).antisymm
    (by
      induction' n with n IH
      · 

Proof state:
case zero
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
⊢ ↑Nat.zero ≤ ord ↑Nat.zero

Next tactic:
apply Ordinal.zero_le
@[simp]
theorem ord_nat (n : ℕ) : ord n = n :=
  (ord_le.2 (card_nat n).ge).antisymm
    (by
      induction' n with n IH
      · apply Ordinal.zero_le
      · 

Proof state:
case succ
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
n : ℕ
IH : ↑n ≤ ord ↑n
⊢ ↑(Nat.succ n) ≤ ord ↑(Nat.succ n)

Next tactic:
exact succ_le_of_lt (IH.trans_lt <| ord_lt_ord.2 <| natCast_lt.2 (Nat.lt_succ_self n))
@[simp]
theorem ord_one : ord 1 = 1 := by 

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
⊢ ord 1 = 1

Next tactic:
simpa using ord_nat 1
@[simp]
theorem lift_ord (c) : Ordinal.lift.{u,v} (ord c) = ord (lift.{u,v} c) := by
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
c : Cardinal.{v}
⊢ Ordinal.lift.{u, v} (ord c) = ord (lift.{u, v} c)

Next tactic:
refine' le_antisymm (le_of_forall_lt fun a ha => _) _
@[simp]
theorem lift_ord (c) : Ordinal.lift.{u,v} (ord c) = ord (lift.{u,v} c) := by
  refine' le_antisymm (le_of_forall_lt fun a ha => _) _
  · 

Proof state:
case refine'_1
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
c : Cardinal.{v}
a : Ordinal.{max v u}
ha : a < Ordinal.lift.{u, v} (ord c)
⊢ a < ord (lift.{u, v} c)

Next tactic:
rcases Ordinal.lt_lift_iff.1 ha with ⟨a, rfl, _⟩
@[simp]
theorem lift_ord (c) : Ordinal.lift.{u,v} (ord c) = ord (lift.{u,v} c) := by
  refine' le_antisymm (le_of_forall_lt fun a ha => _) _
  · rcases Ordinal.lt_lift_iff.1 ha with ⟨a, rfl, _⟩
    

Proof state:
case refine'_1.intro.intro
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
c : Cardinal.{v}
a : Ordinal.{v}
right✝ : a < ord c
ha : Ordinal.lift.{u, v} a < Ordinal.lift.{u, v} (ord c)
⊢ Ordinal.lift.{u, v} a < ord (lift.{u, v} c)

Next tactic:
rwa [lt_ord, ← lift_card, lift_lt, ← lt_ord, ← Ordinal.lift_lt]
@[simp]
theorem lift_ord (c) : Ordinal.lift.{u,v} (ord c) = ord (lift.{u,v} c) := by
  refine' le_antisymm (le_of_forall_lt fun a ha => _) _
  · rcases Ordinal.lt_lift_iff.1 ha with ⟨a, rfl, _⟩
    rwa [lt_ord, ← lift_card, lift_lt, ← lt_ord, ← Ordinal.lift_lt]
  · 

Proof state:
case refine'_2
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
c : Cardinal.{v}
⊢ ord (lift.{u, v} c) ≤ Ordinal.lift.{u, v} (ord c)

Next tactic:
rw [ord_le, ← lift_card, card_ord]
theorem mk_ord_out (c : Cardinal) : #c.ord.out.α = c := by 

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
c : Cardinal.{u_3}
⊢ #(Quotient.out (ord c)).α = c

Next tactic:
simp
theorem card_typein_lt (r : α → α → Prop) [IsWellOrder α r] (x : α) (h : ord #α = type r) :
    card (typein r x) < #α := by
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r✝ : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
r : α → α → Prop
inst✝ : IsWellOrder α r
x : α
h : ord #α = type r
⊢ card (typein r x) < #α

Next tactic:
rw [← lt_ord, h]
theorem card_typein_lt (r : α → α → Prop) [IsWellOrder α r] (x : α) (h : ord #α = type r) :
    card (typein r x) < #α := by
  rw [← lt_ord, h]
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r✝ : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
r : α → α → Prop
inst✝ : IsWellOrder α r
x : α
h : ord #α = type r
⊢ typein r x < type r

Next tactic:
apply typein_lt_type
theorem card_typein_out_lt (c : Cardinal) (x : c.ord.out.α) :
    card (@typein _ (· < ·) (isWellOrder_out_lt _) x) < c := by
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
c : Cardinal.{u_3}
x : (Quotient.out (ord c)).α
⊢ card (typein (fun x x_1 => x < x_1) x) < c

Next tactic:
rw [← lt_ord]
theorem card_typein_out_lt (c : Cardinal) (x : c.ord.out.α) :
    card (@typein _ (· < ·) (isWellOrder_out_lt _) x) < c := by
  rw [← lt_ord]
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
c : Cardinal.{u_3}
x : (Quotient.out (ord c)).α
⊢ typein (fun x x_1 => x < x_1) x < ord c

Next tactic:
apply typein_lt_self
theorem ord_injective : Injective ord := by
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
⊢ Injective ord

Next tactic:
intro c c' h
theorem ord_injective : Injective ord := by
  intro c c' h
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
c c' : Cardinal.{u_3}
h : ord c = ord c'
⊢ c = c'

Next tactic:
rw [← card_ord c, ← card_ord c', h]
theorem lift_lt_univ (c : Cardinal) : lift.{u + 1, u} c < univ.{u, u + 1} := by
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
c : Cardinal.{u}
⊢ lift.{u + 1, u} c < univ.{u, u + 1}

Next tactic:
simpa only [lift.principalSeg_coe, lift_ord, lift_succ, ord_le, succ_le_iff] using
    le_of_lt (lift.principalSeg.{u, u + 1}.lt_top (succ c).ord)
theorem lift_lt_univ' (c : Cardinal) : lift.{max (u + 1) v, u} c < univ.{u, v} := by
  

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

Next tactic:
have := lift_lt.{_, max (u+1) v}.2 (lift_lt_univ c)
theorem lift_lt_univ' (c : Cardinal) : lift.{max (u + 1) v, u} c < univ.{u, v} := by
  have := lift_lt.{_, max (u+1) v}.2 (lift_lt_univ c)
  

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

Next tactic:
rw [lift_lift, lift_univ, univ_umax.{u,v}] at this
theorem lift_lt_univ' (c : Cardinal) : lift.{max (u + 1) v, u} c < univ.{u, v} := by
  have := lift_lt.{_, max (u+1) v}.2 (lift_lt_univ c)
  rw [lift_lift, lift_univ, univ_umax.{u,v}] at this
  

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

Next tactic:
exact this
@[simp]
theorem ord_univ : ord univ.{u, v} = Ordinal.univ.{u, v} := by
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
⊢ ord univ.{u, v} = Ordinal.univ.{u, v}

Next tactic:
refine' le_antisymm (ord_card_le _) <| le_of_forall_lt fun o h => lt_ord.2 ?_
@[simp]
theorem ord_univ : ord univ.{u, v} = Ordinal.univ.{u, v} := by
  refine' le_antisymm (ord_card_le _) <| le_of_forall_lt fun o h => lt_ord.2 ?_
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{max (u + 1) v}
h : o < Ordinal.univ.{u, v}
⊢ card o < univ.{u, v}

Next tactic:
have := lift.principalSeg.{u, v}.down.1 (by simpa only [lift.principalSeg_coe] using h)
@[simp]
theorem ord_univ : ord univ.{u, v} = Ordinal.univ.{u, v} := by
  refine' le_antisymm (ord_card_le _) <| le_of_forall_lt fun o h => lt_ord.2 ?_
  have := lift.principalSeg.{u, v}.down.1 (by 

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{max (u + 1) v}
h : o < Ordinal.univ.{u, v}
⊢ ?m.224702 < lift.principalSeg.top

Next tactic:
simpa only [lift.principalSeg_coe] using h
@[simp]
theorem ord_univ : ord univ.{u, v} = Ordinal.univ.{u, v} := by
  refine' le_antisymm (ord_card_le _) <| le_of_forall_lt fun o h => lt_ord.2 ?_
  have := lift.principalSeg.{u, v}.down.1 (by simpa only [lift.principalSeg_coe] using h)
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{max (u + 1) v}
h : o < Ordinal.univ.{u, v}
this : ∃ a, lift.principalSeg.toRelEmbedding a = o
⊢ card o < univ.{u, v}

Next tactic:
rcases this with ⟨o, h'⟩
@[simp]
theorem ord_univ : ord univ.{u, v} = Ordinal.univ.{u, v} := by
  refine' le_antisymm (ord_card_le _) <| le_of_forall_lt fun o h => lt_ord.2 ?_
  have := lift.principalSeg.{u, v}.down.1 (by simpa only [lift.principalSeg_coe] using h)
  rcases this with ⟨o, h'⟩
  

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

Next tactic:
rw [← h', lift.principalSeg_coe, ← lift_card]
@[simp]
theorem ord_univ : ord univ.{u, v} = Ordinal.univ.{u, v} := by
  refine' le_antisymm (ord_card_le _) <| le_of_forall_lt fun o h => lt_ord.2 ?_
  have := lift.principalSeg.{u, v}.down.1 (by simpa only [lift.principalSeg_coe] using h)
  rcases this with ⟨o, h'⟩
  rw [← h', lift.principalSeg_coe, ← lift_card]
  

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

Next tactic:
apply lift_lt_univ'
theorem lt_univ {c} : c < univ.{u, u + 1} ↔ ∃ c', c = lift.{u + 1, u} c' :=
  ⟨fun h => by
    

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

Next tactic:
have := ord_lt_ord.2 h
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
    

Proof state:
α : 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 < ord univ.{u, u + 1}
⊢ ∃ c', c = lift.{u + 1, u} c'

Next tactic:
rw [ord_univ] at this
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
    

Proof state:
α : 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}
⊢ ∃ c', c = lift.{u + 1, u} c'

Next tactic:
cases' lift.principalSeg.{u, u + 1}.down.1 (by simpa only [lift.principalSeg_top] ) with o e
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 

Proof state:
α : 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}
⊢ ?m.225155 < lift.principalSeg.top

Next tactic:
simpa only [lift.principalSeg_top]
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
    

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
⊢ ∃ c', c = lift.{u + 1, u} c'

Next tactic:
have := card_ord c
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
    

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 : card (ord c) = c
⊢ ∃ c', c = lift.{u + 1, u} c'

Next tactic:
rw [← e, lift.principalSeg_coe, ← lift_card] at this