Theorem: Ordinal.lift_cof
File: Mathlib/SetTheory/Cardinal/Cofinality.lean

tactic: refine inductionOn o ?_
state_before: α : Type u_1
r : α → α → Prop
o : Ordinal.{v}
⊢ Cardinal.lift.{u, v} o.cof = (lift.{u, v} o).cof
state_after: α : Type u_1
r : α → α → Prop
o : Ordinal.{v}
⊢ ∀ (α : Type v) (r : α → α → Prop) [inst : IsWellOrder α r],
    Cardinal.lift.{u, v} (type r).cof = (lift.{u, v} (type r)).cof

tactic: intro α r _
state_before: α : Type u_1
r : α → α → Prop
o : Ordinal.{v}
⊢ ∀ (α : Type v) (r : α → α → Prop) [inst : IsWellOrder α r],
    Cardinal.lift.{u, v} (type r).cof = (lift.{u, v} (type r)).cof
state_after: α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
⊢ Cardinal.lift.{u, v} (type r).cof = (lift.{u, v} (type r)).cof

tactic: apply le_antisymm
state_before: α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
⊢ Cardinal.lift.{u, v} (type r).cof = (lift.{u, v} (type r)).cof
state_after: case a
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
⊢ Cardinal.lift.{u, v} (type r).cof ≤ (lift.{u, v} (type r)).cof

case a
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
⊢ (lift.{u, v} (type r)).cof ≤ Cardinal.lift.{u, v} (type r).cof

tactic: refine le_cof_type.2 fun S H => ?_
state_before: case a
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
⊢ Cardinal.lift.{u, v} (type r).cof ≤ (lift.{u, v} (type r)).cof
state_after: case a
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set (ULift.{u, v} { α := α, r := r, wo := inst✝ }.α)
H : Unbounded (ULift.down ⁻¹'o { α := α, r := r, wo := inst✝ }.r) S
⊢ Cardinal.lift.{u, v} (type r).cof ≤ #↑S

tactic: have : Cardinal.lift.{u, v} #(ULift.up ⁻¹' S) ≤ #(S : Type (max u v)) := by
  rw [← Cardinal.lift_umax.{v, u}, ← Cardinal.lift_id'.{v, u} #S]
  exact mk_preimage_of_injective_lift.{v, max u v} ULift.up S (ULift.up_injective.{v, u})
state_before: case a
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set (ULift.{u, v} { α := α, r := r, wo := inst✝ }.α)
H : Unbounded (ULift.down ⁻¹'o { α := α, r := r, wo := inst✝ }.r) S
⊢ Cardinal.lift.{u, v} (type r).cof ≤ #↑S
state_after: case a
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set (ULift.{u, v} { α := α, r := r, wo := inst✝ }.α)
H : Unbounded (ULift.down ⁻¹'o { α := α, r := r, wo := inst✝ }.r) S
this : Cardinal.lift.{u, v} #↑(ULift.up ⁻¹' S) ≤ #↑S
⊢ Cardinal.lift.{u, v} (type r).cof ≤ #↑S

tactic: refine (Cardinal.lift_le.2 <| cof_type_le ?_).trans this
state_before: case a
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set (ULift.{u, v} { α := α, r := r, wo := inst✝ }.α)
H : Unbounded (ULift.down ⁻¹'o { α := α, r := r, wo := inst✝ }.r) S
this : Cardinal.lift.{u, v} #↑(ULift.up ⁻¹' S) ≤ #↑S
⊢ Cardinal.lift.{u, v} (type r).cof ≤ #↑S
state_after: case a
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set (ULift.{u, v} { α := α, r := r, wo := inst✝ }.α)
H : Unbounded (ULift.down ⁻¹'o { α := α, r := r, wo := inst✝ }.r) S
this : Cardinal.lift.{u, v} #↑(ULift.up ⁻¹' S) ≤ #↑S
⊢ Unbounded r (ULift.up ⁻¹' S)

tactic: exact fun a =>
  let ⟨⟨b⟩, bs, br⟩ := H ⟨a⟩
  ⟨b, bs, br⟩
state_before: case a
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set (ULift.{u, v} { α := α, r := r, wo := inst✝ }.α)
H : Unbounded (ULift.down ⁻¹'o { α := α, r := r, wo := inst✝ }.r) S
this : Cardinal.lift.{u, v} #↑(ULift.up ⁻¹' S) ≤ #↑S
⊢ Unbounded r (ULift.up ⁻¹' S)
state_after: no goals

tactic: rw [← Cardinal.lift_umax.{v, u}, ← Cardinal.lift_id'.{v, u} #S]
state_before: α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set (ULift.{u, v} { α := α, r := r, wo := inst✝ }.α)
H : Unbounded (ULift.down ⁻¹'o { α := α, r := r, wo := inst✝ }.r) S
⊢ Cardinal.lift.{u, v} #↑(ULift.up ⁻¹' S) ≤ #↑S
state_after: α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set (ULift.{u, v} { α := α, r := r, wo := inst✝ }.α)
H : Unbounded (ULift.down ⁻¹'o { α := α, r := r, wo := inst✝ }.r) S
⊢ Cardinal.lift.{max v u, v} #↑(ULift.up ⁻¹' S) ≤ Cardinal.lift.{v, max v u} #↑S

tactic: exact mk_preimage_of_injective_lift.{v, max u v} ULift.up S (ULift.up_injective.{v, u})
state_before: α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set (ULift.{u, v} { α := α, r := r, wo := inst✝ }.α)
H : Unbounded (ULift.down ⁻¹'o { α := α, r := r, wo := inst✝ }.r) S
⊢ Cardinal.lift.{max v u, v} #↑(ULift.up ⁻¹' S) ≤ Cardinal.lift.{v, max v u} #↑S
state_after: no goals

tactic: rcases cof_eq r with ⟨S, H, e'⟩
state_before: case a
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
⊢ (lift.{u, v} (type r)).cof ≤ Cardinal.lift.{u, v} (type r).cof
state_after: case a.intro.intro
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
H : Unbounded r S
e' : #↑S = (type r).cof
⊢ (lift.{u, v} (type r)).cof ≤ Cardinal.lift.{u, v} (type r).cof

tactic: have : #(ULift.down.{u, v} ⁻¹' S) ≤ Cardinal.lift.{u, v} #S :=
  ⟨⟨fun ⟨⟨x⟩, h⟩ => ⟨⟨x, h⟩⟩, fun ⟨⟨x⟩, h₁⟩ ⟨⟨y⟩, h₂⟩ e => by
      simp at e; congr⟩⟩
state_before: case a.intro.intro
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
H : Unbounded r S
e' : #↑S = (type r).cof
⊢ (lift.{u, v} (type r)).cof ≤ Cardinal.lift.{u, v} (type r).cof
state_after: case a.intro.intro
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
H : Unbounded r S
e' : #↑S = (type r).cof
this : #↑(ULift.down ⁻¹' S) ≤ Cardinal.lift.{u, v} #↑S
⊢ (lift.{u, v} (type r)).cof ≤ Cardinal.lift.{u, v} (type r).cof

tactic: rw [e'] at this
state_before: case a.intro.intro
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
H : Unbounded r S
e' : #↑S = (type r).cof
this : #↑(ULift.down ⁻¹' S) ≤ Cardinal.lift.{u, v} #↑S
⊢ (lift.{u, v} (type r)).cof ≤ Cardinal.lift.{u, v} (type r).cof
state_after: case a.intro.intro
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
H : Unbounded r S
e' : #↑S = (type r).cof
this : #↑(ULift.down ⁻¹' S) ≤ Cardinal.lift.{u, v} (type r).cof
⊢ (lift.{u, v} (type r)).cof ≤ Cardinal.lift.{u, v} (type r).cof

tactic: refine (cof_type_le ?_).trans this
state_before: case a.intro.intro
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
H : Unbounded r S
e' : #↑S = (type r).cof
this : #↑(ULift.down ⁻¹' S) ≤ Cardinal.lift.{u, v} (type r).cof
⊢ (lift.{u, v} (type r)).cof ≤ Cardinal.lift.{u, v} (type r).cof
state_after: case a.intro.intro
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
H : Unbounded r S
e' : #↑S = (type r).cof
this : #↑(ULift.down ⁻¹' S) ≤ Cardinal.lift.{u, v} (type r).cof
⊢ Unbounded (ULift.down ⁻¹'o { α := α, r := r, wo := inst✝ }.r) (ULift.down ⁻¹' S)

tactic: exact fun ⟨a⟩ =>
  let ⟨b, bs, br⟩ := H a
  ⟨⟨b⟩, bs, br⟩
state_before: case a.intro.intro
α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
H : Unbounded r S
e' : #↑S = (type r).cof
this : #↑(ULift.down ⁻¹' S) ≤ Cardinal.lift.{u, v} (type r).cof
⊢ Unbounded (ULift.down ⁻¹'o { α := α, r := r, wo := inst✝ }.r) (ULift.down ⁻¹' S)
state_after: no goals

tactic: simp at e
state_before: α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
H : Unbounded r S
e' : #↑S = (type r).cof
x✝¹ x✝ : ↑(ULift.down ⁻¹' S)
x : α
h₁ : { down := x } ∈ ULift.down ⁻¹' S
y : α
h₂ : { down := y } ∈ ULift.down ⁻¹' S
e :
  (fun x =>
        match x with
        | ⟨{ down := x }, h⟩ => { down := ⟨x, h⟩ })
      ⟨{ down := x }, h₁⟩ =
    (fun x =>
        match x with
        | ⟨{ down := x }, h⟩ => { down := ⟨x, h⟩ })
      ⟨{ down := y }, h₂⟩
⊢ ⟨{ down := x }, h₁⟩ = ⟨{ down := y }, h₂⟩
state_after: α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
H : Unbounded r S
e' : #↑S = (type r).cof
x✝¹ x✝ : ↑(ULift.down ⁻¹' S)
x : α
h₁ : { down := x } ∈ ULift.down ⁻¹' S
y : α
h₂ : { down := y } ∈ ULift.down ⁻¹' S
e : x = y
⊢ ⟨{ down := x }, h₁⟩ = ⟨{ down := y }, h₂⟩

tactic: congr
state_before: α✝ : Type u_1
r✝ : α✝ → α✝ → Prop
o : Ordinal.{v}
α : Type v
r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
H : Unbounded r S
e' : #↑S = (type r).cof
x✝¹ x✝ : ↑(ULift.down ⁻¹' S)
x : α
h₁ : { down := x } ∈ ULift.down ⁻¹' S
y : α
h₂ : { down := y } ∈ ULift.down ⁻¹' S
e : x = y
⊢ ⟨{ down := x }, h₁⟩ = ⟨{ down := y }, h₂⟩
state_after: no goals