l3lab/ntp-mathlib huggingface dataset:
instance (priority := 100) CompleteLinearOrder.toCompletelyDistribLattice [CompleteLinearOrder α] :
    CompletelyDistribLattice α where
  iInf_iSup_eq {α β} g := by
    let lhs := ⨅ a, ⨆ b, g a b
    let rhs := ⨆ h : ∀ a, β a, ⨅ a, g a (h a)
    suffices lhs ≤ rhs from le_antisymm this le_iInf_iSup
    by_cases h : ∃ x, rhs < x ∧ x < lhs
    case pos =>
      rcases h with ⟨x, hr, hl⟩
      suffices rhs ≥ x from nomatch not_lt.2 this hr
      have : ∀ a, ∃ b, x < g a b := fun a =>
        lt_iSup_iff.1 <| lt_of_not_le fun h =>
            lt_irrefl x (lt_of_lt_of_le hl (le_trans (iInf_le _ a) h))
      choose f hf using this
      refine le_trans ?_ (le_iSup _ f)
      refine le_iInf fun a => le_of_lt (hf a)
    case neg =>
      refine le_of_not_lt fun hrl : rhs < lhs => not_le_of_lt hrl ?_
      replace h : ∀ x, x ≤ rhs ∨ lhs ≤ x := by
        simpa only [not_exists, not_and_or, not_or, not_lt] using h
      have : ∀ a, ∃ b, rhs < g a b := fun a =>
        lt_iSup_iff.1 <| lt_of_lt_of_le hrl (iInf_le _ a)
      

Proof state:
α✝ : Type u
β✝ : Type v
ι : Sort w
κ : ι → Sort w'
inst✝ : CompleteLinearOrder α✝
α : Type u
β : α → Type u
g : (a : α) → β a → α✝
lhs : α✝ := ⨅ a, ⨆ b, g a b
rhs : α✝ := ⨆ h, ⨅ a, g a (h a)
hrl : rhs < lhs
h : ∀ (x : α✝), x ≤ rhs ∨ lhs ≤ x
this : ∀ (a : α), ∃ b, rhs < g a b
⊢ lhs ≤ rhs

Next tactic:
choose f hf using this
instance (priority := 100) CompleteLinearOrder.toCompletelyDistribLattice [CompleteLinearOrder α] :
    CompletelyDistribLattice α where
  iInf_iSup_eq {α β} g := by
    let lhs := ⨅ a, ⨆ b, g a b
    let rhs := ⨆ h : ∀ a, β a, ⨅ a, g a (h a)
    suffices lhs ≤ rhs from le_antisymm this le_iInf_iSup
    by_cases h : ∃ x, rhs < x ∧ x < lhs
    case pos =>
      rcases h with ⟨x, hr, hl⟩
      suffices rhs ≥ x from nomatch not_lt.2 this hr
      have : ∀ a, ∃ b, x < g a b := fun a =>
        lt_iSup_iff.1 <| lt_of_not_le fun h =>
            lt_irrefl x (lt_of_lt_of_le hl (le_trans (iInf_le _ a) h))
      choose f hf using this
      refine le_trans ?_ (le_iSup _ f)
      refine le_iInf fun a => le_of_lt (hf a)
    case neg =>
      refine le_of_not_lt fun hrl : rhs < lhs => not_le_of_lt hrl ?_
      replace h : ∀ x, x ≤ rhs ∨ lhs ≤ x := by
        simpa only [not_exists, not_and_or, not_or, not_lt] using h
      have : ∀ a, ∃ b, rhs < g a b := fun a =>
        lt_iSup_iff.1 <| lt_of_lt_of_le hrl (iInf_le _ a)
      choose f hf using this
      

Proof state:
α✝ : Type u
β✝ : Type v
ι : Sort w
κ : ι → Sort w'
inst✝ : CompleteLinearOrder α✝
α : Type u
β : α → Type u
g : (a : α) → β a → α✝
lhs : α✝ := ⨅ a, ⨆ b, g a b
rhs : α✝ := ⨆ h, ⨅ a, g a (h a)
hrl : rhs < lhs
h : ∀ (x : α✝), x ≤ rhs ∨ lhs ≤ x
f : (a : α) → β a
hf : ∀ (a : α), rhs < g a (f a)
⊢ lhs ≤ rhs

Next tactic:
have : ∀ a, lhs ≤ g a (f a) := fun a =>
        (h (g a (f a))).resolve_left (by simpa using hf a)
instance (priority := 100) CompleteLinearOrder.toCompletelyDistribLattice [CompleteLinearOrder α] :
    CompletelyDistribLattice α where
  iInf_iSup_eq {α β} g := by
    let lhs := ⨅ a, ⨆ b, g a b
    let rhs := ⨆ h : ∀ a, β a, ⨅ a, g a (h a)
    suffices lhs ≤ rhs from le_antisymm this le_iInf_iSup
    by_cases h : ∃ x, rhs < x ∧ x < lhs
    case pos =>
      rcases h with ⟨x, hr, hl⟩
      suffices rhs ≥ x from nomatch not_lt.2 this hr
      have : ∀ a, ∃ b, x < g a b := fun a =>
        lt_iSup_iff.1 <| lt_of_not_le fun h =>
            lt_irrefl x (lt_of_lt_of_le hl (le_trans (iInf_le _ a) h))
      choose f hf using this
      refine le_trans ?_ (le_iSup _ f)
      refine le_iInf fun a => le_of_lt (hf a)
    case neg =>
      refine le_of_not_lt fun hrl : rhs < lhs => not_le_of_lt hrl ?_
      replace h : ∀ x, x ≤ rhs ∨ lhs ≤ x := by
        simpa only [not_exists, not_and_or, not_or, not_lt] using h
      have : ∀ a, ∃ b, rhs < g a b := fun a =>
        lt_iSup_iff.1 <| lt_of_lt_of_le hrl (iInf_le _ a)
      choose f hf using this
      have : ∀ a, lhs ≤ g a (f a) := fun a =>
        (h (g a (f a))).resolve_left (by 

Proof state:
α✝ : Type u
β✝ : Type v
ι : Sort w
κ : ι → Sort w'
inst✝ : CompleteLinearOrder α✝
α : Type u
β : α → Type u
g : (a : α) → β a → α✝
lhs : α✝ := ⨅ a, ⨆ b, g a b
rhs : α✝ := ⨆ h, ⨅ a, g a (h a)
hrl : rhs < lhs
h : ∀ (x : α✝), x ≤ rhs ∨ lhs ≤ x
f : (a : α) → β a
hf : ∀ (a : α), rhs < g a (f a)
a : α
⊢ ¬g a (f a) ≤ rhs

Next tactic:
simpa using hf a
instance (priority := 100) CompleteLinearOrder.toCompletelyDistribLattice [CompleteLinearOrder α] :
    CompletelyDistribLattice α where
  iInf_iSup_eq {α β} g := by
    let lhs := ⨅ a, ⨆ b, g a b
    let rhs := ⨆ h : ∀ a, β a, ⨅ a, g a (h a)
    suffices lhs ≤ rhs from le_antisymm this le_iInf_iSup
    by_cases h : ∃ x, rhs < x ∧ x < lhs
    case pos =>
      rcases h with ⟨x, hr, hl⟩
      suffices rhs ≥ x from nomatch not_lt.2 this hr
      have : ∀ a, ∃ b, x < g a b := fun a =>
        lt_iSup_iff.1 <| lt_of_not_le fun h =>
            lt_irrefl x (lt_of_lt_of_le hl (le_trans (iInf_le _ a) h))
      choose f hf using this
      refine le_trans ?_ (le_iSup _ f)
      refine le_iInf fun a => le_of_lt (hf a)
    case neg =>
      refine le_of_not_lt fun hrl : rhs < lhs => not_le_of_lt hrl ?_
      replace h : ∀ x, x ≤ rhs ∨ lhs ≤ x := by
        simpa only [not_exists, not_and_or, not_or, not_lt] using h
      have : ∀ a, ∃ b, rhs < g a b := fun a =>
        lt_iSup_iff.1 <| lt_of_lt_of_le hrl (iInf_le _ a)
      choose f hf using this
      have : ∀ a, lhs ≤ g a (f a) := fun a =>
        (h (g a (f a))).resolve_left (by simpa using hf a)
      

Proof state:
α✝ : Type u
β✝ : Type v
ι : Sort w
κ : ι → Sort w'
inst✝ : CompleteLinearOrder α✝
α : Type u
β : α → Type u
g : (a : α) → β a → α✝
lhs : α✝ := ⨅ a, ⨆ b, g a b
rhs : α✝ := ⨆ h, ⨅ a, g a (h a)
hrl : rhs < lhs
h : ∀ (x : α✝), x ≤ rhs ∨ lhs ≤ x
f : (a : α) → β a
hf : ∀ (a : α), rhs < g a (f a)
this : ∀ (a : α), lhs ≤ g a (f a)
⊢ lhs ≤ rhs

Next tactic:
refine le_trans ?_ (le_iSup _ f)
instance (priority := 100) CompleteLinearOrder.toCompletelyDistribLattice [CompleteLinearOrder α] :
    CompletelyDistribLattice α where
  iInf_iSup_eq {α β} g := by
    let lhs := ⨅ a, ⨆ b, g a b
    let rhs := ⨆ h : ∀ a, β a, ⨅ a, g a (h a)
    suffices lhs ≤ rhs from le_antisymm this le_iInf_iSup
    by_cases h : ∃ x, rhs < x ∧ x < lhs
    case pos =>
      rcases h with ⟨x, hr, hl⟩
      suffices rhs ≥ x from nomatch not_lt.2 this hr
      have : ∀ a, ∃ b, x < g a b := fun a =>
        lt_iSup_iff.1 <| lt_of_not_le fun h =>
            lt_irrefl x (lt_of_lt_of_le hl (le_trans (iInf_le _ a) h))
      choose f hf using this
      refine le_trans ?_ (le_iSup _ f)
      refine le_iInf fun a => le_of_lt (hf a)
    case neg =>
      refine le_of_not_lt fun hrl : rhs < lhs => not_le_of_lt hrl ?_
      replace h : ∀ x, x ≤ rhs ∨ lhs ≤ x := by
        simpa only [not_exists, not_and_or, not_or, not_lt] using h
      have : ∀ a, ∃ b, rhs < g a b := fun a =>
        lt_iSup_iff.1 <| lt_of_lt_of_le hrl (iInf_le _ a)
      choose f hf using this
      have : ∀ a, lhs ≤ g a (f a) := fun a =>
        (h (g a (f a))).resolve_left (by simpa using hf a)
      refine le_trans ?_ (le_iSup _ f)
      

Proof state:
α✝ : Type u
β✝ : Type v
ι : Sort w
κ : ι → Sort w'
inst✝ : CompleteLinearOrder α✝
α : Type u
β : α → Type u
g : (a : α) → β a → α✝
lhs : α✝ := ⨅ a, ⨆ b, g a b
rhs : α✝ := ⨆ h, ⨅ a, g a (h a)
hrl : rhs < lhs
h : ∀ (x : α✝), x ≤ rhs ∨ lhs ≤ x
f : (a : α) → β a
hf : ∀ (a : α), rhs < g a (f a)
this : ∀ (a : α), lhs ≤ g a (f a)
⊢ lhs ≤ ⨅ a, g a (f a)

Next tactic:
exact le_iInf fun a => this _
theorem sSup_inf_eq : sSup s ⊓ b = ⨆ a ∈ s, a ⊓ b := by
  

Proof state:
α : Type u
β : Type v
ι : Sort w
κ : ι → Sort w'
inst✝ : Frame α
s t : Set α
a b : α
⊢ sSup s ⊓ b = ⨆ a ∈ s, a ⊓ b

Next tactic:
simpa only [inf_comm] using @inf_sSup_eq α _ s b
theorem iSup_inf_eq (f : ι → α) (a : α) : (⨆ i, f i) ⊓ a = ⨆ i, f i ⊓ a := by
  

Proof state:
α : Type u
β : Type v
ι : Sort w
κ : ι → Sort w'
inst✝ : Frame α
s t : Set α
a✝ b : α
f : ι → α
a : α
⊢ (⨆ i, f i) ⊓ a = ⨆ i, f i ⊓ a

Next tactic:
rw [iSup, sSup_inf_eq, iSup_range]
theorem inf_iSup_eq (a : α) (f : ι → α) : (a ⊓ ⨆ i, f i) = ⨆ i, a ⊓ f i := by
  

Proof state:
α : Type u
β : Type v
ι : Sort w
κ : ι → Sort w'
inst✝ : Frame α
s t : Set α
a✝ b a : α
f : ι → α
⊢ a ⊓ ⨆ i, f i = ⨆ i, a ⊓ f i

Next tactic:
simpa only [inf_comm] using iSup_inf_eq f a
instance Prod.frame (α β) [Frame α] [Frame β] : Frame (α × β) where
  __ := Prod.completeLattice α β
  inf_sSup_le_iSup_inf a s := by
    

Proof state:
α✝ : Type u
β✝ : Type v
ι : Sort w
κ : ι → Sort w'
inst✝² : Frame α✝
s✝ t : Set α✝
a✝ b : α✝
α : Type ?u.26318
β : Type ?u.26321
inst✝¹ : Frame α
inst✝ : Frame β
src✝ : CompleteLattice (α × β) := completeLattice α β
a : α × β
s : Set (α × β)
⊢ a ⊓ sSup s ≤ ⨆ b ∈ s, a ⊓ b

Next tactic:
simp [Prod.le_def, sSup_eq_iSup, fst_iSup, snd_iSup, fst_iInf, snd_iInf, inf_iSup_eq]
theorem iSup₂_inf_eq {f : ∀ i, κ i → α} (a : α) :
    (⨆ (i) (j), f i j) ⊓ a = ⨆ (i) (j), f i j ⊓ a := by
  

Proof state:
α : Type u
β : Type v
ι : Sort w
κ : ι → Sort w'
inst✝ : Frame α
s t : Set α
a✝ b : α
f : (i : ι) → κ i → α
a : α
⊢ (⨆ i, ⨆ j, f i j) ⊓ a = ⨆ i, ⨆ j, f i j ⊓ a

Next tactic:
simp only [iSup_inf_eq]
theorem inf_iSup₂_eq {f : ∀ i, κ i → α} (a : α) :
    (a ⊓ ⨆ (i) (j), f i j) = ⨆ (i) (j), a ⊓ f i j := by
  

Proof state:
α : Type u
β : Type v
ι : Sort w
κ : ι → Sort w'
inst✝ : Frame α
s t : Set α
a✝ b : α
f : (i : ι) → κ i → α
a : α
⊢ a ⊓ ⨆ i, ⨆ j, f i j = ⨆ i, ⨆ j, a ⊓ f i j

Next tactic:
simp only [inf_iSup_eq]
theorem iSup_inf_iSup {ι ι' : Type*} {f : ι → α} {g : ι' → α} :
    ((⨆ i, f i) ⊓ ⨆ j, g j) = ⨆ i : ι × ι', f i.1 ⊓ g i.2 := by
  

Proof state:
α : Type u
β : Type v
ι✝ : Sort w
κ : ι✝ → Sort w'
inst✝ : Frame α
s t : Set α
a b : α
ι : Type u_1
ι' : Type u_2
f : ι → α
g : ι' → α
⊢ (⨆ i, f i) ⊓ ⨆ j, g j = ⨆ i, f i.1 ⊓ g i.2

Next tactic:
simp_rw [iSup_inf_eq, inf_iSup_eq, iSup_prod]
theorem biSup_inf_biSup {ι ι' : Type*} {f : ι → α} {g : ι' → α} {s : Set ι} {t : Set ι'} :
    ((⨆ i ∈ s, f i) ⊓ ⨆ j ∈ t, g j) = ⨆ p ∈ s ×ˢ t, f (p : ι × ι').1 ⊓ g p.2 := by
  

Proof state:
α : Type u
β : Type v
ι✝ : Sort w
κ : ι✝ → Sort w'
inst✝ : Frame α
s✝ t✝ : Set α
a b : α
ι : Type u_1
ι' : Type u_2
f : ι → α
g : ι' → α
s : Set ι
t : Set ι'
⊢ (⨆ i ∈ s, f i) ⊓ ⨆ j ∈ t, g j = ⨆ p ∈ s ×ˢ t, f p.1 ⊓ g p.2

Next tactic:
simp only [iSup_subtype', iSup_inf_iSup]
theorem biSup_inf_biSup {ι ι' : Type*} {f : ι → α} {g : ι' → α} {s : Set ι} {t : Set ι'} :
    ((⨆ i ∈ s, f i) ⊓ ⨆ j ∈ t, g j) = ⨆ p ∈ s ×ˢ t, f (p : ι × ι').1 ⊓ g p.2 := by
  simp only [iSup_subtype', iSup_inf_iSup]
  

Proof state:
α : Type u
β : Type v
ι✝ : Sort w
κ : ι✝ → Sort w'
inst✝ : Frame α
s✝ t✝ : Set α
a b : α
ι : Type u_1
ι' : Type u_2
f : ι → α
g : ι' → α
s : Set ι
t : Set ι'
⊢ ⨆ i, f ↑i.1 ⊓ g ↑i.2 = ⨆ x, f (↑x).1 ⊓ g (↑x).2

Next tactic:
exact (Equiv.surjective _).iSup_congr (Equiv.Set.prod s t).symm fun x => rfl
theorem sSup_inf_sSup : sSup s ⊓ sSup t = ⨆ p ∈ s ×ˢ t, (p : α × α).1 ⊓ p.2 := by
  

Proof state:
α : Type u
β : Type v
ι : Sort w
κ : ι → Sort w'
inst✝ : Frame α
s t : Set α
a b : α
⊢ sSup s ⊓ sSup t = ⨆ p ∈ s ×ˢ t, p.1 ⊓ p.2

Next tactic:
simp only [sSup_eq_iSup, biSup_inf_biSup]
theorem iSup_disjoint_iff {f : ι → α} : Disjoint (⨆ i, f i) a ↔ ∀ i, Disjoint (f i) a := by
  

Proof state:
α : Type u
β : Type v
ι : Sort w
κ : ι → Sort w'
inst✝ : Frame α
s t : Set α
a b : α
f : ι → α
⊢ Disjoint (⨆ i, f i) a ↔ ∀ (i : ι), Disjoint (f i) a

Next tactic:
simp only [disjoint_iff, iSup_inf_eq, iSup_eq_bot]
theorem disjoint_iSup_iff {f : ι → α} : Disjoint a (⨆ i, f i) ↔ ∀ i, Disjoint a (f i) := by
  

Proof state:
α : Type u
β : Type v
ι : Sort w
κ : ι → Sort w'
inst✝ : Frame α
s t : Set α
a b : α
f : ι → α
⊢ Disjoint a (⨆ i, f i) ↔ ∀ (i : ι), Disjoint a (f i)

Next tactic:
simpa only [disjoint_comm] using @iSup_disjoint_iff
theorem iSup₂_disjoint_iff {f : ∀ i, κ i → α} :
    Disjoint (⨆ (i) (j), f i j) a ↔ ∀ i j, Disjoint (f i j) a := by
  

Proof state:
α : Type u
β : Type v
ι : Sort w
κ : ι → Sort w'
inst✝ : Frame α
s t : Set α
a b : α
f : (i : ι) → κ i → α
⊢ Disjoint (⨆ i, ⨆ j, f i j) a ↔ ∀ (i : ι) (j : κ i), Disjoint (f i j) a

Next tactic:
simp_rw [iSup_disjoint_iff]
theorem disjoint_iSup₂_iff {f : ∀ i, κ i → α} :
    Disjoint a (⨆ (i) (j), f i j) ↔ ∀ i j, Disjoint a (f i j) := by
  

Proof state:
α : Type u
β : Type v
ι : Sort w
κ : ι → Sort w'
inst✝ : Frame α
s t : Set α
a b : α
f : (i : ι) → κ i → α
⊢ Disjoint a (⨆ i, ⨆ j, f i j) ↔ ∀ (i : ι) (j : κ i), Disjoint a (f i j)

Next tactic:
simp_rw [disjoint_iSup_iff]
theorem sSup_disjoint_iff {s : Set α} : Disjoint (sSup s) a ↔ ∀ b ∈ s, Disjoint b a := by
  

Proof state:
α : Type u
β : Type v
ι : Sort w
κ : ι → Sort w'
inst✝ : Frame α
s✝ t : Set α
a b : α
s : Set α
⊢ Disjoint (sSup s) a ↔ ∀ b ∈ s, Disjoint b a

Next tactic:
simp only [disjoint_iff, sSup_inf_eq, iSup_eq_bot]
theorem disjoint_sSup_iff {s : Set α} : Disjoint a (sSup s) ↔ ∀ b ∈ s, Disjoint a b := by
  

Proof state:
α : Type u
β : Type v
ι : Sort w
κ : ι → Sort w'
inst✝ : Frame α
s✝ t : Set α
a b : α
s : Set α
⊢ Disjoint a (sSup s) ↔ ∀ b ∈ s, Disjoint a b

Next tactic:
simpa only [disjoint_comm] using @sSup_disjoint_iff
theorem iSup_inf_of_monotone {ι : Type*} [Preorder ι] [IsDirected ι (· ≤ ·)] {f g : ι → α}
    (hf : Monotone f) (hg : Monotone g) : ⨆ i, f i ⊓ g i = (⨆ i, f i) ⊓ ⨆ i, g i := by
  

Proof state:
α : Type u
β : Type v
ι✝ : Sort w
κ : ι✝ → Sort w'
inst✝² : Frame α
s t : Set α
a b : α
ι : Type u_1
inst✝¹ : Preorder ι
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
f g : ι → α
hf : Monotone f
hg : Monotone g
⊢ ⨆ i, f i ⊓ g i = (⨆ i, f i) ⊓ ⨆ i, g i

Next tactic:
refine' (le_iSup_inf_iSup f g).antisymm _
theorem iSup_inf_of_monotone {ι : Type*} [Preorder ι] [IsDirected ι (· ≤ ·)] {f g : ι → α}
    (hf : Monotone f) (hg : Monotone g) : ⨆ i, f i ⊓ g i = (⨆ i, f i) ⊓ ⨆ i, g i := by
  refine' (le_iSup_inf_iSup f g).antisymm _
  

Proof state:
α : Type u
β : Type v
ι✝ : Sort w
κ : ι✝ → Sort w'
inst✝² : Frame α
s t : Set α
a b : α
ι : Type u_1
inst✝¹ : Preorder ι
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
f g : ι → α
hf : Monotone f
hg : Monotone g
⊢ (⨆ i, f i) ⊓ ⨆ i, g i ≤ ⨆ i, f i ⊓ g i

Next tactic:
rw [iSup_inf_iSup]
theorem iSup_inf_of_monotone {ι : Type*} [Preorder ι] [IsDirected ι (· ≤ ·)] {f g : ι → α}
    (hf : Monotone f) (hg : Monotone g) : ⨆ i, f i ⊓ g i = (⨆ i, f i) ⊓ ⨆ i, g i := by
  refine' (le_iSup_inf_iSup f g).antisymm _
  rw [iSup_inf_iSup]
  

Proof state:
α : Type u
β : Type v
ι✝ : Sort w
κ : ι✝ → Sort w'
inst✝² : Frame α
s t : Set α
a b : α
ι : Type u_1
inst✝¹ : Preorder ι
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
f g : ι → α
hf : Monotone f
hg : Monotone g
⊢ ⨆ i, f i.1 ⊓ g i.2 ≤ ⨆ i, f i ⊓ g i

Next tactic:
refine' iSup_mono' fun i => _
theorem iSup_inf_of_monotone {ι : Type*} [Preorder ι] [IsDirected ι (· ≤ ·)] {f g : ι → α}
    (hf : Monotone f) (hg : Monotone g) : ⨆ i, f i ⊓ g i = (⨆ i, f i) ⊓ ⨆ i, g i := by
  refine' (le_iSup_inf_iSup f g).antisymm _
  rw [iSup_inf_iSup]
  refine' iSup_mono' fun i => _
  

Proof state:
α : Type u
β : Type v
ι✝ : Sort w
κ : ι✝ → Sort w'
inst✝² : Frame α
s t : Set α
a b : α
ι : Type u_1
inst✝¹ : Preorder ι
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
f g : ι → α
hf : Monotone f
hg : Monotone g
i : ι × ι
⊢ ∃ i', f i.1 ⊓ g i.2 ≤ f i' ⊓ g i'

Next tactic:
rcases directed_of (· ≤ ·) i.1 i.2 with ⟨j, h₁, h₂⟩
theorem iSup_inf_of_monotone {ι : Type*} [Preorder ι] [IsDirected ι (· ≤ ·)] {f g : ι → α}
    (hf : Monotone f) (hg : Monotone g) : ⨆ i, f i ⊓ g i = (⨆ i, f i) ⊓ ⨆ i, g i := by
  refine' (le_iSup_inf_iSup f g).antisymm _
  rw [iSup_inf_iSup]
  refine' iSup_mono' fun i => _
  rcases directed_of (· ≤ ·) i.1 i.2 with ⟨j, h₁, h₂⟩
  

Proof state:
case intro.intro
α : Type u
β : Type v
ι✝ : Sort w
κ : ι✝ → Sort w'
inst✝² : Frame α
s t : Set α
a b : α
ι : Type u_1
inst✝¹ : Preorder ι
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
f g : ι → α
hf : Monotone f
hg : Monotone g
i : ι × ι
j : ι
h₁ : i.1 ≤ j
h₂ : i.2 ≤ j
⊢ ∃ i', f i.1 ⊓ g i.2 ≤ f i' ⊓ g i'

Next tactic:
exact ⟨j, inf_le_inf (hf h₁) (hg h₂)⟩
instance Pi.frame {ι : Type*} {π : ι → Type*} [∀ i, Frame (π i)] : Frame (∀ i, π i) :=
  { Pi.completeLattice with
    inf_sSup_le_iSup_inf := fun a s i => by
      

Proof state:
α : Type u
β : Type v
ι✝ : Sort w
κ : ι✝ → Sort w'
inst✝¹ : Frame α
s✝ t : Set α
a✝ b : α
ι : Type u_1
π : ι → Type u_2
inst✝ : (i : ι) → Frame (π i)
src✝ : CompleteLattice ((i : ι) → π i) := completeLattice
a : (i : ι) → π i
s : Set ((i : ι) → π i)
i : ι
⊢ (a ⊓ sSup s) i ≤ iSup (fun b => ⨆ (_ : b ∈ s), a ⊓ b) i

Next tactic:
simp only [sSup_apply, iSup_apply, inf_apply, inf_iSup_eq, ← iSup_subtype'']
instance Pi.frame {ι : Type*} {π : ι → Type*} [∀ i, Frame (π i)] : Frame (∀ i, π i) :=
  { Pi.completeLattice with
    inf_sSup_le_iSup_inf := fun a s i => by
      simp only [sSup_apply, iSup_apply, inf_apply, inf_iSup_eq, ← iSup_subtype'']; 

Proof state:
α : Type u
β : Type v
ι✝ : Sort w
κ : ι✝ → Sort w'
inst✝¹ : Frame α
s✝ t : Set α
a✝ b : α
ι : Type u_1
π : ι → Type u_2
inst✝ : (i : ι) → Frame (π i)
src✝ : CompleteLattice ((i : ι) → π i) := completeLattice
a : (i : ι) → π i
s : Set ((i : ι) → π i)
i : ι
⊢ ⨆ i_1, a i ⊓ ↑i_1 i ≤ ⨆ i_1, a i ⊓ ↑i_1 i

Next tactic:
rfl
instance (priority := 100) Frame.toDistribLattice : DistribLattice α :=
  DistribLattice.ofInfSupLe fun a b c => by
    

Proof state:
α : Type u
β : Type v
ι : Sort w
κ : ι → Sort w'
inst✝ : Frame α
s t : Set α
a✝ b✝ a b c : α
⊢ a ⊓ (b ⊔ c) ≤ a ⊓ b ⊔ a ⊓ c

Next tactic:
rw [← sSup_pair, ← sSup_pair, inf_sSup_eq, ← sSup_image, image_pair]
instance Prod.coframe (α β) [Coframe α] [Coframe β] : Coframe (α × β) where
  __ := Prod.completeLattice α β
  iInf_sup_le_sup_sInf a s := by
    

Proof state:
α✝ : Type u
β✝ : Type v
ι : Sort w
κ : ι → Sort w'
inst✝² : Coframe α✝
s✝ t : Set α✝
a✝ b : α✝
α : Type ?u.84307
β : Type ?u.84310
inst✝¹ : Coframe α
inst✝ : Coframe β
src✝ : CompleteLattice (α × β) := completeLattice α β
a : α × β
s : Set (α × β)
⊢ ⨅ b ∈ s, a ⊔ b ≤ a ⊔ sInf s

Next tactic:
simp [Prod.le_def, sInf_eq_iInf, fst_iSup, snd_iSup, fst_iInf, snd_iInf, sup_iInf_eq]
instance Pi.coframe {ι : Type*} {π : ι → Type*} [∀ i, Coframe (π i)] : Coframe (∀ i, π i) :=
  { Pi.completeLattice with
    iInf_sup_le_sup_sInf := fun a s i => by
      

Proof state:
α : Type u
β : Type v
ι✝ : Sort w
κ : ι✝ → Sort w'
inst✝¹ : Coframe α
s✝ t : Set α
a✝ b : α
ι : Type u_1
π : ι → Type u_2
inst✝ : (i : ι) → Coframe (π i)
src✝ : CompleteLattice ((i : ι) → π i) := completeLattice
a : (i : ι) → π i
s : Set ((i : ι) → π i)
i : ι
⊢ iInf (fun b => ⨅ (_ : b ∈ s), a ⊔ b) i ≤ (a ⊔ sInf s) i

Next tactic:
simp only [sInf_apply, iInf_apply, sup_apply, sup_iInf_eq, ← iInf_subtype'']
instance Pi.coframe {ι : Type*} {π : ι → Type*} [∀ i, Coframe (π i)] : Coframe (∀ i, π i) :=
  { Pi.completeLattice with
    iInf_sup_le_sup_sInf := fun a s i => by
      simp only [sInf_apply, iInf_apply, sup_apply, sup_iInf_eq, ← iInf_subtype'']; 

Proof state:
α : Type u
β : Type v
ι✝ : Sort w
κ : ι✝ → Sort w'
inst✝¹ : Coframe α
s✝ t : Set α
a✝ b : α
ι : Type u_1
π : ι → Type u_2
inst✝ : (i : ι) → Coframe (π i)
src✝ : CompleteLattice ((i : ι) → π i) := completeLattice
a : (i : ι) → π i
s : Set ((i : ι) → π i)
i : ι
⊢ ⨅ i_1, a i ⊔ ↑i_1 i ≤ ⨅ i_1, a i ⊔ ↑i_1 i

Next tactic:
rfl
instance (priority := 100) Coframe.toDistribLattice : DistribLattice α :=
  { ‹Coframe α› with
    le_sup_inf := fun a b c => by
      

Proof state:
α : Type u
β : Type v
ι : Sort w
κ : ι → Sort w'
inst✝ : Coframe α
s t : Set α
a✝ b✝ : α
src✝ : Coframe α := inst✝
a b c : α
⊢ (a ⊔ b) ⊓ (a ⊔ c) ≤ a ⊔ b ⊓ c

Next tactic:
rw [← sInf_pair, ← sInf_pair, sup_sInf_eq, ← sInf_image, image_pair]
instance Prod.completelyDistribLattice (α β)
    [CompletelyDistribLattice α] [CompletelyDistribLattice β] :
    CompletelyDistribLattice (α × β) where
  __ := Prod.completeLattice α β
  iInf_iSup_eq f := by 

Proof state:
α✝ : Type u
β✝ : Type v
ι : Sort w
κ : ι → Sort w'
α : Type ?u.132501
β : Type ?u.132504
inst✝¹ : CompletelyDistribLattice α
inst✝ : CompletelyDistribLattice β
src✝ : CompleteLattice (α × β) := completeLattice α β
ι✝ : Type (max ?u.132501 ?u.132504)
κ✝ : ι✝ → Type (max ?u.132501 ?u.132504)
f : (a : ι✝) → κ✝ a → α × β
⊢ ⨅ a, ⨆ b, f a b = ⨆ g, ⨅ a, f a (g a)

Next tactic:
ext
instance Prod.completelyDistribLattice (α β)
    [CompletelyDistribLattice α] [CompletelyDistribLattice β] :
    CompletelyDistribLattice (α × β) where
  __ := Prod.completeLattice α β
  iInf_iSup_eq f := by ext <;> 

Proof state:
case a
α✝ : Type u
β✝ : Type v
ι : Sort w
κ : ι → Sort w'
α : Type ?u.132501
β : Type ?u.132504
inst✝¹ : CompletelyDistribLattice α
inst✝ : CompletelyDistribLattice β
src✝ : CompleteLattice (α × β) := completeLattice α β
ι✝ : Type (max ?u.132501 ?u.132504)
κ✝ : ι✝ → Type (max ?u.132501 ?u.132504)
f : (a : ι✝) → κ✝ a → α × β
⊢ (⨅ a, ⨆ b, f a b).1 = (⨆ g, ⨅ a, f a (g a)).1

Next tactic:
simp [fst_iSup, fst_iInf, snd_iSup, snd_iInf, iInf_iSup_eq]
instance Prod.completelyDistribLattice (α β)
    [CompletelyDistribLattice α] [CompletelyDistribLattice β] :
    CompletelyDistribLattice (α × β) where
  __ := Prod.completeLattice α β
  iInf_iSup_eq f := by ext <;> 

Proof state:
case a
α✝ : Type u
β✝ : Type v
ι : Sort w
κ : ι → Sort w'
α : Type ?u.132501
β : Type ?u.132504
inst✝¹ : CompletelyDistribLattice α
inst✝ : CompletelyDistribLattice β
src✝ : CompleteLattice (α × β) := completeLattice α β
ι✝ : Type (max ?u.132501 ?u.132504)
κ✝ : ι✝ → Type (max ?u.132501 ?u.132504)
f : (a : ι✝) → κ✝ a → α × β
⊢ (⨅ a, ⨆ b, f a b).2 = (⨆ g, ⨅ a, f a (g a)).2

Next tactic:
simp [fst_iSup, fst_iInf, snd_iSup, snd_iInf, iInf_iSup_eq]
instance Pi.completelyDistribLattice {ι : Type*} {π : ι → Type*}
    [∀ i, CompletelyDistribLattice (π i)] : CompletelyDistribLattice (∀ i, π i) where
  __ := Pi.completeLattice
  iInf_iSup_eq f := by 

Proof state:
α : Type u
β : Type v
ι✝¹ : Sort w
κ : ι✝¹ → Sort w'
ι : Type u_1
π : ι → Type u_2
inst✝ : (i : ι) → CompletelyDistribLattice (π i)
src✝ : CompleteLattice ((i : ι) → π i) := completeLattice
ι✝ : Type (max u_1 u_2)
κ✝ : ι✝ → Type (max u_1 u_2)
f : (a : ι✝) → κ✝ a → (i : ι) → π i
⊢ ⨅ a, ⨆ b, f a b = ⨆ g, ⨅ a, f a (g a)

Next tactic:
ext i
instance Pi.completelyDistribLattice {ι : Type*} {π : ι → Type*}
    [∀ i, CompletelyDistribLattice (π i)] : CompletelyDistribLattice (∀ i, π i) where
  __ := Pi.completeLattice
  iInf_iSup_eq f := by ext i; 

Proof state:
case h
α : Type u
β : Type v
ι✝¹ : Sort w
κ : ι✝¹ → Sort w'
ι : Type u_1
π : ι → Type u_2
inst✝ : (i : ι) → CompletelyDistribLattice (π i)
src✝ : CompleteLattice ((i : ι) → π i) := completeLattice
ι✝ : Type (max u_1 u_2)
κ✝ : ι✝ → Type (max u_1 u_2)
f : (a : ι✝) → κ✝ a → (i : ι) → π i
i : ι
⊢ iInf (fun a => ⨆ b, f a b) i = iSup (fun g => ⨅ a, f a (g a)) i

Next tactic:
simp only [iInf_apply, iSup_apply, iInf_iSup_eq]
theorem compl_iSup : (iSup f)ᶜ = ⨅ i, (f i)ᶜ :=
  compl_injective (by 

Proof state:
α : Type u
β : Type v
ι : Sort w
κ : ι → Sort w'
inst✝ : CompleteBooleanAlgebra α
a b : α
s : Set α
f : ι → α
⊢ (iSup f)ᶜᶜ = (⨅ i, (f i)ᶜ)ᶜ

Next tactic:
simp [compl_iInf]
theorem compl_sInf : (sInf s)ᶜ = ⨆ i ∈ s, iᶜ := by 

Proof state:
α : Type u
β : Type v
ι : Sort w
κ : ι → Sort w'
inst✝ : CompleteBooleanAlgebra α
a b : α
s : Set α
f : ι → α
⊢ (sInf s)ᶜ = ⨆ i ∈ s, iᶜ

Next tactic:
simp only [sInf_eq_iInf, compl_iInf]
theorem compl_sSup : (sSup s)ᶜ = ⨅ i ∈ s, iᶜ := by 

Proof state:
α : Type u
β : Type v
ι : Sort w
κ : ι → Sort w'
inst✝ : CompleteBooleanAlgebra α
a b : α
s : Set α
f : ι → α
⊢ (sSup s)ᶜ = ⨅ i ∈ s, iᶜ

Next tactic:
simp only [sSup_eq_iSup, compl_iSup]
instance Pi.completeAtomicBooleanAlgebra {ι : Type*} {π : ι → Type*}
    [∀ i, CompleteAtomicBooleanAlgebra (π i)] : CompleteAtomicBooleanAlgebra (∀ i, π i) where
  __ := Pi.completeBooleanAlgebra
  iInf_iSup_eq f := by 

Proof state:
α : Type u
β : Type v
ι✝¹ : Sort w
κ : ι✝¹ → Sort w'
ι : Type u_1
π : ι → Type u_2
inst✝ : (i : ι) → CompleteAtomicBooleanAlgebra (π i)
src✝ : CompleteBooleanAlgebra ((i : ι) → π i) := completeBooleanAlgebra
ι✝ : Type (max u_1 u_2)
κ✝ : ι✝ → Type (max u_1 u_2)
f : (a : ι✝) → κ✝ a → (i : ι) → π i
⊢ ⨅ a, ⨆ b, f a b = ⨆ g, ⨅ a, f a (g a)

Next tactic:
ext