Theorem: CompleteLattice.isCompactElement_iff_le_of_directed_sSup_le
File: Mathlib/Order/CompactlyGenerated.lean

tactic: constructor
state_before: ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
⊢ IsCompactElement k ↔
    ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x

tactic: intro hk s hne hdir hsup
state_before: case mp
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
⊢ IsCompactElement k →
    ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x

tactic: obtain ⟨t, ht⟩ := hk s hsup
state_before: case mp
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : IsCompactElement k
s : Set α
hne : Set.Nonempty s
hdir : DirectedOn (fun x x_1 => x ≤ x_1) s
hsup : k ≤ sSup s
⊢ ∃ x, x ∈ s ∧ k ≤ x

tactic: have t_below_s : ∀ x ∈ t, ∃ y ∈ s, x ≤ y := fun x hxt => ⟨x, ht.left hxt, le_rfl⟩
state_before: case mp.intro
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : IsCompactElement k
s : Set α
hne : Set.Nonempty s
hdir : DirectedOn (fun x x_1 => x ≤ x_1) s
hsup : k ≤ sSup s
t : Finset α
ht : ↑t ⊆ s ∧ k ≤ Finset.sup t id
⊢ ∃ x, x ∈ s ∧ k ≤ x

tactic: obtain ⟨x, ⟨hxs, hsupx⟩⟩ := Finset.sup_le_of_le_directed s hne hdir t t_below_s
state_before: case mp.intro
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : IsCompactElement k
s : Set α
hne : Set.Nonempty s
hdir : DirectedOn (fun x x_1 => x ≤ x_1) s
hsup : k ≤ sSup s
t : Finset α
ht : ↑t ⊆ s ∧ k ≤ Finset.sup t id
t_below_s : ∀ (x : α), x ∈ t → ∃ y, y ∈ s ∧ x ≤ y
⊢ ∃ x, x ∈ s ∧ k ≤ x

tactic: exact ⟨x, ⟨hxs, le_trans ht.right hsupx⟩⟩
state_before: case mp.intro.intro.intro
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : IsCompactElement k
s : Set α
hne : Set.Nonempty s
hdir : DirectedOn (fun x x_1 => x ≤ x_1) s
hsup : k ≤ sSup s
t : Finset α
ht : ↑t ⊆ s ∧ k ≤ Finset.sup t id
t_below_s : ∀ (x : α), x ∈ t → ∃ y, y ∈ s ∧ x ≤ y
x : α
hxs : x ∈ s
hsupx : Finset.sup t id ≤ x
⊢ ∃ x, x ∈ s ∧ k ≤ x

tactic: intro hk s hsup
state_before: case mpr
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
⊢ (∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x) →
    IsCompactElement k

tactic: let S : Set α := { x | ∃ t : Finset α, ↑t ⊆ s ∧ x = t.sup id }
state_before: case mpr
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
⊢ ∃ t, ↑t ⊆ s ∧ k ≤ Finset.sup t id

tactic: have sup_S : sSup s ≤ sSup S := by
  apply sSup_le_sSup
  intro x hx
  use {x}
  simpa only [and_true_iff, id.def, Finset.coe_singleton, eq_self_iff_true,
    Finset.sup_singleton, Set.singleton_subset_iff]
state_before: case mpr
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
dir_US : DirectedOn (fun x x_1 => x ≤ x_1) S
⊢ ∃ t, ↑t ⊆ s ∧ k ≤ Finset.sup t id

tactic: have Sne : S.Nonempty := by
  suffices : ⊥ ∈ S
  exact Set.nonempty_of_mem this
  use ∅
  simp only [Set.empty_subset, Finset.coe_empty, Finset.sup_empty, eq_self_iff_true,
    and_self_iff]
state_before: case mpr
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
dir_US : DirectedOn (fun x x_1 => x ≤ x_1) S
sup_S : sSup s ≤ sSup S
⊢ ∃ t, ↑t ⊆ s ∧ k ≤ Finset.sup t id

tactic: obtain ⟨j, ⟨hjS, hjk⟩⟩ := hk S Sne dir_US (le_trans hsup sup_S)
state_before: case mpr
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
dir_US : DirectedOn (fun x x_1 => x ≤ x_1) S
sup_S : sSup s ≤ sSup S
Sne : Set.Nonempty S
⊢ ∃ t, ↑t ⊆ s ∧ k ≤ Finset.sup t id

tactic: obtain ⟨t, ⟨htS, htsup⟩⟩ := hjS
state_before: case mpr.intro.intro
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
dir_US : DirectedOn (fun x x_1 => x ≤ x_1) S
sup_S : sSup s ≤ sSup S
Sne : Set.Nonempty S
j : α
hjS : j ∈ S
hjk : k ≤ j
⊢ ∃ t, ↑t ⊆ s ∧ k ≤ Finset.sup t id

tactic: use t
state_before: case mpr.intro.intro.intro.intro
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
dir_US : DirectedOn (fun x x_1 => x ≤ x_1) S
sup_S : sSup s ≤ sSup S
Sne : Set.Nonempty S
j : α
hjk : k ≤ j
t : Finset α
htS : ↑t ⊆ s
htsup : j = Finset.sup t id
⊢ ∃ t, ↑t ⊆ s ∧ k ≤ Finset.sup t id

tactic: exact ⟨htS, by rwa [← htsup]⟩
state_before: case mpr.intro.intro.intro.intro
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
dir_US : DirectedOn (fun x x_1 => x ≤ x_1) S
sup_S : sSup s ≤ sSup S
Sne : Set.Nonempty S
j : α
hjk : k ≤ j
t : Finset α
htS : ↑t ⊆ s
htsup : j = Finset.sup t id
⊢ ↑t ⊆ s ∧ k ≤ Finset.sup t id

tactic: rintro x ⟨c, hc⟩ y ⟨d, hd⟩
state_before: ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
⊢ DirectedOn (fun x x_1 => x ≤ x_1) S

tactic: use x ⊔ y
state_before: case intro.intro
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
x : α
c : Finset α
hc : ↑c ⊆ s ∧ x = Finset.sup c id
y : α
d : Finset α
hd : ↑d ⊆ s ∧ y = Finset.sup d id
⊢ ∃ z, z ∈ S ∧ (fun x x_1 => x ≤ x_1) x z ∧ (fun x x_1 => x ≤ x_1) y z

tactic: constructor
state_before: case intro.intro
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
x : α
c : Finset α
hc : ↑c ⊆ s ∧ x = Finset.sup c id
y : α
d : Finset α
hd : ↑d ⊆ s ∧ y = Finset.sup d id
⊢ x ⊔ y ∈ S ∧ (fun x x_1 => x ≤ x_1) x (x ⊔ y) ∧ (fun x x_1 => x ≤ x_1) y (x ⊔ y)

tactic: simp only [and_self_iff, le_sup_left, le_sup_right]
state_before: case intro.intro.right
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
x : α
c : Finset α
hc : ↑c ⊆ s ∧ x = Finset.sup c id
y : α
d : Finset α
hd : ↑d ⊆ s ∧ y = Finset.sup d id
⊢ (fun x x_1 => x ≤ x_1) x (x ⊔ y) ∧ (fun x x_1 => x ≤ x_1) y (x ⊔ y)

tactic: use c ∪ d
state_before: case intro.intro.left
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
x : α
c : Finset α
hc : ↑c ⊆ s ∧ x = Finset.sup c id
y : α
d : Finset α
hd : ↑d ⊆ s ∧ y = Finset.sup d id
⊢ x ⊔ y ∈ S

tactic: constructor
state_before: case intro.intro.left
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
x : α
c : Finset α
hc : ↑c ⊆ s ∧ x = Finset.sup c id
y : α
d : Finset α
hd : ↑d ⊆ s ∧ y = Finset.sup d id
⊢ ↑(c ∪ d) ⊆ s ∧ x ⊔ y = Finset.sup (c ∪ d) id

tactic: simp only [hc.left, hd.left, Set.union_subset_iff, Finset.coe_union, and_self_iff]
state_before: case intro.intro.left.left
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
x : α
c : Finset α
hc : ↑c ⊆ s ∧ x = Finset.sup c id
y : α
d : Finset α
hd : ↑d ⊆ s ∧ y = Finset.sup d id
⊢ ↑(c ∪ d) ⊆ s

tactic: simp only [hc.right, hd.right, Finset.sup_union]
state_before: case intro.intro.left.right
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
x : α
c : Finset α
hc : ↑c ⊆ s ∧ x = Finset.sup c id
y : α
d : Finset α
hd : ↑d ⊆ s ∧ y = Finset.sup d id
⊢ x ⊔ y = Finset.sup (c ∪ d) id

tactic: apply sSup_le_sSup
state_before: ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
dir_US : DirectedOn (fun x x_1 => x ≤ x_1) S
⊢ sSup s ≤ sSup S

tactic: intro x hx
state_before: case h
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
dir_US : DirectedOn (fun x x_1 => x ≤ x_1) S
⊢ s ⊆ S

tactic: use {x}
state_before: case h
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
dir_US : DirectedOn (fun x x_1 => x ≤ x_1) S
x : α
hx : x ∈ s
⊢ x ∈ S

tactic: simpa only [and_true_iff, id.def, Finset.coe_singleton, eq_self_iff_true,
  Finset.sup_singleton, Set.singleton_subset_iff]
state_before: case h
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
dir_US : DirectedOn (fun x x_1 => x ≤ x_1) S
x : α
hx : x ∈ s
⊢ ↑{x} ⊆ s ∧ x = Finset.sup {x} id

tactic: suffices : ⊥ ∈ S
state_before: ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
dir_US : DirectedOn (fun x x_1 => x ≤ x_1) S
sup_S : sSup s ≤ sSup S
⊢ Set.Nonempty S

tactic: exact Set.nonempty_of_mem this
state_before: ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
dir_US : DirectedOn (fun x x_1 => x ≤ x_1) S
sup_S : sSup s ≤ sSup S
this : ⊥ ∈ S
⊢ Set.Nonempty S

case this
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
dir_US : DirectedOn (fun x x_1 => x ≤ x_1) S
sup_S : sSup s ≤ sSup S
⊢ ⊥ ∈ S

tactic: use ∅
state_before: case this
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
dir_US : DirectedOn (fun x x_1 => x ≤ x_1) S
sup_S : sSup s ≤ sSup S
⊢ ⊥ ∈ S

tactic: simp only [Set.empty_subset, Finset.coe_empty, Finset.sup_empty, eq_self_iff_true,
  and_self_iff]
state_before: case this
ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
dir_US : DirectedOn (fun x x_1 => x ≤ x_1) S
sup_S : sSup s ≤ sSup S
⊢ ↑∅ ⊆ s ∧ ⊥ = Finset.sup ∅ id

tactic: rwa [← htsup]
state_before: ι : Sort ?u.5271
α : Type u_1
inst✝ : CompleteLattice α
f : ι → α
k : α
hk : ∀ (s : Set α), Set.Nonempty s → DirectedOn (fun x x_1 => x ≤ x_1) s → k ≤ sSup s → ∃ x, x ∈ s ∧ k ≤ x
s : Set α
hsup : k ≤ sSup s
S : Set α := {x | ∃ t, ↑t ⊆ s ∧ x = Finset.sup t id}
dir_US : DirectedOn (fun x x_1 => x ≤ x_1) S
sup_S : sSup s ≤ sSup S
Sne : Set.Nonempty S
j : α
hjk : k ≤ j
t : Finset α
htS : ↑t ⊆ s
htsup : j = Finset.sup t id
⊢ k ≤ Finset.sup t id