l3lab/ntp-mathlib huggingface dataset:
/-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear
order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/
theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty)
    (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by
  obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht
  obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd
  refine' hs.out c.2 B.2 ⟨_, _⟩
  · 

Proof state:
case intro.intro.refine'_1
α : Type u_1
s✝ : Set α
inst✝ : ConditionallyCompleteLinearOrder α
s : Set α
hs : OrdConnected s
t : Set ↑s
c : ↑s
hct : c ∈ t
B : ↑s
hB : B ∈ upperBounds t
⊢ ↑c ≤ sSup (Subtype.val '' t)

Next tactic:
exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩
/-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear
order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/
theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty)
    (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s := by
  obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht
  obtain ⟨B, hB⟩ : ∃ B, B ∈ upperBounds t := h_bdd
  refine' hs.out c.2 B.2 ⟨_, _⟩
  · exact (Subtype.mono_coe s).le_csSup_image hct ⟨B, hB⟩
  · 

Proof state:
case intro.intro.refine'_2
α : Type u_1
s✝ : Set α
inst✝ : ConditionallyCompleteLinearOrder α
s : Set α
hs : OrdConnected s
t : Set ↑s
c : ↑s
hct : c ∈ t
B : ↑s
hB : B ∈ upperBounds t
⊢ sSup (Subtype.val '' t) ≤ ↑B

Next tactic:
exact (Subtype.mono_coe s).csSup_image_le ⟨c, hct⟩ hB
/-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear
order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/
theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty)
    (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by
  

Proof state:
α : Type u_1
s✝ : Set α
inst✝ : ConditionallyCompleteLinearOrder α
s : Set α
hs : OrdConnected s
t : Set ↑s
ht : Set.Nonempty t
h_bdd : BddBelow t
⊢ sInf (Subtype.val '' t) ∈ s

Next tactic:
obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht
/-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear
order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/
theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty)
    (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by
  obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht
  

Proof state:
case intro
α : Type u_1
s✝ : Set α
inst✝ : ConditionallyCompleteLinearOrder α
s : Set α
hs : OrdConnected s
t : Set ↑s
h_bdd : BddBelow t
c : ↑s
hct : c ∈ t
⊢ sInf (Subtype.val '' t) ∈ s

Next tactic:
obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd
/-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear
order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/
theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty)
    (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by
  obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht
  obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd
  

Proof state:
case intro.intro
α : Type u_1
s✝ : Set α
inst✝ : ConditionallyCompleteLinearOrder α
s : Set α
hs : OrdConnected s
t : Set ↑s
c : ↑s
hct : c ∈ t
B : ↑s
hB : B ∈ lowerBounds t
⊢ sInf (Subtype.val '' t) ∈ s

Next tactic:
refine' hs.out B.2 c.2 ⟨_, _⟩
/-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear
order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/
theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty)
    (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by
  obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht
  obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd
  refine' hs.out B.2 c.2 ⟨_, _⟩
  · 

Proof state:
case intro.intro.refine'_1
α : Type u_1
s✝ : Set α
inst✝ : ConditionallyCompleteLinearOrder α
s : Set α
hs : OrdConnected s
t : Set ↑s
c : ↑s
hct : c ∈ t
B : ↑s
hB : B ∈ lowerBounds t
⊢ ↑B ≤ sInf (Subtype.val '' t)

Next tactic:
exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB
/-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear
order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/
theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty)
    (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s := by
  obtain ⟨c, hct⟩ : ∃ c, c ∈ t := ht
  obtain ⟨B, hB⟩ : ∃ B, B ∈ lowerBounds t := h_bdd
  refine' hs.out B.2 c.2 ⟨_, _⟩
  · exact (Subtype.mono_coe s).le_csInf_image ⟨c, hct⟩ hB
  · 

Proof state:
case intro.intro.refine'_2
α : Type u_1
s✝ : Set α
inst✝ : ConditionallyCompleteLinearOrder α
s : Set α
hs : OrdConnected s
t : Set ↑s
c : ↑s
hct : c ∈ t
B : ↑s
hB : B ∈ lowerBounds t
⊢ sInf (Subtype.val '' t) ≤ ↑c

Next tactic:
exact (Subtype.mono_coe s).csInf_image_le hct ⟨B, hB⟩
/-- Complete lattice structure on `Set.Icc` -/
noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α]
    {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where
  __ := Set.Icc.boundedOrder h
  sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by
    

Proof state:
α : Type u_1
s : Set α
inst✝ : ConditionallyCompleteLattice α
a b : α
h : a ≤ b
src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h
S : Set ↑(Icc a b)
hS : ¬S = ∅
⊢ sSup (Subtype.val '' S) ∈ Icc a b

Next tactic:
rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
/-- Complete lattice structure on `Set.Icc` -/
noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α]
    {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where
  __ := Set.Icc.boundedOrder h
  sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by
    rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
    

Proof state:
α : Type u_1
s : Set α
inst✝ : ConditionallyCompleteLattice α
a b : α
h : a ≤ b
src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h
S : Set ↑(Icc a b)
hS : Set.Nonempty S
⊢ sSup (Subtype.val '' S) ∈ Icc a b

Next tactic:
refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩
/-- Complete lattice structure on `Set.Icc` -/
noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α]
    {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where
  __ := Set.Icc.boundedOrder h
  sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by
    rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
    refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩
    

Proof state:
α : Type u_1
s : Set α
inst✝ : ConditionallyCompleteLattice α
a b : α
h : a ≤ b
src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h
S : Set ↑(Icc a b)
hS : Set.Nonempty S
⊢ a ≤ sSup (Subtype.val '' S)

Next tactic:
obtain ⟨c, hc⟩ := hS
/-- Complete lattice structure on `Set.Icc` -/
noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α]
    {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where
  __ := Set.Icc.boundedOrder h
  sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by
    rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
    refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩
    obtain ⟨c, hc⟩ := hS
    

Proof state:
case intro
α : Type u_1
s : Set α
inst✝ : ConditionallyCompleteLattice α
a b : α
h : a ≤ b
src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h
S : Set ↑(Icc a b)
c : ↑(Icc a b)
hc : c ∈ S
⊢ a ≤ sSup (Subtype.val '' S)

Next tactic:
exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)
/-- Complete lattice structure on `Set.Icc` -/
noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α]
    {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where
  __ := Set.Icc.boundedOrder h
  sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by
    rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
    refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩
    obtain ⟨c, hc⟩ := hS
    exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩
  le_sSup S c hc := by
    

Proof state:
α : Type u_1
s : Set α
inst✝ : ConditionallyCompleteLattice α
a b : α
h : a ≤ b
src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h
S : Set ↑(Icc a b)
c : ↑(Icc a b)
hc : c ∈ S
⊢ c ≤ sSup S

Next tactic:
by_cases hS : S = ∅
/-- Complete lattice structure on `Set.Icc` -/
noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α]
    {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where
  __ := Set.Icc.boundedOrder h
  sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by
    rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
    refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩
    obtain ⟨c, hc⟩ := hS
    exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩
  le_sSup S c hc := by
    by_cases hS : S = ∅ <;> 

Proof state:
case pos
α : Type u_1
s : Set α
inst✝ : ConditionallyCompleteLattice α
a b : α
h : a ≤ b
src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h
S : Set ↑(Icc a b)
c : ↑(Icc a b)
hc : c ∈ S
hS : S = ∅
⊢ c ≤ sSup S

Next tactic:
simp only [hS, dite_true, dite_false]
/-- Complete lattice structure on `Set.Icc` -/
noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α]
    {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where
  __ := Set.Icc.boundedOrder h
  sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by
    rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
    refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩
    obtain ⟨c, hc⟩ := hS
    exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩
  le_sSup S c hc := by
    by_cases hS : S = ∅ <;> 

Proof state:
case neg
α : Type u_1
s : Set α
inst✝ : ConditionallyCompleteLattice α
a b : α
h : a ≤ b
src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h
S : Set ↑(Icc a b)
c : ↑(Icc a b)
hc : c ∈ S
hS : ¬S = ∅
⊢ c ≤ sSup S

Next tactic:
simp only [hS, dite_true, dite_false]
/-- Complete lattice structure on `Set.Icc` -/
noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α]
    {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where
  __ := Set.Icc.boundedOrder h
  sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by
    rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
    refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩
    obtain ⟨c, hc⟩ := hS
    exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩
  le_sSup S c hc := by
    by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false]
    · 

Proof state:
case pos
α : Type u_1
s : Set α
inst✝ : ConditionallyCompleteLattice α
a b : α
h : a ≤ b
src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h
S : Set ↑(Icc a b)
c : ↑(Icc a b)
hc : c ∈ S
hS : S = ∅
⊢ c ≤ { val := a, property := (_ : a ≤ a ∧ a ≤ b) }

Next tactic:
simp [hS] at hc
/-- Complete lattice structure on `Set.Icc` -/
noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α]
    {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where
  __ := Set.Icc.boundedOrder h
  sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by
    rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
    refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩
    obtain ⟨c, hc⟩ := hS
    exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩
  le_sSup S c hc := by
    by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false]
    · simp [hS] at hc
    · 

Proof state:
case neg
α : Type u_1
s : Set α
inst✝ : ConditionallyCompleteLattice α
a b : α
h : a ≤ b
src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h
S : Set ↑(Icc a b)
c : ↑(Icc a b)
hc : c ∈ S
hS : ¬S = ∅
⊢ c ≤ { val := sSup (Subtype.val '' S), property := (_ : a ≤ sSup (Subtype.val '' S) ∧ sSup (Subtype.val '' S) ≤ b) }

Next tactic:
exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩
/-- Complete lattice structure on `Set.Icc` -/
noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α]
    {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where
  __ := Set.Icc.boundedOrder h
  sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by
    rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
    refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩
    obtain ⟨c, hc⟩ := hS
    exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩
  le_sSup S c hc := by
    by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false]
    · simp [hS] at hc
    · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩
  sSup_le S c hc := by
    

Proof state:
α : Type u_1
s : Set α
inst✝ : ConditionallyCompleteLattice α
a b : α
h : a ≤ b
src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h
S : Set ↑(Icc a b)
c : ↑(Icc a b)
hc : ∀ b_1 ∈ S, b_1 ≤ c
⊢ sSup S ≤ c

Next tactic:
by_cases hS : S = ∅
/-- Complete lattice structure on `Set.Icc` -/
noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α]
    {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where
  __ := Set.Icc.boundedOrder h
  sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by
    rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
    refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩
    obtain ⟨c, hc⟩ := hS
    exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩
  le_sSup S c hc := by
    by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false]
    · simp [hS] at hc
    · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩
  sSup_le S c hc := by
    by_cases hS : S = ∅ <;> 

Proof state:
case pos
α : Type u_1
s : Set α
inst✝ : ConditionallyCompleteLattice α
a b : α
h : a ≤ b
src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h
S : Set ↑(Icc a b)
c : ↑(Icc a b)
hc : ∀ b_1 ∈ S, b_1 ≤ c
hS : S = ∅
⊢ sSup S ≤ c

Next tactic:
simp only [hS, dite_true, dite_false]
/-- Complete lattice structure on `Set.Icc` -/
noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α]
    {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where
  __ := Set.Icc.boundedOrder h
  sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by
    rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
    refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩
    obtain ⟨c, hc⟩ := hS
    exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩
  le_sSup S c hc := by
    by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false]
    · simp [hS] at hc
    · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩
  sSup_le S c hc := by
    by_cases hS : S = ∅ <;> 

Proof state:
case neg
α : Type u_1
s : Set α
inst✝ : ConditionallyCompleteLattice α
a b : α
h : a ≤ b
src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h
S : Set ↑(Icc a b)
c : ↑(Icc a b)
hc : ∀ b_1 ∈ S, b_1 ≤ c
hS : ¬S = ∅
⊢ sSup S ≤ c

Next tactic:
simp only [hS, dite_true, dite_false]
/-- Complete lattice structure on `Set.Icc` -/
noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α]
    {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where
  __ := Set.Icc.boundedOrder h
  sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by
    rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
    refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩
    obtain ⟨c, hc⟩ := hS
    exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩
  le_sSup S c hc := by
    by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false]
    · simp [hS] at hc
    · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩
  sSup_le S c hc := by
    by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false]
    · 

Proof state:
case pos
α : Type u_1
s : Set α
inst✝ : ConditionallyCompleteLattice α
a b : α
h : a ≤ b
src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h
S : Set ↑(Icc a b)
c : ↑(Icc a b)
hc : ∀ b_1 ∈ S, b_1 ≤ c
hS : S = ∅
⊢ { val := a, property := (_ : a ≤ a ∧ a ≤ b) } ≤ c

Next tactic:
exact c.2.1
/-- Complete lattice structure on `Set.Icc` -/
noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α]
    {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where
  __ := Set.Icc.boundedOrder h
  sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by
    rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
    refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩
    obtain ⟨c, hc⟩ := hS
    exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩
  le_sSup S c hc := by
    by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false]
    · simp [hS] at hc
    · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩
  sSup_le S c hc := by
    by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false]
    · exact c.2.1
    · 

Proof state:
case neg
α : Type u_1
s : Set α
inst✝ : ConditionallyCompleteLattice α
a b : α
h : a ≤ b
src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h
S : Set ↑(Icc a b)
c : ↑(Icc a b)
hc : ∀ b_1 ∈ S, b_1 ≤ c
hS : ¬S = ∅
⊢ { val := sSup (Subtype.val '' S), property := (_ : a ≤ sSup (Subtype.val '' S) ∧ sSup (Subtype.val '' S) ≤ b) } ≤ c

Next tactic:
exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑))
        (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h)
/-- Complete lattice structure on `Set.Icc` -/
noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α]
    {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where
  __ := Set.Icc.boundedOrder h
  sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by
    rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
    refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩
    obtain ⟨c, hc⟩ := hS
    exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩
  le_sSup S c hc := by
    by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false]
    · simp [hS] at hc
    · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩
  sSup_le S c hc := by
    by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false]
    · exact c.2.1
    · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑))
        (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h)
  sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by
    

Proof state:
α : Type u_1
s : Set α
inst✝ : ConditionallyCompleteLattice α
a b : α
h : a ≤ b
src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h
S : Set ↑(Icc a b)
hS : ¬S = ∅
⊢ sInf (Subtype.val '' S) ∈ Icc a b

Next tactic:
rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
/-- Complete lattice structure on `Set.Icc` -/
noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α]
    {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where
  __ := Set.Icc.boundedOrder h
  sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by
    rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
    refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩
    obtain ⟨c, hc⟩ := hS
    exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩
  le_sSup S c hc := by
    by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false]
    · simp [hS] at hc
    · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩
  sSup_le S c hc := by
    by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false]
    · exact c.2.1
    · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑))
        (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h)
  sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by
    rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
    

Proof state:
α : Type u_1
s : Set α
inst✝ : ConditionallyCompleteLattice α
a b : α
h : a ≤ b
src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h
S : Set ↑(Icc a b)
hS : Set.Nonempty S
⊢ sInf (Subtype.val '' S) ∈ Icc a b

Next tactic:
refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩
/-- Complete lattice structure on `Set.Icc` -/
noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α]
    {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where
  __ := Set.Icc.boundedOrder h
  sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by
    rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
    refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩
    obtain ⟨c, hc⟩ := hS
    exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩
  le_sSup S c hc := by
    by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false]
    · simp [hS] at hc
    · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩
  sSup_le S c hc := by
    by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false]
    · exact c.2.1
    · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑))
        (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h)
  sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by
    rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
    refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩
    

Proof state:
α : Type u_1
s : Set α
inst✝ : ConditionallyCompleteLattice α
a b : α
h : a ≤ b
src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h
S : Set ↑(Icc a b)
hS : Set.Nonempty S
⊢ sInf (Subtype.val '' S) ≤ b

Next tactic:
obtain ⟨c, hc⟩ := hS
/-- Complete lattice structure on `Set.Icc` -/
noncomputable def Set.Icc.completeLattice [ConditionallyCompleteLattice α]
    {a b : α} (h : a ≤ b) : CompleteLattice (Set.Icc a b) where
  __ := Set.Icc.boundedOrder h
  sSup S := if hS : S = ∅ then ⟨a, le_rfl, h⟩ else ⟨sSup ((↑) '' S), by
    rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
    refine' ⟨_, csSup_le (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.2)⟩
    obtain ⟨c, hc⟩ := hS
    exact c.2.1.trans (le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩)⟩
  le_sSup S c hc := by
    by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false]
    · simp [hS] at hc
    · exact le_csSup ⟨b, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.2⟩ ⟨c, hc, rfl⟩
  sSup_le S c hc := by
    by_cases hS : S = ∅ <;> simp only [hS, dite_true, dite_false]
    · exact c.2.1
    · exact csSup_le ((Set.nonempty_iff_ne_empty.mpr hS).image (↑))
        (fun _ ⟨d, h, hd⟩ ↦ hd ▸ hc d h)
  sInf S := if hS : S = ∅ then ⟨b, h, le_rfl⟩ else ⟨sInf ((↑) '' S), by
    rw [← Set.not_nonempty_iff_eq_empty, not_not] at hS
    refine' ⟨le_csInf (hS.image (↑)) (fun _ ⟨c, _, hc⟩ ↦ hc ▸ c.2.1), _⟩
    obtain ⟨c, hc⟩ := hS
    

Proof state:
case intro
α : Type u_1
s : Set α
inst✝ : ConditionallyCompleteLattice α
a b : α
h : a ≤ b
src✝ : BoundedOrder ↑(Icc a b) := Icc.boundedOrder h
S : Set ↑(Icc a b)
c : ↑(Icc a b)
hc : c ∈ S
⊢ sInf (Subtype.val '' S) ≤ b

Next tactic:
exact le_trans (csInf_le ⟨a, fun _ ⟨d, _, hd⟩ ↦ hd ▸ d.2.1⟩ ⟨c, hc, rfl⟩) c.2.2