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

tactic: let ⟨S, hS, e⟩ := cof_eq r
state_before: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
⊢ ∃ S, Unbounded r S ∧ type (Subrel r S) = (type r).cof.ord
state_after: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
⊢ ∃ S, Unbounded r S ∧ type (Subrel r S) = (type r).cof.ord

tactic: let ⟨s, _, e'⟩ := Cardinal.ord_eq S
state_before: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
⊢ ∃ S, Unbounded r S ∧ type (Subrel r S) = (type r).cof.ord
state_after: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
⊢ ∃ S, Unbounded r S ∧ type (Subrel r S) = (type r).cof.ord

tactic: let T : Set α := { a | ∃ aS : a ∈ S, ∀ b : S, s b ⟨_, aS⟩ → r b a }
state_before: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
⊢ ∃ S, Unbounded r S ∧ type (Subrel r S) = (type r).cof.ord
state_after: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
⊢ ∃ S, Unbounded r S ∧ type (Subrel r S) = (type r).cof.ord

tactic: intro a
state_before: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
⊢ Unbounded r T
state_after: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
a : α
⊢ ∃ b ∈ T, ¬r b a

tactic: have : { b : S | ¬r b a }.Nonempty :=
  let ⟨b, bS, ba⟩ := hS a
  ⟨⟨b, bS⟩, ba⟩
state_before: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
a : α
⊢ ∃ b ∈ T, ¬r b a
state_after: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
a : α
this : {b | ¬r (↑b) a}.Nonempty
⊢ ∃ b ∈ T, ¬r b a

tactic: let b := (IsWellFounded.wf : WellFounded s).min _ this
state_before: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
a : α
this : {b | ¬r (↑b) a}.Nonempty
⊢ ∃ b ∈ T, ¬r b a
state_after: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
a : α
this : {b | ¬r (↑b) a}.Nonempty
b : ↑S := ⋯.min {b | ¬r (↑b) a} this
⊢ ∃ b ∈ T, ¬r b a

tactic: have ba : ¬r b a := IsWellFounded.wf.min_mem _ this
state_before: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
a : α
this : {b | ¬r (↑b) a}.Nonempty
b : ↑S := ⋯.min {b | ¬r (↑b) a} this
⊢ ∃ b ∈ T, ¬r b a
state_after: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
a : α
this : {b | ¬r (↑b) a}.Nonempty
b : ↑S := ⋯.min {b | ¬r (↑b) a} this
ba : ¬r (↑b) a
⊢ ∃ b ∈ T, ¬r b a

tactic: refine ⟨b, ⟨b.2, fun c => not_imp_not.1 fun h => ?_⟩, ba⟩
state_before: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
a : α
this : {b | ¬r (↑b) a}.Nonempty
b : ↑S := ⋯.min {b | ¬r (↑b) a} this
ba : ¬r (↑b) a
⊢ ∃ b ∈ T, ¬r b a
state_after: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
a : α
this : {b | ¬r (↑b) a}.Nonempty
b : ↑S := ⋯.min {b | ¬r (↑b) a} this
ba : ¬r (↑b) a
c : ↑S
h : ¬r ↑c ↑b
⊢ ¬s c ⟨↑b, ⋯⟩

tactic: rw [show ∀ b : S, (⟨b, b.2⟩ : S) = b by intro b; cases b; rfl]
state_before: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
a : α
this : {b | ¬r (↑b) a}.Nonempty
b : ↑S := ⋯.min {b | ¬r (↑b) a} this
ba : ¬r (↑b) a
c : ↑S
h : ¬r ↑c ↑b
⊢ ¬s c ⟨↑b, ⋯⟩
state_after: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
a : α
this : {b | ¬r (↑b) a}.Nonempty
b : ↑S := ⋯.min {b | ¬r (↑b) a} this
ba : ¬r (↑b) a
c : ↑S
h : ¬r ↑c ↑b
⊢ ¬s c b

tactic: exact IsWellFounded.wf.not_lt_min _ this (IsOrderConnected.neg_trans h ba)
state_before: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
a : α
this : {b | ¬r (↑b) a}.Nonempty
b : ↑S := ⋯.min {b | ¬r (↑b) a} this
ba : ¬r (↑b) a
c : ↑S
h : ¬r ↑c ↑b
⊢ ¬s c b
state_after: no goals

tactic: refine ⟨T, this, le_antisymm ?_ (Cardinal.ord_le.2 <| cof_type_le this)⟩
state_before: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
⊢ ∃ S, Unbounded r S ∧ type (Subrel r S) = (type r).cof.ord
state_after: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
⊢ type (Subrel r T) ≤ (type r).cof.ord

tactic: rw [← e, e']
state_before: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
⊢ type (Subrel r T) ≤ (type r).cof.ord
state_after: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
⊢ type (Subrel r T) ≤ type s

tactic: refine
  (RelEmbedding.ofMonotone
      (fun a : T =>
        (⟨a,
            let ⟨aS, _⟩ := a.2
            aS⟩ :
          S))
      fun a b h => ?_).ordinal_type_le
state_before: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
⊢ type (Subrel r T) ≤ type s
state_after: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
a b : ↑T
h : Subrel r T a b
⊢ s ((fun a => ⟨↑a, ⋯⟩) a) ((fun a => ⟨↑a, ⋯⟩) b)

tactic: rcases a with ⟨a, aS, ha⟩
state_before: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
a b : ↑T
h : Subrel r T a b
⊢ s ((fun a => ⟨↑a, ⋯⟩) a) ((fun a => ⟨↑a, ⋯⟩) b)
state_after: case mk.intro
α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
b : ↑T
a : α
aS : a ∈ S
ha : ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a
h : Subrel r T ⟨a, ⋯⟩ b
⊢ s ((fun a => ⟨↑a, ⋯⟩) ⟨a, ⋯⟩) ((fun a => ⟨↑a, ⋯⟩) b)

tactic: rcases b with ⟨b, bS, hb⟩
state_before: case mk.intro
α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
b : ↑T
a : α
aS : a ∈ S
ha : ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a
h : Subrel r T ⟨a, ⋯⟩ b
⊢ s ((fun a => ⟨↑a, ⋯⟩) ⟨a, ⋯⟩) ((fun a => ⟨↑a, ⋯⟩) b)
state_after: case mk.intro.mk.intro
α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
a : α
aS : a ∈ S
ha : ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a
b : α
bS : b ∈ S
hb : ∀ (b_1 : ↑S), s b_1 ⟨b, bS⟩ → r (↑b_1) b
h : Subrel r T ⟨a, ⋯⟩ ⟨b, ⋯⟩
⊢ s ((fun a => ⟨↑a, ⋯⟩) ⟨a, ⋯⟩) ((fun a => ⟨↑a, ⋯⟩) ⟨b, ⋯⟩)

tactic: change s ⟨a, _⟩ ⟨b, _⟩
state_before: case mk.intro.mk.intro
α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
a : α
aS : a ∈ S
ha : ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a
b : α
bS : b ∈ S
hb : ∀ (b_1 : ↑S), s b_1 ⟨b, bS⟩ → r (↑b_1) b
h : Subrel r T ⟨a, ⋯⟩ ⟨b, ⋯⟩
⊢ s ((fun a => ⟨↑a, ⋯⟩) ⟨a, ⋯⟩) ((fun a => ⟨↑a, ⋯⟩) ⟨b, ⋯⟩)
state_after: case mk.intro.mk.intro
α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
a : α
aS : a ∈ S
ha : ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a
b : α
bS : b ∈ S
hb : ∀ (b_1 : ↑S), s b_1 ⟨b, bS⟩ → r (↑b_1) b
h : Subrel r T ⟨a, ⋯⟩ ⟨b, ⋯⟩
⊢ s ⟨a, ⋯⟩ ⟨b, ⋯⟩

tactic: refine ((trichotomous_of s _ _).resolve_left fun hn => ?_).resolve_left ?_
state_before: case mk.intro.mk.intro
α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
a : α
aS : a ∈ S
ha : ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a
b : α
bS : b ∈ S
hb : ∀ (b_1 : ↑S), s b_1 ⟨b, bS⟩ → r (↑b_1) b
h : Subrel r T ⟨a, ⋯⟩ ⟨b, ⋯⟩
⊢ s ⟨a, ⋯⟩ ⟨b, ⋯⟩
state_after: case mk.intro.mk.intro.refine_1
α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
a : α
aS : a ∈ S
ha : ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a
b : α
bS : b ∈ S
hb : ∀ (b_1 : ↑S), s b_1 ⟨b, bS⟩ → r (↑b_1) b
h : Subrel r T ⟨a, ⋯⟩ ⟨b, ⋯⟩
hn : s ⟨b, ⋯⟩ ⟨a, ⋯⟩
⊢ False

case mk.intro.mk.intro.refine_2
α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
a : α
aS : a ∈ S
ha : ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a
b : α
bS : b ∈ S
hb : ∀ (b_1 : ↑S), s b_1 ⟨b, bS⟩ → r (↑b_1) b
h : Subrel r T ⟨a, ⋯⟩ ⟨b, ⋯⟩
⊢ ¬⟨b, ⋯⟩ = ⟨a, ⋯⟩

tactic: exact asymm h (ha _ hn)
state_before: case mk.intro.mk.intro.refine_1
α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
a : α
aS : a ∈ S
ha : ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a
b : α
bS : b ∈ S
hb : ∀ (b_1 : ↑S), s b_1 ⟨b, bS⟩ → r (↑b_1) b
h : Subrel r T ⟨a, ⋯⟩ ⟨b, ⋯⟩
hn : s ⟨b, ⋯⟩ ⟨a, ⋯⟩
⊢ False
state_after: no goals

tactic: intro e
state_before: case mk.intro.mk.intro.refine_2
α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
a : α
aS : a ∈ S
ha : ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a
b : α
bS : b ∈ S
hb : ∀ (b_1 : ↑S), s b_1 ⟨b, bS⟩ → r (↑b_1) b
h : Subrel r T ⟨a, ⋯⟩ ⟨b, ⋯⟩
⊢ ¬⟨b, ⋯⟩ = ⟨a, ⋯⟩
state_after: case mk.intro.mk.intro.refine_2
α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e✝ : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
a : α
aS : a ∈ S
ha : ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a
b : α
bS : b ∈ S
hb : ∀ (b_1 : ↑S), s b_1 ⟨b, bS⟩ → r (↑b_1) b
h : Subrel r T ⟨a, ⋯⟩ ⟨b, ⋯⟩
e : ⟨b, ⋯⟩ = ⟨a, ⋯⟩
⊢ False

tactic: injection e with e
state_before: case mk.intro.mk.intro.refine_2
α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e✝ : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
a : α
aS : a ∈ S
ha : ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a
b : α
bS : b ∈ S
hb : ∀ (b_1 : ↑S), s b_1 ⟨b, bS⟩ → r (↑b_1) b
h : Subrel r T ⟨a, ⋯⟩ ⟨b, ⋯⟩
e : ⟨b, ⋯⟩ = ⟨a, ⋯⟩
⊢ False
state_after: case mk.intro.mk.intro.refine_2
α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e✝ : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
a : α
aS : a ∈ S
ha : ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a
b : α
bS : b ∈ S
hb : ∀ (b_1 : ↑S), s b_1 ⟨b, bS⟩ → r (↑b_1) b
h : Subrel r T ⟨a, ⋯⟩ ⟨b, ⋯⟩
e : b = a
⊢ False

tactic: subst b
state_before: case mk.intro.mk.intro.refine_2
α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e✝ : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
a : α
aS : a ∈ S
ha : ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a
b : α
bS : b ∈ S
hb : ∀ (b_1 : ↑S), s b_1 ⟨b, bS⟩ → r (↑b_1) b
h : Subrel r T ⟨a, ⋯⟩ ⟨b, ⋯⟩
e : b = a
⊢ False
state_after: case mk.intro.mk.intro.refine_2
α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
a : α
aS : a ∈ S
ha : ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a
bS : a ∈ S
hb : ∀ (b : ↑S), s b ⟨a, bS⟩ → r (↑b) a
h : Subrel r T ⟨a, ⋯⟩ ⟨a, ⋯⟩
⊢ False

tactic: exact irrefl _ h
state_before: case mk.intro.mk.intro.refine_2
α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
this : Unbounded r T
a : α
aS : a ∈ S
ha : ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a
bS : a ∈ S
hb : ∀ (b : ↑S), s b ⟨a, bS⟩ → r (↑b) a
h : Subrel r T ⟨a, ⋯⟩ ⟨a, ⋯⟩
⊢ False
state_after: no goals

tactic: intro b
state_before: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
a : α
this : {b | ¬r (↑b) a}.Nonempty
b : ↑S := ⋯.min {b | ¬r (↑b) a} this
ba : ¬r (↑b) a
c : ↑S
h : ¬r ↑c ↑b
⊢ ∀ (b : ↑S), ⟨↑b, ⋯⟩ = b
state_after: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
a : α
this : {b | ¬r (↑b) a}.Nonempty
b✝ : ↑S := ⋯.min {b | ¬r (↑b) a} this
ba : ¬r (↑b✝) a
c : ↑S
h : ¬r ↑c ↑b✝
b : ↑S
⊢ ⟨↑b, ⋯⟩ = b

tactic: cases b
state_before: α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
a : α
this : {b | ¬r (↑b) a}.Nonempty
b✝ : ↑S := ⋯.min {b | ¬r (↑b) a} this
ba : ¬r (↑b✝) a
c : ↑S
h : ¬r ↑c ↑b✝
b : ↑S
⊢ ⟨↑b, ⋯⟩ = b
state_after: case mk
α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
a : α
this : {b | ¬r (↑b) a}.Nonempty
b : ↑S := ⋯.min {b | ¬r (↑b) a} this
ba : ¬r (↑b) a
c : ↑S
h : ¬r ↑c ↑b
val✝ : α
property✝ : val✝ ∈ S
⊢ ⟨↑⟨val✝, property✝⟩, ⋯⟩ = ⟨val✝, property✝⟩

tactic: rfl
state_before: case mk
α : Type u_1
r✝ r : α → α → Prop
inst✝ : IsWellOrder α r
S : Set α
hS : Unbounded r S
e : #↑S = (type r).cof
s : ↑S → ↑S → Prop
w✝ : IsWellOrder (↑S) s
e' : (#↑S).ord = type s
T : Set α := {a | ∃ (aS : a ∈ S), ∀ (b : ↑S), s b ⟨a, aS⟩ → r (↑b) a}
a : α
this : {b | ¬r (↑b) a}.Nonempty
b : ↑S := ⋯.min {b | ¬r (↑b) a} this
ba : ¬r (↑b) a
c : ↑S
h : ¬r ↑c ↑b
val✝ : α
property✝ : val✝ ∈ S
⊢ ⟨↑⟨val✝, property✝⟩, ⋯⟩ = ⟨val✝, property✝⟩
state_after: no goals