l3lab/ntp-mathlib huggingface dataset:
/-- Create a `CompleteLattice` from a `PartialOrder` and `SupSet`
that returns the least upper bound of a set. Usually this constructor provides
poor definitional equalities.  If other fields are known explicitly, they should be
provided; for example, if `inf` is known explicitly, construct the `CompleteLattice`
instance as
```
instance : CompleteLattice my_T :=
  { inf := better_inf,
    le_inf := ...,
    inf_le_right := ...,
    inf_le_left := ...
    -- don't care to fix sup, sInf, bot, top
    ..completeLatticeOfSup my_T _ }
```
-/
def completeLatticeOfSup (α : Type*) [H1 : PartialOrder α] [H2 : SupSet α]
    (isLUB_sSup : ∀ s : Set α, IsLUB s (sSup s)) : CompleteLattice α :=
  { H1, H2 with
    top := sSup univ
    le_top := fun x => (isLUB_sSup univ).1 trivial
    bot := sSup ∅
    bot_le := fun x => (isLUB_sSup ∅).2 <| by simp
    sup := fun a b => sSup {a, b}
    sup_le := fun a b c hac hbc => (isLUB_sSup _).2 (by simp [*])
    le_sup_left := fun a b => (isLUB_sSup _).1 <| mem_insert _ _
    le_sup_right := fun a b => (isLUB_sSup _).1 <| mem_insert_of_mem _ <| mem_singleton _
    inf := fun a b => sSup { x | x ≤ a ∧ x ≤ b }
    le_inf := fun a b c hab hac => (isLUB_sSup _).1 <| by 

Proof state:
α✝ : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
α : Type u_9
H1 : PartialOrder α
H2 : SupSet α
isLUB_sSup : ∀ (s : Set α), IsLUB s (sSup s)
a b c : α
hab : a ≤ b
hac : a ≤ c
⊢ a ∈ {x | x ≤ b ∧ x ≤ c}

Next tactic:
simp [*]
/-- Create a `CompleteLattice` from a `PartialOrder` and `SupSet`
that returns the least upper bound of a set. Usually this constructor provides
poor definitional equalities.  If other fields are known explicitly, they should be
provided; for example, if `inf` is known explicitly, construct the `CompleteLattice`
instance as
```
instance : CompleteLattice my_T :=
  { inf := better_inf,
    le_inf := ...,
    inf_le_right := ...,
    inf_le_left := ...
    -- don't care to fix sup, sInf, bot, top
    ..completeLatticeOfSup my_T _ }
```
-/
def completeLatticeOfSup (α : Type*) [H1 : PartialOrder α] [H2 : SupSet α]
    (isLUB_sSup : ∀ s : Set α, IsLUB s (sSup s)) : CompleteLattice α :=
  { H1, H2 with
    top := sSup univ
    le_top := fun x => (isLUB_sSup univ).1 trivial
    bot := sSup ∅
    bot_le := fun x => (isLUB_sSup ∅).2 <| by 

Proof state:
α✝ : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
α : Type u_9
H1 : PartialOrder α
H2 : SupSet α
isLUB_sSup : ∀ (s : Set α), IsLUB s (sSup s)
x : α
⊢ x ∈ upperBounds ∅

Next tactic:
simp
instance CompleteLinearOrder.toLinearOrder [i : CompleteLinearOrder α] : LinearOrder α :=
  { i with
    min := Inf.inf
    max := Sup.sup
    min_def := fun a b => by
      

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
i : CompleteLinearOrder α
a b : α
⊢ min a b = if a ≤ b then a else b

Next tactic:
split_ifs with h
instance CompleteLinearOrder.toLinearOrder [i : CompleteLinearOrder α] : LinearOrder α :=
  { i with
    min := Inf.inf
    max := Sup.sup
    min_def := fun a b => by
      split_ifs with h
      · 

Proof state:
case pos
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
i : CompleteLinearOrder α
a b : α
h : a ≤ b
⊢ min a b = a

Next tactic:
simp [h]
instance CompleteLinearOrder.toLinearOrder [i : CompleteLinearOrder α] : LinearOrder α :=
  { i with
    min := Inf.inf
    max := Sup.sup
    min_def := fun a b => by
      split_ifs with h
      · simp [h]
      · 

Proof state:
case neg
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
i : CompleteLinearOrder α
a b : α
h : ¬a ≤ b
⊢ min a b = b

Next tactic:
simp [(CompleteLinearOrder.le_total a b).resolve_left h]
instance CompleteLinearOrder.toLinearOrder [i : CompleteLinearOrder α] : LinearOrder α :=
  { i with
    min := Inf.inf
    max := Sup.sup
    min_def := fun a b => by
      split_ifs with h
      · simp [h]
      · simp [(CompleteLinearOrder.le_total a b).resolve_left h]
    max_def := fun a b => by
      

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
i : CompleteLinearOrder α
a b : α
⊢ max a b = if a ≤ b then b else a

Next tactic:
split_ifs with h
instance CompleteLinearOrder.toLinearOrder [i : CompleteLinearOrder α] : LinearOrder α :=
  { i with
    min := Inf.inf
    max := Sup.sup
    min_def := fun a b => by
      split_ifs with h
      · simp [h]
      · simp [(CompleteLinearOrder.le_total a b).resolve_left h]
    max_def := fun a b => by
      split_ifs with h
      · 

Proof state:
case pos
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
i : CompleteLinearOrder α
a b : α
h : a ≤ b
⊢ max a b = b

Next tactic:
simp [h]
instance CompleteLinearOrder.toLinearOrder [i : CompleteLinearOrder α] : LinearOrder α :=
  { i with
    min := Inf.inf
    max := Sup.sup
    min_def := fun a b => by
      split_ifs with h
      · simp [h]
      · simp [(CompleteLinearOrder.le_total a b).resolve_left h]
    max_def := fun a b => by
      split_ifs with h
      · simp [h]
      · 

Proof state:
case neg
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
i : CompleteLinearOrder α
a b : α
h : ¬a ≤ b
⊢ max a b = a

Next tactic:
simp [(CompleteLinearOrder.le_total a b).resolve_left h]
theorem eq_singleton_bot_of_sSup_eq_bot_of_nonempty {s : Set α} (h_sup : sSup s = ⊥)
    (hne : s.Nonempty) : s = {⊥} := by
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : CompleteLattice α
s✝ t : Set α
a b : α
s : Set α
h_sup : sSup s = ⊥
hne : Set.Nonempty s
⊢ s = {⊥}

Next tactic:
rw [Set.eq_singleton_iff_nonempty_unique_mem]
theorem eq_singleton_bot_of_sSup_eq_bot_of_nonempty {s : Set α} (h_sup : sSup s = ⊥)
    (hne : s.Nonempty) : s = {⊥} := by
  rw [Set.eq_singleton_iff_nonempty_unique_mem]
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : CompleteLattice α
s✝ t : Set α
a b : α
s : Set α
h_sup : sSup s = ⊥
hne : Set.Nonempty s
⊢ Set.Nonempty s ∧ ∀ x ∈ s, x = ⊥

Next tactic:
rw [sSup_eq_bot] at h_sup
theorem eq_singleton_bot_of_sSup_eq_bot_of_nonempty {s : Set α} (h_sup : sSup s = ⊥)
    (hne : s.Nonempty) : s = {⊥} := by
  rw [Set.eq_singleton_iff_nonempty_unique_mem]
  rw [sSup_eq_bot] at h_sup
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : CompleteLattice α
s✝ t : Set α
a b : α
s : Set α
h_sup : ∀ a ∈ s, a = ⊥
hne : Set.Nonempty s
⊢ Set.Nonempty s ∧ ∀ x ∈ s, x = ⊥

Next tactic:
exact ⟨hne, h_sup⟩
theorem sSup_eq_iSup' (s : Set α) : sSup s = ⨆ a : s, (a : α) := by 

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : SupSet α
f g : ι → α
s : Set α
⊢ sSup s = ⨆ a, ↑a

Next tactic:
rw [iSup, Subtype.range_coe]
theorem Function.Surjective.iSup_comp {f : ι → ι'} (hf : Surjective f) (g : ι' → α) :
    ⨆ x, g (f x) = ⨆ y, g y := by
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : SupSet α
f✝ g✝ : ι → α
f : ι → ι'
hf : Surjective f
g : ι' → α
⊢ ⨆ x, g (f x) = ⨆ y, g y

Next tactic:
simp only [iSup._eq_1]
theorem Function.Surjective.iSup_comp {f : ι → ι'} (hf : Surjective f) (g : ι' → α) :
    ⨆ x, g (f x) = ⨆ y, g y := by
  simp only [iSup._eq_1]
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : SupSet α
f✝ g✝ : ι → α
f : ι → ι'
hf : Surjective f
g : ι' → α
⊢ sSup (range fun x => g (f x)) = sSup (range fun y => g y)

Next tactic:
congr
theorem Function.Surjective.iSup_comp {f : ι → ι'} (hf : Surjective f) (g : ι' → α) :
    ⨆ x, g (f x) = ⨆ y, g y := by
  simp only [iSup._eq_1]
  congr
  

Proof state:
case e_a
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : SupSet α
f✝ g✝ : ι → α
f : ι → ι'
hf : Surjective f
g : ι' → α
⊢ (range fun x => g (f x)) = range fun y => g y

Next tactic:
exact hf.range_comp g
protected theorem Function.Surjective.iSup_congr {g : ι' → α} (h : ι → ι') (h1 : Surjective h)
    (h2 : ∀ x, g (h x) = f x) : ⨆ x, f x = ⨆ y, g y := by
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : SupSet α
f g✝ : ι → α
g : ι' → α
h : ι → ι'
h1 : Surjective h
h2 : ∀ (x : ι), g (h x) = f x
⊢ ⨆ x, f x = ⨆ y, g y

Next tactic:
convert h1.iSup_comp g
protected theorem Function.Surjective.iSup_congr {g : ι' → α} (h : ι → ι') (h1 : Surjective h)
    (h2 : ∀ x, g (h x) = f x) : ⨆ x, f x = ⨆ y, g y := by
  convert h1.iSup_comp g
  

Proof state:
case h.e'_2.h.e'_4.h
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : SupSet α
f g✝ : ι → α
g : ι' → α
h : ι → ι'
h1 : Surjective h
h2 : ∀ (x : ι), g (h x) = f x
x✝ : ι
⊢ f x✝ = g (h x✝)

Next tactic:
exact (h2 _).symm
@[congr]
theorem iSup_congr_Prop {p q : Prop} {f₁ : p → α} {f₂ : q → α} (pq : p ↔ q)
    (f : ∀ x, f₁ (pq.mpr x) = f₂ x) : iSup f₁ = iSup f₂ := by
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : SupSet α
f✝ g : ι → α
p q : Prop
f₁ : p → α
f₂ : q → α
pq : p ↔ q
f : ∀ (x : q), f₁ (_ : p) = f₂ x
⊢ iSup f₁ = iSup f₂

Next tactic:
obtain rfl := propext pq
@[congr]
theorem iSup_congr_Prop {p q : Prop} {f₁ : p → α} {f₂ : q → α} (pq : p ↔ q)
    (f : ∀ x, f₁ (pq.mpr x) = f₂ x) : iSup f₁ = iSup f₂ := by
  obtain rfl := propext pq
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : SupSet α
f✝ g : ι → α
p : Prop
f₁ f₂ : p → α
pq : p ↔ p
f : ∀ (x : p), f₁ (_ : p) = f₂ x
⊢ iSup f₁ = iSup f₂

Next tactic:
congr with x
@[congr]
theorem iSup_congr_Prop {p q : Prop} {f₁ : p → α} {f₂ : q → α} (pq : p ↔ q)
    (f : ∀ x, f₁ (pq.mpr x) = f₂ x) : iSup f₁ = iSup f₂ := by
  obtain rfl := propext pq
  congr with x
  

Proof state:
case e_s.h
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : SupSet α
f✝ g : ι → α
p : Prop
f₁ f₂ : p → α
pq : p ↔ p
f : ∀ (x : p), f₁ (_ : p) = f₂ x
x : p
⊢ f₁ x = f₂ x

Next tactic:
apply f
theorem iSup_range' (g : β → α) (f : ι → β) : ⨆ b : range f, g b = ⨆ i, g (f i) := by
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : SupSet α
f✝ g✝ : ι → α
g : β → α
f : ι → β
⊢ ⨆ b, g ↑b = ⨆ i, g (f i)

Next tactic:
rw [iSup, iSup, ← image_eq_range, ← range_comp]
theorem iSup_range' (g : β → α) (f : ι → β) : ⨆ b : range f, g b = ⨆ i, g (f i) := by
  rw [iSup, iSup, ← image_eq_range, ← range_comp]
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : SupSet α
f✝ g✝ : ι → α
g : β → α
f : ι → β
⊢ sSup (range (g ∘ f)) = sSup (range fun i => g (f i))

Next tactic:
rfl
theorem sSup_image' {s : Set β} {f : β → α} : sSup (f '' s) = ⨆ a : s, f a := by
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : SupSet α
f✝ g : ι → α
s : Set β
f : β → α
⊢ sSup (f '' s) = ⨆ a, f ↑a

Next tactic:
rw [iSup, image_eq_range]
theorem iSup₂_le_iff {f : ∀ i, κ i → α} : ⨆ (i) (j), f i j ≤ a ↔ ∀ i j, f i j ≤ a := by
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : CompleteLattice α
f✝ g s t : ι → α
a b : α
f : (i : ι) → κ i → α
⊢ ⨆ i, ⨆ j, f i j ≤ a ↔ ∀ (i : ι) (j : κ i), f i j ≤ a

Next tactic:
simp_rw [iSup_le_iff]
theorem le_iInf₂_iff {f : ∀ i, κ i → α} : (a ≤ ⨅ (i) (j), f i j) ↔ ∀ i j, a ≤ f i j := by
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : CompleteLattice α
f✝ g s t : ι → α
a b : α
f : (i : ι) → κ i → α
⊢ a ≤ ⨅ i, ⨅ j, f i j ↔ ∀ (i : ι) (j : κ i), a ≤ f i j

Next tactic:
simp_rw [le_iInf_iff]
theorem Monotone.le_map_sSup [CompleteLattice β] {s : Set α} {f : α → β} (hf : Monotone f) :
    ⨆ a ∈ s, f a ≤ f (sSup s) := by 

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝¹ : CompleteLattice α
f✝ g s✝ t : ι → α
a b : α
inst✝ : CompleteLattice β
s : Set α
f : α → β
hf : Monotone f
⊢ ⨆ a ∈ s, f a ≤ f (sSup s)

Next tactic:
rw [sSup_eq_iSup]
theorem Monotone.le_map_sSup [CompleteLattice β] {s : Set α} {f : α → β} (hf : Monotone f) :
    ⨆ a ∈ s, f a ≤ f (sSup s) := by rw [sSup_eq_iSup]; 

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝¹ : CompleteLattice α
f✝ g s✝ t : ι → α
a b : α
inst✝ : CompleteLattice β
s : Set α
f : α → β
hf : Monotone f
⊢ ⨆ a ∈ s, f a ≤ f (⨆ a ∈ s, a)

Next tactic:
exact hf.le_map_iSup₂ _
theorem OrderIso.map_iSup [CompleteLattice β] (f : α ≃o β) (x : ι → α) :
    f (⨆ i, x i) = ⨆ i, f (x i) :=
  eq_of_forall_ge_iff <| f.surjective.forall.2
  fun x => by 

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝¹ : CompleteLattice α
f✝ g s t : ι → α
a b : α
inst✝ : CompleteLattice β
f : α ≃o β
x✝ : ι → α
x : α
⊢ f (⨆ i, x✝ i) ≤ f x ↔ ⨆ i, f (x✝ i) ≤ f x

Next tactic:
simp only [f.le_iff_le, iSup_le_iff]
theorem OrderIso.map_sSup [CompleteLattice β] (f : α ≃o β) (s : Set α) :
    f (sSup s) = ⨆ a ∈ s, f a := by
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝¹ : CompleteLattice α
f✝ g s✝ t : ι → α
a b : α
inst✝ : CompleteLattice β
f : α ≃o β
s : Set α
⊢ f (sSup s) = ⨆ a ∈ s, f a

Next tactic:
simp only [sSup_eq_iSup, OrderIso.map_iSup]
theorem Antitone.map_sSup_le [CompleteLattice β] {s : Set α} {f : α → β} (hf : Antitone f) :
    f (sSup s) ≤ ⨅ a ∈ s, f a := by
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝¹ : CompleteLattice α
f✝ g s✝ t : ι → α
a b : α
inst✝ : CompleteLattice β
s : Set α
f : α → β
hf : Antitone f
⊢ f (sSup s) ≤ ⨅ a ∈ s, f a

Next tactic:
rw [sSup_eq_iSup]
theorem Antitone.map_sSup_le [CompleteLattice β] {s : Set α} {f : α → β} (hf : Antitone f) :
    f (sSup s) ≤ ⨅ a ∈ s, f a := by
  rw [sSup_eq_iSup]
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝¹ : CompleteLattice α
f✝ g s✝ t : ι → α
a b : α
inst✝ : CompleteLattice β
s : Set α
f : α → β
hf : Antitone f
⊢ f (⨆ a ∈ s, a) ≤ ⨅ a ∈ s, f a

Next tactic:
exact hf.map_iSup₂_le _
theorem iSup_const [Nonempty ι] : ⨆ _ : ι, a = a := by 

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝¹ : CompleteLattice α
f g s t : ι → α
a b : α
inst✝ : Nonempty ι
⊢ ⨆ x, a = a

Next tactic:
rw [iSup, range_const, sSup_singleton]
theorem iSup₂_eq_bot {f : ∀ i, κ i → α} : ⨆ (i) (j), f i j = ⊥ ↔ ∀ i j, f i j = ⊥ := by
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : CompleteLattice α
f✝ g s t : ι → α
a b : α
f : (i : ι) → κ i → α
⊢ ⨆ i, ⨆ j, f i j = ⊥ ↔ ∀ (i : ι) (j : κ i), f i j = ⊥

Next tactic:
simp
theorem iInf₂_eq_top {f : ∀ i, κ i → α} : ⨅ (i) (j), f i j = ⊤ ↔ ∀ i j, f i j = ⊤ := by
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : CompleteLattice α
f✝ g s t : ι → α
a b : α
f : (i : ι) → κ i → α
⊢ ⨅ i, ⨅ j, f i j = ⊤ ↔ ∀ (i : ι) (j : κ i), f i j = ⊤

Next tactic:
simp
theorem iSup_eq_dif {p : Prop} [Decidable p] (a : p → α) :
    ⨆ h : p, a h = if h : p then a h else ⊥ := by 

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝¹ : CompleteLattice α
f g s t : ι → α
a✝ b : α
p : Prop
inst✝ : Decidable p
a : p → α
⊢ ⨆ (h : p), a h = if h : p then a h else ⊥

Next tactic:
by_cases h : p
theorem iSup_eq_dif {p : Prop} [Decidable p] (a : p → α) :
    ⨆ h : p, a h = if h : p then a h else ⊥ := by by_cases h : p <;> 

Proof state:
case pos
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝¹ : CompleteLattice α
f g s t : ι → α
a✝ b : α
p : Prop
inst✝ : Decidable p
a : p → α
h : p
⊢ ⨆ (h : p), a h = if h : p then a h else ⊥

Next tactic:
simp [h]
theorem iSup_eq_dif {p : Prop} [Decidable p] (a : p → α) :
    ⨆ h : p, a h = if h : p then a h else ⊥ := by by_cases h : p <;> 

Proof state:
case neg
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝¹ : CompleteLattice α
f g s t : ι → α
a✝ b : α
p : Prop
inst✝ : Decidable p
a : p → α
h : ¬p
⊢ ⨆ (h : p), a h = if h : p then a h else ⊥

Next tactic:
simp [h]
theorem iSup₂_comm {ι₁ ι₂ : Sort*} {κ₁ : ι₁ → Sort*} {κ₂ : ι₂ → Sort*}
    (f : ∀ i₁, κ₁ i₁ → ∀ i₂, κ₂ i₂ → α) :
    ⨆ (i₁) (j₁) (i₂) (j₂), f i₁ j₁ i₂ j₂ = ⨆ (i₂) (j₂) (i₁) (j₁), f i₁ j₁ i₂ j₂ := by
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : CompleteLattice α
f✝ g s t : ι → α
a b : α
ι₁ : Sort u_9
ι₂ : Sort u_10
κ₁ : ι₁ → Sort u_11
κ₂ : ι₂ → Sort u_12
f : (i₁ : ι₁) → κ₁ i₁ → (i₂ : ι₂) → κ₂ i₂ → α
⊢ ⨆ i₁, ⨆ j₁, ⨆ i₂, ⨆ j₂, f i₁ j₁ i₂ j₂ = ⨆ i₂, ⨆ j₂, ⨆ i₁, ⨆ j₁, f i₁ j₁ i₂ j₂

Next tactic:
simp only [@iSup_comm _ (κ₁ _), @iSup_comm _ ι₁]
theorem iInf₂_comm {ι₁ ι₂ : Sort*} {κ₁ : ι₁ → Sort*} {κ₂ : ι₂ → Sort*}
    (f : ∀ i₁, κ₁ i₁ → ∀ i₂, κ₂ i₂ → α) :
    ⨅ (i₁) (j₁) (i₂) (j₂), f i₁ j₁ i₂ j₂ = ⨅ (i₂) (j₂) (i₁) (j₁), f i₁ j₁ i₂ j₂ := by
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : CompleteLattice α
f✝ g s t : ι → α
a b : α
ι₁ : Sort u_9
ι₂ : Sort u_10
κ₁ : ι₁ → Sort u_11
κ₂ : ι₂ → Sort u_12
f : (i₁ : ι₁) → κ₁ i₁ → (i₂ : ι₂) → κ₂ i₂ → α
⊢ ⨅ i₁, ⨅ j₁, ⨅ i₂, ⨅ j₂, f i₁ j₁ i₂ j₂ = ⨅ i₂, ⨅ j₂, ⨅ i₁, ⨅ j₁, f i₁ j₁ i₂ j₂

Next tactic:
simp only [@iInf_comm _ (κ₁ _), @iInf_comm _ ι₁]
@[simp]
theorem iSup_iSup_eq_left {b : β} {f : ∀ x : β, x = b → α} : ⨆ x, ⨆ h : x = b, f x h = f b rfl :=
  (@le_iSup₂ _ _ _ _ f b rfl).antisymm'
    (iSup_le fun c =>
      iSup_le <| by
        

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : CompleteLattice α
f✝ g s t : ι → α
a b✝ : α
b : β
f : (x : β) → x = b → α
c : β
⊢ ∀ (i : c = b), f c i ≤ f b (_ : b = b)

Next tactic:
rintro rfl
@[simp]
theorem iSup_iSup_eq_left {b : β} {f : ∀ x : β, x = b → α} : ⨆ x, ⨆ h : x = b, f x h = f b rfl :=
  (@le_iSup₂ _ _ _ _ f b rfl).antisymm'
    (iSup_le fun c =>
      iSup_le <| by
        rintro rfl
        

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : CompleteLattice α
f✝ g s t : ι → α
a b : α
c : β
f : (x : β) → x = c → α
⊢ f c (_ : c = c) ≤ f c (_ : c = c)

Next tactic:
rfl
@[simp]
theorem iSup_iSup_eq_right {b : β} {f : ∀ x : β, b = x → α} : ⨆ x, ⨆ h : b = x, f x h = f b rfl :=
  (le_iSup₂ b rfl).antisymm'
    (iSup₂_le fun c => by
      

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : CompleteLattice α
f✝ g s t : ι → α
a b✝ : α
b : β
f : (x : β) → b = x → α
c : β
⊢ ∀ (j : b = c), f c j ≤ f b (_ : b = b)

Next tactic:
rintro rfl
@[simp]
theorem iSup_iSup_eq_right {b : β} {f : ∀ x : β, b = x → α} : ⨆ x, ⨆ h : b = x, f x h = f b rfl :=
  (le_iSup₂ b rfl).antisymm'
    (iSup₂_le fun c => by
      rintro rfl
      

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : CompleteLattice α
f✝ g s t : ι → α
a b✝ : α
b : β
f : (x : β) → b = x → α
⊢ f b (_ : b = b) ≤ f b (_ : b = b)

Next tactic:
rfl
theorem biSup_const {ι : Sort _} {a : α} {s : Set ι} (hs : s.Nonempty) : ⨆ i ∈ s, a = a := by
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι✝ : Sort u_5
ι' : Sort u_6
κ : ι✝ → Sort u_7
κ' : ι' → Sort u_8
inst✝ : CompleteLattice α
f g s✝ t : ι✝ → α
a✝ b : α
ι : Type u_9
a : α
s : Set ι
hs : Set.Nonempty s
⊢ ⨆ i ∈ s, a = a

Next tactic:
haveI : Nonempty s := Set.nonempty_coe_sort.mpr hs
theorem biSup_const {ι : Sort _} {a : α} {s : Set ι} (hs : s.Nonempty) : ⨆ i ∈ s, a = a := by
  haveI : Nonempty s := Set.nonempty_coe_sort.mpr hs
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι✝ : Sort u_5
ι' : Sort u_6
κ : ι✝ → Sort u_7
κ' : ι' → Sort u_8
inst✝ : CompleteLattice α
f g s✝ t : ι✝ → α
a✝ b : α
ι : Type u_9
a : α
s : Set ι
hs : Set.Nonempty s
this : Nonempty ↑s
⊢ ⨆ i ∈ s, a = a

Next tactic:
rw [← iSup_subtype'', iSup_const]
theorem iSup_sup [Nonempty ι] {f : ι → α} {a : α} : (⨆ x, f x) ⊔ a = ⨆ x, f x ⊔ a := by
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝¹ : CompleteLattice α
f✝ g s t : ι → α
a✝ b : α
inst✝ : Nonempty ι
f : ι → α
a : α
⊢ (⨆ x, f x) ⊔ a = ⨆ x, f x ⊔ a

Next tactic:
rw [iSup_sup_eq, iSup_const]
theorem iInf_inf [Nonempty ι] {f : ι → α} {a : α} : (⨅ x, f x) ⊓ a = ⨅ x, f x ⊓ a := by
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝¹ : CompleteLattice α
f✝ g s t : ι → α
a✝ b : α
inst✝ : Nonempty ι
f : ι → α
a : α
⊢ (⨅ x, f x) ⊓ a = ⨅ x, f x ⊓ a

Next tactic:
rw [iInf_inf_eq, iInf_const]
theorem sup_iSup [Nonempty ι] {f : ι → α} {a : α} : (a ⊔ ⨆ x, f x) = ⨆ x, a ⊔ f x := by
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝¹ : CompleteLattice α
f✝ g s t : ι → α
a✝ b : α
inst✝ : Nonempty ι
f : ι → α
a : α
⊢ a ⊔ ⨆ x, f x = ⨆ x, a ⊔ f x

Next tactic:
rw [iSup_sup_eq, iSup_const]
theorem inf_iInf [Nonempty ι] {f : ι → α} {a : α} : (a ⊓ ⨅ x, f x) = ⨅ x, a ⊓ f x := by
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝¹ : CompleteLattice α
f✝ g s t : ι → α
a✝ b : α
inst✝ : Nonempty ι
f : ι → α
a : α
⊢ a ⊓ ⨅ x, f x = ⨅ x, a ⊓ f x

Next tactic:
rw [iInf_inf_eq, iInf_const]
theorem biSup_sup {p : ι → Prop} {f : ∀ i, p i → α} {a : α} (h : ∃ i, p i) :
    (⨆ (i) (h : p i), f i h) ⊔ a = ⨆ (i) (h : p i), f i h ⊔ a := by
  

Proof state:
α : Type u_1
β : Type u_2
β₂ : Type u_3
γ : Type u_4
ι : Sort u_5
ι' : Sort u_6
κ : ι → Sort u_7
κ' : ι' → Sort u_8
inst✝ : CompleteLattice α
f✝ g s t : ι → α
a✝ b : α
p : ι → Prop
f : (i : ι) → p i → α
a : α
h : ∃ i, p i
⊢ (⨆ i, ⨆ (h : p i), f i h) ⊔ a = ⨆ i, ⨆ (h : p i), f i h ⊔ a

Next tactic:
haveI : Nonempty { i // p i } :=
    let ⟨i, hi⟩ := h
    ⟨⟨i, hi⟩⟩