Theorem: CompleteLattice.WellFounded.isSupFiniteCompact
File: Mathlib/Order/CompactlyGenerated.lean

tactic: let S := { x | ∃ t : Finset α, ↑t ⊆ s ∧ t.sup id = x }
state_before: ι : Sort ?u.16216
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
h : WellFounded fun x x_1 => x > x_1
s : Set α
⊢ ∃ t, ↑t ⊆ s ∧ sSup s = Finset.sup t id

tactic: obtain ⟨m, ⟨t, ⟨ht₁, rfl⟩⟩, hm⟩ := h.has_min S ⟨⊥, ∅, by simp⟩
state_before: ι : Sort ?u.16216
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
h : WellFounded fun x x_1 => x > x_1
s : Set α
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ Finset.sup t id = x}
⊢ ∃ t, ↑t ⊆ s ∧ sSup s = Finset.sup t id

tactic: refine' ⟨t, ht₁, (sSup_le _ _ fun y hy => _).antisymm _⟩
state_before: case intro.intro.intro.intro
ι : Sort ?u.16216
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
h : WellFounded fun x x_1 => x > x_1
s : Set α
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ Finset.sup t id = x}
t : Finset α
ht₁ : ↑t ⊆ s
hm : ∀ (x : α), x ∈ S → ¬x > Finset.sup t id
⊢ ∃ t, ↑t ⊆ s ∧ sSup s = Finset.sup t id

tactic: simp
state_before: ι : Sort ?u.16216
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
h : WellFounded fun x x_1 => x > x_1
s : Set α
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ Finset.sup t id = x}
⊢ ↑∅ ⊆ s ∧ Finset.sup ∅ id = ⊥

tactic: classical
rw [eq_of_le_of_not_lt (Finset.sup_mono (t.subset_insert y))
    (hm _ ⟨insert y t, by simp [Set.insert_subset, hy, ht₁]⟩)]
simp
state_before: case intro.intro.intro.intro.refine'_1
ι : Sort ?u.16216
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
h : WellFounded fun x x_1 => x > x_1
s : Set α
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ Finset.sup t id = x}
t : Finset α
ht₁ : ↑t ⊆ s
hm : ∀ (x : α), x ∈ S → ¬x > Finset.sup t id
y : α
hy : y ∈ s
⊢ y ≤ Finset.sup t id

tactic: rw [eq_of_le_of_not_lt (Finset.sup_mono (t.subset_insert y))
    (hm _ ⟨insert y t, by simp [Set.insert_subset, hy, ht₁]⟩)]
state_before: case intro.intro.intro.intro.refine'_1
ι : Sort ?u.16216
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
h : WellFounded fun x x_1 => x > x_1
s : Set α
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ Finset.sup t id = x}
t : Finset α
ht₁ : ↑t ⊆ s
hm : ∀ (x : α), x ∈ S → ¬x > Finset.sup t id
y : α
hy : y ∈ s
⊢ y ≤ Finset.sup t id

tactic: simp
state_before: case intro.intro.intro.intro.refine'_1
ι : Sort ?u.16216
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
h : WellFounded fun x x_1 => x > x_1
s : Set α
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ Finset.sup t id = x}
t : Finset α
ht₁ : ↑t ⊆ s
hm : ∀ (x : α), x ∈ S → ¬x > Finset.sup t id
y : α
hy : y ∈ s
⊢ y ≤ Finset.sup (insert y t) id

tactic: simp [Set.insert_subset, hy, ht₁]
state_before: ι : Sort ?u.16216
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
h : WellFounded fun x x_1 => x > x_1
s : Set α
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ Finset.sup t id = x}
t : Finset α
ht₁ : ↑t ⊆ s
hm : ∀ (x : α), x ∈ S → ¬x > Finset.sup t id
y : α
hy : y ∈ s
⊢ ↑(insert y t) ⊆ s ∧ Finset.sup (insert y t) id = Finset.sup (insert y t) id

tactic: rw [Finset.sup_id_eq_sSup]
state_before: case intro.intro.intro.intro.refine'_2
ι : Sort ?u.16216
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
h : WellFounded fun x x_1 => x > x_1
s : Set α
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ Finset.sup t id = x}
t : Finset α
ht₁ : ↑t ⊆ s
hm : ∀ (x : α), x ∈ S → ¬x > Finset.sup t id
⊢ Finset.sup t id ≤ sSup s

tactic: exact sSup_le_sSup ht₁
state_before: case intro.intro.intro.intro.refine'_2
ι : Sort ?u.16216
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
h : WellFounded fun x x_1 => x > x_1
s : Set α
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ Finset.sup t id = x}
t : Finset α
ht₁ : ↑t ⊆ s
hm : ∀ (x : α), x ∈ S → ¬x > Finset.sup t id
⊢ sSup ↑t ≤ sSup s