Theorem: Ordinal.enumOrd_surjective
File: Mathlib/SetTheory/Ordinal/Arithmetic.lean

tactic: apply le_antisymm
state_before: S : Set Ordinal.{u}
hS : Unbounded (fun x x_1 => x < x_1) S
s : Ordinal.{u}
hs : s ∈ S
⊢ enumOrd S (sSup {a | enumOrd S a ≤ s}) = s
state_after: case a
S : Set Ordinal.{u}
hS : Unbounded (fun x x_1 => x < x_1) S
s : Ordinal.{u}
hs : s ∈ S
⊢ enumOrd S (sSup {a | enumOrd S a ≤ s}) ≤ s

case a
S : Set Ordinal.{u}
hS : Unbounded (fun x x_1 => x < x_1) S
s : Ordinal.{u}
hs : s ∈ S
⊢ s ≤ enumOrd S (sSup {a | enumOrd S a ≤ s})

tactic: rw [enumOrd_def]
state_before: case a
S : Set Ordinal.{u}
hS : Unbounded (fun x x_1 => x < x_1) S
s : Ordinal.{u}
hs : s ∈ S
⊢ enumOrd S (sSup {a | enumOrd S a ≤ s}) ≤ s
state_after: case a
S : Set Ordinal.{u}
hS : Unbounded (fun x x_1 => x < x_1) S
s : Ordinal.{u}
hs : s ∈ S
⊢ sInf (S ∩ {b | ∀ c < sSup {a | enumOrd S a ≤ s}, enumOrd S c < b}) ≤ s

tactic: refine csInf_le' ⟨hs, fun a ha => ?_⟩
state_before: case a
S : Set Ordinal.{u}
hS : Unbounded (fun x x_1 => x < x_1) S
s : Ordinal.{u}
hs : s ∈ S
⊢ sInf (S ∩ {b | ∀ c < sSup {a | enumOrd S a ≤ s}, enumOrd S c < b}) ≤ s
state_after: case a
S : Set Ordinal.{u}
hS : Unbounded (fun x x_1 => x < x_1) S
s : Ordinal.{u}
hs : s ∈ S
a : Ordinal.{u}
ha : a < sSup {a | enumOrd S a ≤ s}
⊢ enumOrd S a < s

tactic: have : enumOrd S 0 ≤ s := by
  rw [enumOrd_zero]
  exact csInf_le' hs
state_before: case a
S : Set Ordinal.{u}
hS : Unbounded (fun x x_1 => x < x_1) S
s : Ordinal.{u}
hs : s ∈ S
a : Ordinal.{u}
ha : a < sSup {a | enumOrd S a ≤ s}
⊢ enumOrd S a < s
state_after: case a
S : Set Ordinal.{u}
hS : Unbounded (fun x x_1 => x < x_1) S
s : Ordinal.{u}
hs : s ∈ S
a : Ordinal.{u}
ha : a < sSup {a | enumOrd S a ≤ s}
this : enumOrd S 0 ≤ s
⊢ enumOrd S a < s

tactic: rcases flip exists_lt_of_lt_csSup ha ⟨0, this⟩ with ⟨b, hb, hab⟩
state_before: case a
S : Set Ordinal.{u}
hS : Unbounded (fun x x_1 => x < x_1) S
s : Ordinal.{u}
hs : s ∈ S
a : Ordinal.{u}
ha : a < sSup {a | enumOrd S a ≤ s}
this : enumOrd S 0 ≤ s
⊢ enumOrd S a < s
state_after: case a.intro.intro
S : Set Ordinal.{u}
hS : Unbounded (fun x x_1 => x < x_1) S
s : Ordinal.{u}
hs : s ∈ S
a : Ordinal.{u}
ha : a < sSup {a | enumOrd S a ≤ s}
this : enumOrd S 0 ≤ s
b : Ordinal.{u}
hb : b ∈ {a | enumOrd S a ≤ s}
hab : a < b
⊢ enumOrd S a < s

tactic: exact (enumOrd_strictMono hS hab).trans_le hb
state_before: case a.intro.intro
S : Set Ordinal.{u}
hS : Unbounded (fun x x_1 => x < x_1) S
s : Ordinal.{u}
hs : s ∈ S
a : Ordinal.{u}
ha : a < sSup {a | enumOrd S a ≤ s}
this : enumOrd S 0 ≤ s
b : Ordinal.{u}
hb : b ∈ {a | enumOrd S a ≤ s}
hab : a < b
⊢ enumOrd S a < s
state_after: no goals

tactic: rw [enumOrd_zero]
state_before: S : Set Ordinal.{u}
hS : Unbounded (fun x x_1 => x < x_1) S
s : Ordinal.{u}
hs : s ∈ S
a : Ordinal.{u}
ha : a < sSup {a | enumOrd S a ≤ s}
⊢ enumOrd S 0 ≤ s
state_after: S : Set Ordinal.{u}
hS : Unbounded (fun x x_1 => x < x_1) S
s : Ordinal.{u}
hs : s ∈ S
a : Ordinal.{u}
ha : a < sSup {a | enumOrd S a ≤ s}
⊢ sInf S ≤ s

tactic: exact csInf_le' hs
state_before: S : Set Ordinal.{u}
hS : Unbounded (fun x x_1 => x < x_1) S
s : Ordinal.{u}
hs : s ∈ S
a : Ordinal.{u}
ha : a < sSup {a | enumOrd S a ≤ s}
⊢ sInf S ≤ s
state_after: no goals

tactic: by_contra! h
state_before: case a
S : Set Ordinal.{u}
hS : Unbounded (fun x x_1 => x < x_1) S
s : Ordinal.{u}
hs : s ∈ S
⊢ s ≤ enumOrd S (sSup {a | enumOrd S a ≤ s})
state_after: case a
S : Set Ordinal.{u}
hS : Unbounded (fun x x_1 => x < x_1) S
s : Ordinal.{u}
hs : s ∈ S
h : enumOrd S (sSup {a | enumOrd S a ≤ s}) < s
⊢ False

tactic: exact
  (le_csSup ⟨s, fun a => (lt_wf.self_le_of_strictMono (enumOrd_strictMono hS) a).trans⟩
        (enumOrd_succ_le hS hs h)).not_lt
    (lt_succ _)
state_before: case a
S : Set Ordinal.{u}
hS : Unbounded (fun x x_1 => x < x_1) S
s : Ordinal.{u}
hs : s ∈ S
h : enumOrd S (sSup {a | enumOrd S a ≤ s}) < s
⊢ False
state_after: no goals