l3lab/ntp-mathlib huggingface dataset:
/-- A type with a pair of commutative and associative binary operations which satisfy two absorption
laws relating the two operations has the structure of a lattice.

The partial order is defined so that `a ≤ b` unfolds to `a ⊔ b = b`; cf. `sup_eq_right`.
-/
def Lattice.mk' {α : Type*} [Sup α] [Inf α] (sup_comm : ∀ a b : α, a ⊔ b = b ⊔ a)
    (sup_assoc : ∀ a b c : α, a ⊔ b ⊔ c = a ⊔ (b ⊔ c)) (inf_comm : ∀ a b : α, a ⊓ b = b ⊓ a)
    (inf_assoc : ∀ a b c : α, a ⊓ b ⊓ c = a ⊓ (b ⊓ c)) (sup_inf_self : ∀ a b : α, a ⊔ a ⊓ b = a)
    (inf_sup_self : ∀ a b : α, a ⊓ (a ⊔ b) = a) : Lattice α :=
  have sup_idem : ∀ b : α, b ⊔ b = b := fun b =>
    calc
      b ⊔ b = b ⊔ b ⊓ (b ⊔ b) := by rw [inf_sup_self]
      _ = b := by rw [sup_inf_self]

  have inf_idem : ∀ b : α, b ⊓ b = b := fun b =>
    calc
      b ⊓ b = b ⊓ (b ⊔ b ⊓ b) := by rw [sup_inf_self]
      _ = b := by rw [inf_sup_self]

  let semilatt_inf_inst := SemilatticeInf.mk' inf_comm inf_assoc inf_idem
  let semilatt_sup_inst := SemilatticeSup.mk' sup_comm sup_assoc sup_idem
  have partial_order_eq : @SemilatticeSup.toPartialOrder _ semilatt_sup_inst =
                          @SemilatticeInf.toPartialOrder _ semilatt_inf_inst :=
    semilatticeSup_mk'_partialOrder_eq_semilatticeInf_mk'_partialOrder _ _ _ _ _ _
      sup_inf_self inf_sup_self
  { semilatt_sup_inst, semilatt_inf_inst with
    inf_le_left := fun a b => by
      

Proof state:
α✝ : Type u
β : Type v
α : Type u_1
inst✝¹ : Sup α
inst✝ : Inf α
sup_comm : ∀ (a b : α), a ⊔ b = b ⊔ a
sup_assoc : ∀ (a b c : α), a ⊔ b ⊔ c = a ⊔ (b ⊔ c)
inf_comm : ∀ (a b : α), a ⊓ b = b ⊓ a
inf_assoc : ∀ (a b c : α), a ⊓ b ⊓ c = a ⊓ (b ⊓ c)
sup_inf_self : ∀ (a b : α), a ⊔ a ⊓ b = a
inf_sup_self : ∀ (a b : α), a ⊓ (a ⊔ b) = a
sup_idem : ∀ (b : α), b ⊔ b = b
inf_idem : ∀ (b : α), b ⊓ b = b
semilatt_inf_inst : SemilatticeInf α := SemilatticeInf.mk' inf_comm inf_assoc inf_idem
semilatt_sup_inst : SemilatticeSup α := SemilatticeSup.mk' sup_comm sup_assoc sup_idem
partial_order_eq : SemilatticeSup.toPartialOrder = SemilatticeInf.toPartialOrder
a b : α
⊢ a ⊓ b ≤ a

Next tactic:
rw [partial_order_eq]
/-- A type with a pair of commutative and associative binary operations which satisfy two absorption
laws relating the two operations has the structure of a lattice.

The partial order is defined so that `a ≤ b` unfolds to `a ⊔ b = b`; cf. `sup_eq_right`.
-/
def Lattice.mk' {α : Type*} [Sup α] [Inf α] (sup_comm : ∀ a b : α, a ⊔ b = b ⊔ a)
    (sup_assoc : ∀ a b c : α, a ⊔ b ⊔ c = a ⊔ (b ⊔ c)) (inf_comm : ∀ a b : α, a ⊓ b = b ⊓ a)
    (inf_assoc : ∀ a b c : α, a ⊓ b ⊓ c = a ⊓ (b ⊓ c)) (sup_inf_self : ∀ a b : α, a ⊔ a ⊓ b = a)
    (inf_sup_self : ∀ a b : α, a ⊓ (a ⊔ b) = a) : Lattice α :=
  have sup_idem : ∀ b : α, b ⊔ b = b := fun b =>
    calc
      b ⊔ b = b ⊔ b ⊓ (b ⊔ b) := by rw [inf_sup_self]
      _ = b := by rw [sup_inf_self]

  have inf_idem : ∀ b : α, b ⊓ b = b := fun b =>
    calc
      b ⊓ b = b ⊓ (b ⊔ b ⊓ b) := by rw [sup_inf_self]
      _ = b := by rw [inf_sup_self]

  let semilatt_inf_inst := SemilatticeInf.mk' inf_comm inf_assoc inf_idem
  let semilatt_sup_inst := SemilatticeSup.mk' sup_comm sup_assoc sup_idem
  have partial_order_eq : @SemilatticeSup.toPartialOrder _ semilatt_sup_inst =
                          @SemilatticeInf.toPartialOrder _ semilatt_inf_inst :=
    semilatticeSup_mk'_partialOrder_eq_semilatticeInf_mk'_partialOrder _ _ _ _ _ _
      sup_inf_self inf_sup_self
  { semilatt_sup_inst, semilatt_inf_inst with
    inf_le_left := fun a b => by
      rw [partial_order_eq]
      

Proof state:
α✝ : Type u
β : Type v
α : Type u_1
inst✝¹ : Sup α
inst✝ : Inf α
sup_comm : ∀ (a b : α), a ⊔ b = b ⊔ a
sup_assoc : ∀ (a b c : α), a ⊔ b ⊔ c = a ⊔ (b ⊔ c)
inf_comm : ∀ (a b : α), a ⊓ b = b ⊓ a
inf_assoc : ∀ (a b c : α), a ⊓ b ⊓ c = a ⊓ (b ⊓ c)
sup_inf_self : ∀ (a b : α), a ⊔ a ⊓ b = a
inf_sup_self : ∀ (a b : α), a ⊓ (a ⊔ b) = a
sup_idem : ∀ (b : α), b ⊔ b = b
inf_idem : ∀ (b : α), b ⊓ b = b
semilatt_inf_inst : SemilatticeInf α := SemilatticeInf.mk' inf_comm inf_assoc inf_idem
semilatt_sup_inst : SemilatticeSup α := SemilatticeSup.mk' sup_comm sup_assoc sup_idem
partial_order_eq : SemilatticeSup.toPartialOrder = SemilatticeInf.toPartialOrder
a b : α
⊢ a ⊓ b ≤ a

Next tactic:
apply inf_le_left
/-- A type with a pair of commutative and associative binary operations which satisfy two absorption
laws relating the two operations has the structure of a lattice.

The partial order is defined so that `a ≤ b` unfolds to `a ⊔ b = b`; cf. `sup_eq_right`.
-/
def Lattice.mk' {α : Type*} [Sup α] [Inf α] (sup_comm : ∀ a b : α, a ⊔ b = b ⊔ a)
    (sup_assoc : ∀ a b c : α, a ⊔ b ⊔ c = a ⊔ (b ⊔ c)) (inf_comm : ∀ a b : α, a ⊓ b = b ⊓ a)
    (inf_assoc : ∀ a b c : α, a ⊓ b ⊓ c = a ⊓ (b ⊓ c)) (sup_inf_self : ∀ a b : α, a ⊔ a ⊓ b = a)
    (inf_sup_self : ∀ a b : α, a ⊓ (a ⊔ b) = a) : Lattice α :=
  have sup_idem : ∀ b : α, b ⊔ b = b := fun b =>
    calc
      b ⊔ b = b ⊔ b ⊓ (b ⊔ b) := by rw [inf_sup_self]
      _ = b := by rw [sup_inf_self]

  have inf_idem : ∀ b : α, b ⊓ b = b := fun b =>
    calc
      b ⊓ b = b ⊓ (b ⊔ b ⊓ b) := by rw [sup_inf_self]
      _ = b := by rw [inf_sup_self]

  let semilatt_inf_inst := SemilatticeInf.mk' inf_comm inf_assoc inf_idem
  let semilatt_sup_inst := SemilatticeSup.mk' sup_comm sup_assoc sup_idem
  have partial_order_eq : @SemilatticeSup.toPartialOrder _ semilatt_sup_inst =
                          @SemilatticeInf.toPartialOrder _ semilatt_inf_inst :=
    semilatticeSup_mk'_partialOrder_eq_semilatticeInf_mk'_partialOrder _ _ _ _ _ _
      sup_inf_self inf_sup_self
  { semilatt_sup_inst, semilatt_inf_inst with
    inf_le_left := fun a b => by
      rw [partial_order_eq]
      apply inf_le_left,
    inf_le_right := fun a b => by
      

Proof state:
α✝ : Type u
β : Type v
α : Type u_1
inst✝¹ : Sup α
inst✝ : Inf α
sup_comm : ∀ (a b : α), a ⊔ b = b ⊔ a
sup_assoc : ∀ (a b c : α), a ⊔ b ⊔ c = a ⊔ (b ⊔ c)
inf_comm : ∀ (a b : α), a ⊓ b = b ⊓ a
inf_assoc : ∀ (a b c : α), a ⊓ b ⊓ c = a ⊓ (b ⊓ c)
sup_inf_self : ∀ (a b : α), a ⊔ a ⊓ b = a
inf_sup_self : ∀ (a b : α), a ⊓ (a ⊔ b) = a
sup_idem : ∀ (b : α), b ⊔ b = b
inf_idem : ∀ (b : α), b ⊓ b = b
semilatt_inf_inst : SemilatticeInf α := SemilatticeInf.mk' inf_comm inf_assoc inf_idem
semilatt_sup_inst : SemilatticeSup α := SemilatticeSup.mk' sup_comm sup_assoc sup_idem
partial_order_eq : SemilatticeSup.toPartialOrder = SemilatticeInf.toPartialOrder
a b : α
⊢ a ⊓ b ≤ b

Next tactic:
rw [partial_order_eq]
/-- A type with a pair of commutative and associative binary operations which satisfy two absorption
laws relating the two operations has the structure of a lattice.

The partial order is defined so that `a ≤ b` unfolds to `a ⊔ b = b`; cf. `sup_eq_right`.
-/
def Lattice.mk' {α : Type*} [Sup α] [Inf α] (sup_comm : ∀ a b : α, a ⊔ b = b ⊔ a)
    (sup_assoc : ∀ a b c : α, a ⊔ b ⊔ c = a ⊔ (b ⊔ c)) (inf_comm : ∀ a b : α, a ⊓ b = b ⊓ a)
    (inf_assoc : ∀ a b c : α, a ⊓ b ⊓ c = a ⊓ (b ⊓ c)) (sup_inf_self : ∀ a b : α, a ⊔ a ⊓ b = a)
    (inf_sup_self : ∀ a b : α, a ⊓ (a ⊔ b) = a) : Lattice α :=
  have sup_idem : ∀ b : α, b ⊔ b = b := fun b =>
    calc
      b ⊔ b = b ⊔ b ⊓ (b ⊔ b) := by rw [inf_sup_self]
      _ = b := by rw [sup_inf_self]

  have inf_idem : ∀ b : α, b ⊓ b = b := fun b =>
    calc
      b ⊓ b = b ⊓ (b ⊔ b ⊓ b) := by rw [sup_inf_self]
      _ = b := by rw [inf_sup_self]

  let semilatt_inf_inst := SemilatticeInf.mk' inf_comm inf_assoc inf_idem
  let semilatt_sup_inst := SemilatticeSup.mk' sup_comm sup_assoc sup_idem
  have partial_order_eq : @SemilatticeSup.toPartialOrder _ semilatt_sup_inst =
                          @SemilatticeInf.toPartialOrder _ semilatt_inf_inst :=
    semilatticeSup_mk'_partialOrder_eq_semilatticeInf_mk'_partialOrder _ _ _ _ _ _
      sup_inf_self inf_sup_self
  { semilatt_sup_inst, semilatt_inf_inst with
    inf_le_left := fun a b => by
      rw [partial_order_eq]
      apply inf_le_left,
    inf_le_right := fun a b => by
      rw [partial_order_eq]
      

Proof state:
α✝ : Type u
β : Type v
α : Type u_1
inst✝¹ : Sup α
inst✝ : Inf α
sup_comm : ∀ (a b : α), a ⊔ b = b ⊔ a
sup_assoc : ∀ (a b c : α), a ⊔ b ⊔ c = a ⊔ (b ⊔ c)
inf_comm : ∀ (a b : α), a ⊓ b = b ⊓ a
inf_assoc : ∀ (a b c : α), a ⊓ b ⊓ c = a ⊓ (b ⊓ c)
sup_inf_self : ∀ (a b : α), a ⊔ a ⊓ b = a
inf_sup_self : ∀ (a b : α), a ⊓ (a ⊔ b) = a
sup_idem : ∀ (b : α), b ⊔ b = b
inf_idem : ∀ (b : α), b ⊓ b = b
semilatt_inf_inst : SemilatticeInf α := SemilatticeInf.mk' inf_comm inf_assoc inf_idem
semilatt_sup_inst : SemilatticeSup α := SemilatticeSup.mk' sup_comm sup_assoc sup_idem
partial_order_eq : SemilatticeSup.toPartialOrder = SemilatticeInf.toPartialOrder
a b : α
⊢ a ⊓ b ≤ b

Next tactic:
apply inf_le_right
/-- A type with a pair of commutative and associative binary operations which satisfy two absorption
laws relating the two operations has the structure of a lattice.

The partial order is defined so that `a ≤ b` unfolds to `a ⊔ b = b`; cf. `sup_eq_right`.
-/
def Lattice.mk' {α : Type*} [Sup α] [Inf α] (sup_comm : ∀ a b : α, a ⊔ b = b ⊔ a)
    (sup_assoc : ∀ a b c : α, a ⊔ b ⊔ c = a ⊔ (b ⊔ c)) (inf_comm : ∀ a b : α, a ⊓ b = b ⊓ a)
    (inf_assoc : ∀ a b c : α, a ⊓ b ⊓ c = a ⊓ (b ⊓ c)) (sup_inf_self : ∀ a b : α, a ⊔ a ⊓ b = a)
    (inf_sup_self : ∀ a b : α, a ⊓ (a ⊔ b) = a) : Lattice α :=
  have sup_idem : ∀ b : α, b ⊔ b = b := fun b =>
    calc
      b ⊔ b = b ⊔ b ⊓ (b ⊔ b) := by rw [inf_sup_self]
      _ = b := by rw [sup_inf_self]

  have inf_idem : ∀ b : α, b ⊓ b = b := fun b =>
    calc
      b ⊓ b = b ⊓ (b ⊔ b ⊓ b) := by rw [sup_inf_self]
      _ = b := by rw [inf_sup_self]

  let semilatt_inf_inst := SemilatticeInf.mk' inf_comm inf_assoc inf_idem
  let semilatt_sup_inst := SemilatticeSup.mk' sup_comm sup_assoc sup_idem
  have partial_order_eq : @SemilatticeSup.toPartialOrder _ semilatt_sup_inst =
                          @SemilatticeInf.toPartialOrder _ semilatt_inf_inst :=
    semilatticeSup_mk'_partialOrder_eq_semilatticeInf_mk'_partialOrder _ _ _ _ _ _
      sup_inf_self inf_sup_self
  { semilatt_sup_inst, semilatt_inf_inst with
    inf_le_left := fun a b => by
      rw [partial_order_eq]
      apply inf_le_left,
    inf_le_right := fun a b => by
      rw [partial_order_eq]
      apply inf_le_right,
    le_inf := fun a b c => by
      

Proof state:
α✝ : Type u
β : Type v
α : Type u_1
inst✝¹ : Sup α
inst✝ : Inf α
sup_comm : ∀ (a b : α), a ⊔ b = b ⊔ a
sup_assoc : ∀ (a b c : α), a ⊔ b ⊔ c = a ⊔ (b ⊔ c)
inf_comm : ∀ (a b : α), a ⊓ b = b ⊓ a
inf_assoc : ∀ (a b c : α), a ⊓ b ⊓ c = a ⊓ (b ⊓ c)
sup_inf_self : ∀ (a b : α), a ⊔ a ⊓ b = a
inf_sup_self : ∀ (a b : α), a ⊓ (a ⊔ b) = a
sup_idem : ∀ (b : α), b ⊔ b = b
inf_idem : ∀ (b : α), b ⊓ b = b
semilatt_inf_inst : SemilatticeInf α := SemilatticeInf.mk' inf_comm inf_assoc inf_idem
semilatt_sup_inst : SemilatticeSup α := SemilatticeSup.mk' sup_comm sup_assoc sup_idem
partial_order_eq : SemilatticeSup.toPartialOrder = SemilatticeInf.toPartialOrder
a b c : α
⊢ a ≤ b → a ≤ c → a ≤ b ⊓ c

Next tactic:
rw [partial_order_eq]
/-- A type with a pair of commutative and associative binary operations which satisfy two absorption
laws relating the two operations has the structure of a lattice.

The partial order is defined so that `a ≤ b` unfolds to `a ⊔ b = b`; cf. `sup_eq_right`.
-/
def Lattice.mk' {α : Type*} [Sup α] [Inf α] (sup_comm : ∀ a b : α, a ⊔ b = b ⊔ a)
    (sup_assoc : ∀ a b c : α, a ⊔ b ⊔ c = a ⊔ (b ⊔ c)) (inf_comm : ∀ a b : α, a ⊓ b = b ⊓ a)
    (inf_assoc : ∀ a b c : α, a ⊓ b ⊓ c = a ⊓ (b ⊓ c)) (sup_inf_self : ∀ a b : α, a ⊔ a ⊓ b = a)
    (inf_sup_self : ∀ a b : α, a ⊓ (a ⊔ b) = a) : Lattice α :=
  have sup_idem : ∀ b : α, b ⊔ b = b := fun b =>
    calc
      b ⊔ b = b ⊔ b ⊓ (b ⊔ b) := by rw [inf_sup_self]
      _ = b := by rw [sup_inf_self]

  have inf_idem : ∀ b : α, b ⊓ b = b := fun b =>
    calc
      b ⊓ b = b ⊓ (b ⊔ b ⊓ b) := by rw [sup_inf_self]
      _ = b := by rw [inf_sup_self]

  let semilatt_inf_inst := SemilatticeInf.mk' inf_comm inf_assoc inf_idem
  let semilatt_sup_inst := SemilatticeSup.mk' sup_comm sup_assoc sup_idem
  have partial_order_eq : @SemilatticeSup.toPartialOrder _ semilatt_sup_inst =
                          @SemilatticeInf.toPartialOrder _ semilatt_inf_inst :=
    semilatticeSup_mk'_partialOrder_eq_semilatticeInf_mk'_partialOrder _ _ _ _ _ _
      sup_inf_self inf_sup_self
  { semilatt_sup_inst, semilatt_inf_inst with
    inf_le_left := fun a b => by
      rw [partial_order_eq]
      apply inf_le_left,
    inf_le_right := fun a b => by
      rw [partial_order_eq]
      apply inf_le_right,
    le_inf := fun a b c => by
      rw [partial_order_eq]
      

Proof state:
α✝ : Type u
β : Type v
α : Type u_1
inst✝¹ : Sup α
inst✝ : Inf α
sup_comm : ∀ (a b : α), a ⊔ b = b ⊔ a
sup_assoc : ∀ (a b c : α), a ⊔ b ⊔ c = a ⊔ (b ⊔ c)
inf_comm : ∀ (a b : α), a ⊓ b = b ⊓ a
inf_assoc : ∀ (a b c : α), a ⊓ b ⊓ c = a ⊓ (b ⊓ c)
sup_inf_self : ∀ (a b : α), a ⊔ a ⊓ b = a
inf_sup_self : ∀ (a b : α), a ⊓ (a ⊔ b) = a
sup_idem : ∀ (b : α), b ⊔ b = b
inf_idem : ∀ (b : α), b ⊓ b = b
semilatt_inf_inst : SemilatticeInf α := SemilatticeInf.mk' inf_comm inf_assoc inf_idem
semilatt_sup_inst : SemilatticeSup α := SemilatticeSup.mk' sup_comm sup_assoc sup_idem
partial_order_eq : SemilatticeSup.toPartialOrder = SemilatticeInf.toPartialOrder
a b c : α
⊢ a ≤ b → a ≤ c → a ≤ b ⊓ c

Next tactic:
apply le_inf
theorem sup_le_inf : a ⊔ b ≤ a ⊓ b ↔ a = b := by 

Proof state:
α : Type u
β : Type v
inst✝ : Lattice α
a b c d : α
⊢ a ⊔ b ≤ a ⊓ b ↔ a = b

Next tactic:
simp [le_antisymm_iff, and_comm]
@[simp] lemma inf_eq_sup : a ⊓ b = a ⊔ b ↔ a = b := by 

Proof state:
α : Type u
β : Type v
inst✝ : Lattice α
a b c d : α
⊢ a ⊓ b = a ⊔ b ↔ a = b

Next tactic:
rw [← inf_le_sup.ge_iff_eq, sup_le_inf]
@[simp] lemma inf_lt_sup : a ⊓ b < a ⊔ b ↔ a ≠ b := by 

Proof state:
α : Type u
β : Type v
inst✝ : Lattice α
a b c d : α
⊢ a ⊓ b < a ⊔ b ↔ a ≠ b

Next tactic:
rw [inf_le_sup.lt_iff_ne, Ne.def, inf_eq_sup]
lemma inf_eq_and_sup_eq_iff : a ⊓ b = c ∧ a ⊔ b = c ↔ a = c ∧ b = c := by
  

Proof state:
α : Type u
β : Type v
inst✝ : Lattice α
a b c d : α
⊢ a ⊓ b = c ∧ a ⊔ b = c ↔ a = c ∧ b = c

Next tactic:
refine' ⟨fun h ↦ _, _⟩
lemma inf_eq_and_sup_eq_iff : a ⊓ b = c ∧ a ⊔ b = c ↔ a = c ∧ b = c := by
  refine' ⟨fun h ↦ _, _⟩
  

Proof state:
case refine'_1
α : Type u
β : Type v
inst✝ : Lattice α
a b c d : α
h : a ⊓ b = c ∧ a ⊔ b = c
⊢ a = c ∧ b = c
case refine'_2 α : Type u β : Type v inst✝ : Lattice α a b c d : α ⊢ a = c ∧ b = c → a ⊓ b = c ∧ a ⊔ b = c

Next tactic:
{ obtain rfl := sup_eq_inf.1 (h.2.trans h.1.symm)
    simpa using h }
lemma inf_eq_and_sup_eq_iff : a ⊓ b = c ∧ a ⊔ b = c ↔ a = c ∧ b = c := by
  refine' ⟨fun h ↦ _, _⟩
  { 

Proof state:
case refine'_1
α : Type u
β : Type v
inst✝ : Lattice α
a b c d : α
h : a ⊓ b = c ∧ a ⊔ b = c
⊢ a = c ∧ b = c

Next tactic:
obtain rfl := sup_eq_inf.1 (h.2.trans h.1.symm)
lemma inf_eq_and_sup_eq_iff : a ⊓ b = c ∧ a ⊔ b = c ↔ a = c ∧ b = c := by
  refine' ⟨fun h ↦ _, _⟩
  { obtain rfl := sup_eq_inf.1 (h.2.trans h.1.symm)
    

Proof state:
case refine'_1
α : Type u
β : Type v
inst✝ : Lattice α
a c d : α
h : a ⊓ a = c ∧ a ⊔ a = c
⊢ a = c ∧ a = c

Next tactic:
simpa using h
lemma inf_eq_and_sup_eq_iff : a ⊓ b = c ∧ a ⊔ b = c ↔ a = c ∧ b = c := by
  refine' ⟨fun h ↦ _, _⟩
  { obtain rfl := sup_eq_inf.1 (h.2.trans h.1.symm)
    simpa using h }
  

Proof state:
case refine'_2
α : Type u
β : Type v
inst✝ : Lattice α
a b c d : α
⊢ a = c ∧ b = c → a ⊓ b = c ∧ a ⊔ b = c

Next tactic:
{ rintro ⟨rfl, rfl⟩
    exact ⟨inf_idem, sup_idem⟩ }
lemma inf_eq_and_sup_eq_iff : a ⊓ b = c ∧ a ⊔ b = c ↔ a = c ∧ b = c := by
  refine' ⟨fun h ↦ _, _⟩
  { obtain rfl := sup_eq_inf.1 (h.2.trans h.1.symm)
    simpa using h }
  { 

Proof state:
case refine'_2
α : Type u
β : Type v
inst✝ : Lattice α
a b c d : α
⊢ a = c ∧ b = c → a ⊓ b = c ∧ a ⊔ b = c

Next tactic:
rintro ⟨rfl, rfl⟩
lemma inf_eq_and_sup_eq_iff : a ⊓ b = c ∧ a ⊔ b = c ↔ a = c ∧ b = c := by
  refine' ⟨fun h ↦ _, _⟩
  { obtain rfl := sup_eq_inf.1 (h.2.trans h.1.symm)
    simpa using h }
  { rintro ⟨rfl, rfl⟩
    

Proof state:
case refine'_2.intro
α : Type u
β : Type v
inst✝ : Lattice α
b d : α
⊢ b ⊓ b = b ∧ b ⊔ b = b

Next tactic:
exact ⟨inf_idem, sup_idem⟩
theorem inf_sup_self : a ⊓ (a ⊔ b) = a := by 

Proof state:
α : Type u
β : Type v
inst✝ : Lattice α
a b c d : α
⊢ a ⊓ (a ⊔ b) = a

Next tactic:
simp
theorem sup_inf_self : a ⊔ a ⊓ b = a := by 

Proof state:
α : Type u
β : Type v
inst✝ : Lattice α
a b c d : α
⊢ a ⊔ a ⊓ b = a

Next tactic:
simp
theorem sup_eq_iff_inf_eq : a ⊔ b = b ↔ a ⊓ b = a := by 

Proof state:
α : Type u
β : Type v
inst✝ : Lattice α
a b c d : α
⊢ a ⊔ b = b ↔ a ⊓ b = a

Next tactic:
rw [sup_eq_right, ← inf_eq_left]
theorem Lattice.ext {α} {A B : Lattice α} (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y) :
    A = B := by
  

Proof state:
α✝ : Type u
β : Type v
inst✝ : Lattice α✝
a b c d : α✝
α : Type u_1
A B : Lattice α
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
⊢ A = B

Next tactic:
cases A
theorem Lattice.ext {α} {A B : Lattice α} (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y) :
    A = B := by
  cases A
  

Proof state:
case mk
α✝ : Type u
β : Type v
inst✝ : Lattice α✝
a b c d : α✝
α : Type u_1
B : Lattice α
toSemilatticeSup✝ : SemilatticeSup α
toInf✝ : Inf α
inf_le_left✝ : ∀ (a b : α), a ⊓ b ≤ a
inf_le_right✝ : ∀ (a b : α), a ⊓ b ≤ b
le_inf✝ : ∀ (a b c : α), a ≤ b → a ≤ c → a ≤ b ⊓ c
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
⊢ mk inf_le_left✝ inf_le_right✝ le_inf✝ = B

Next tactic:
cases B
theorem Lattice.ext {α} {A B : Lattice α} (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y) :
    A = B := by
  cases A
  cases B
  

Proof state:
case mk.mk
α✝ : Type u
β : Type v
inst✝ : Lattice α✝
a b c d : α✝
α : Type u_1
toSemilatticeSup✝¹ : SemilatticeSup α
toInf✝¹ : Inf α
inf_le_left✝¹ : ∀ (a b : α), a ⊓ b ≤ a
inf_le_right✝¹ : ∀ (a b : α), a ⊓ b ≤ b
le_inf✝¹ : ∀ (a b c : α), a ≤ b → a ≤ c → a ≤ b ⊓ c
toSemilatticeSup✝ : SemilatticeSup α
toInf✝ : Inf α
inf_le_left✝ : ∀ (a b : α), a ⊓ b ≤ a
inf_le_right✝ : ∀ (a b : α), a ⊓ b ≤ b
le_inf✝ : ∀ (a b c : α), a ≤ b → a ≤ c → a ≤ b ⊓ c
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
⊢ mk inf_le_left✝¹ inf_le_right✝¹ le_inf✝¹ = mk inf_le_left✝ inf_le_right✝ le_inf✝

Next tactic:
cases SemilatticeSup.ext H
theorem Lattice.ext {α} {A B : Lattice α} (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y) :
    A = B := by
  cases A
  cases B
  cases SemilatticeSup.ext H
  

Proof state:
case mk.mk.refl
α✝ : Type u
β : Type v
inst✝ : Lattice α✝
a b c d : α✝
α : Type u_1
toSemilatticeSup✝ : SemilatticeSup α
toInf✝¹ : Inf α
inf_le_left✝¹ : ∀ (a b : α), a ⊓ b ≤ a
inf_le_right✝¹ : ∀ (a b : α), a ⊓ b ≤ b
le_inf✝¹ : ∀ (a b c : α), a ≤ b → a ≤ c → a ≤ b ⊓ c
toInf✝ : Inf α
inf_le_left✝ : ∀ (a b : α), a ⊓ b ≤ a
inf_le_right✝ : ∀ (a b : α), a ⊓ b ≤ b
le_inf✝ : ∀ (a b c : α), a ≤ b → a ≤ c → a ≤ b ⊓ c
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
⊢ mk inf_le_left✝¹ inf_le_right✝¹ le_inf✝¹ = mk inf_le_left✝ inf_le_right✝ le_inf✝

Next tactic:
cases SemilatticeInf.ext H
theorem Lattice.ext {α} {A B : Lattice α} (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y) :
    A = B := by
  cases A
  cases B
  cases SemilatticeSup.ext H
  cases SemilatticeInf.ext H
  

Proof state:
case mk.mk.refl.refl
α✝ : Type u
β : Type v
inst✝ : Lattice α✝
a b c d : α✝
α : Type u_1
toSemilatticeSup✝ : SemilatticeSup α
toInf✝ : Inf α
inf_le_left✝¹ : ∀ (a b : α), a ⊓ b ≤ a
inf_le_right✝¹ : ∀ (a b : α), a ⊓ b ≤ b
le_inf✝¹ : ∀ (a b c : α), a ≤ b → a ≤ c → a ≤ b ⊓ c
inf_le_left✝ : ∀ (a b : α), a ⊓ b ≤ a
inf_le_right✝ : ∀ (a b : α), a ⊓ b ≤ b
le_inf✝ : ∀ (a b c : α), a ≤ b → a ≤ c → a ≤ b ⊓ c
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
⊢ mk inf_le_left✝¹ inf_le_right✝¹ le_inf✝¹ = mk inf_le_left✝ inf_le_right✝ le_inf✝

Next tactic:
congr
theorem sup_inf_right : y ⊓ z ⊔ x = (y ⊔ x) ⊓ (z ⊔ x) := by
  

Proof state:
α : Type u
β : Type v
inst✝ : DistribLattice α
x y z : α
⊢ y ⊓ z ⊔ x = (y ⊔ x) ⊓ (z ⊔ x)

Next tactic:
simp only [sup_inf_left, fun y : α => @sup_comm α _ y x, eq_self_iff_true]
theorem inf_sup_left : x ⊓ (y ⊔ z) = x ⊓ y ⊔ x ⊓ z :=
  calc
    x ⊓ (y ⊔ z) = x ⊓ (x ⊔ z) ⊓ (y ⊔ z) := by 

Proof state:
α : Type u
β : Type v
inst✝ : DistribLattice α
x y z : α
⊢ x ⊓ (y ⊔ z) = x ⊓ (x ⊔ z) ⊓ (y ⊔ z)

Next tactic:
rw [inf_sup_self]
theorem inf_sup_left : x ⊓ (y ⊔ z) = x ⊓ y ⊔ x ⊓ z :=
  calc
    x ⊓ (y ⊔ z) = x ⊓ (x ⊔ z) ⊓ (y ⊔ z) := by rw [inf_sup_self]
    _ = x ⊓ (x ⊓ y ⊔ z) := by 

Proof state:
α : Type u
β : Type v
inst✝ : DistribLattice α
x y z : α
⊢ x ⊓ (x ⊔ z) ⊓ (y ⊔ z) = x ⊓ (x ⊓ y ⊔ z)

Next tactic:
simp only [inf_assoc, sup_inf_right, eq_self_iff_true]
theorem inf_sup_left : x ⊓ (y ⊔ z) = x ⊓ y ⊔ x ⊓ z :=
  calc
    x ⊓ (y ⊔ z) = x ⊓ (x ⊔ z) ⊓ (y ⊔ z) := by rw [inf_sup_self]
    _ = x ⊓ (x ⊓ y ⊔ z) := by simp only [inf_assoc, sup_inf_right, eq_self_iff_true]
    _ = (x ⊔ x ⊓ y) ⊓ (x ⊓ y ⊔ z) := by 

Proof state:
α : Type u
β : Type v
inst✝ : DistribLattice α
x y z : α
⊢ x ⊓ (x ⊓ y ⊔ z) = (x ⊔ x ⊓ y) ⊓ (x ⊓ y ⊔ z)

Next tactic:
rw [sup_inf_self]
theorem inf_sup_left : x ⊓ (y ⊔ z) = x ⊓ y ⊔ x ⊓ z :=
  calc
    x ⊓ (y ⊔ z) = x ⊓ (x ⊔ z) ⊓ (y ⊔ z) := by rw [inf_sup_self]
    _ = x ⊓ (x ⊓ y ⊔ z) := by simp only [inf_assoc, sup_inf_right, eq_self_iff_true]
    _ = (x ⊔ x ⊓ y) ⊓ (x ⊓ y ⊔ z) := by rw [sup_inf_self]
    _ = (x ⊓ y ⊔ x) ⊓ (x ⊓ y ⊔ z) := by 

Proof state:
α : Type u
β : Type v
inst✝ : DistribLattice α
x y z : α
⊢ (x ⊔ x ⊓ y) ⊓ (x ⊓ y ⊔ z) = (x ⊓ y ⊔ x) ⊓ (x ⊓ y ⊔ z)

Next tactic:
rw [sup_comm]
theorem inf_sup_left : x ⊓ (y ⊔ z) = x ⊓ y ⊔ x ⊓ z :=
  calc
    x ⊓ (y ⊔ z) = x ⊓ (x ⊔ z) ⊓ (y ⊔ z) := by rw [inf_sup_self]
    _ = x ⊓ (x ⊓ y ⊔ z) := by simp only [inf_assoc, sup_inf_right, eq_self_iff_true]
    _ = (x ⊔ x ⊓ y) ⊓ (x ⊓ y ⊔ z) := by rw [sup_inf_self]
    _ = (x ⊓ y ⊔ x) ⊓ (x ⊓ y ⊔ z) := by rw [sup_comm]
    _ = x ⊓ y ⊔ x ⊓ z := by 

Proof state:
α : Type u
β : Type v
inst✝ : DistribLattice α
x y z : α
⊢ (x ⊓ y ⊔ x) ⊓ (x ⊓ y ⊔ z) = x ⊓ y ⊔ x ⊓ z

Next tactic:
rw [sup_inf_left]
theorem inf_sup_right : (y ⊔ z) ⊓ x = y ⊓ x ⊔ z ⊓ x := by
  

Proof state:
α : Type u
β : Type v
inst✝ : DistribLattice α
x y z : α
⊢ (y ⊔ z) ⊓ x = y ⊓ x ⊔ z ⊓ x

Next tactic:
simp only [inf_sup_left, fun y : α => @inf_comm α _ y x, eq_self_iff_true]
theorem le_of_inf_le_sup_le (h₁ : x ⊓ z ≤ y ⊓ z) (h₂ : x ⊔ z ≤ y ⊔ z) : x ≤ y :=
  calc
    x ≤ y ⊓ z ⊔ x := le_sup_right
    _ = (y ⊔ x) ⊓ (x ⊔ z) := by 

Proof state:
α : Type u
β : Type v
inst✝ : DistribLattice α
x y z : α
h₁ : x ⊓ z ≤ y ⊓ z
h₂ : x ⊔ z ≤ y ⊔ z
⊢ y ⊓ z ⊔ x = (y ⊔ x) ⊓ (x ⊔ z)

Next tactic:
rw [sup_inf_right, @sup_comm _ _ x]
theorem sup_ind (a b : α) {p : α → Prop} (ha : p a) (hb : p b) : p (a ⊔ b) :=
  (IsTotal.total a b).elim (fun h : a ≤ b => by 

Proof state:
α : Type u
β : Type v
inst✝ : LinearOrder α
a✝ b✝ c d a b : α
p : α → Prop
ha : p a
hb : p b
h : a ≤ b
⊢ p (a ⊔ b)

Next tactic:
rwa [sup_eq_right.2 h]
theorem sup_ind (a b : α) {p : α → Prop} (ha : p a) (hb : p b) : p (a ⊔ b) :=
  (IsTotal.total a b).elim (fun h : a ≤ b => by rwa [sup_eq_right.2 h]) fun h => by
  

Proof state:
α : Type u
β : Type v
inst✝ : LinearOrder α
a✝ b✝ c d a b : α
p : α → Prop
ha : p a
hb : p b
h : b ≤ a
⊢ p (a ⊔ b)

Next tactic:
rwa [sup_eq_left.2 h]
@[simp]
theorem le_sup_iff : a ≤ b ⊔ c ↔ a ≤ b ∨ a ≤ c := by
  

Proof state:
α : Type u
β : Type v
inst✝ : LinearOrder α
a b c d : α
⊢ a ≤ b ⊔ c ↔ a ≤ b ∨ a ≤ c

Next tactic:
exact ⟨fun h =>
    (le_total c b).imp
      (fun bc => by rwa [sup_eq_left.2 bc] at h)
      (fun bc => by rwa [sup_eq_right.2 bc] at h),
    fun h => h.elim le_sup_of_le_left le_sup_of_le_right⟩
@[simp]
theorem le_sup_iff : a ≤ b ⊔ c ↔ a ≤ b ∨ a ≤ c := by
  exact ⟨fun h =>
    (le_total c b).imp
      (fun bc => by 

Proof state:
α : Type u
β : Type v
inst✝ : LinearOrder α
a b c d : α
h : a ≤ b ⊔ c
bc : c ≤ b
⊢ a ≤ b

Next tactic:
rwa [sup_eq_left.2 bc] at h
@[simp]
theorem le_sup_iff : a ≤ b ⊔ c ↔ a ≤ b ∨ a ≤ c := by
  exact ⟨fun h =>
    (le_total c b).imp
      (fun bc => by rwa [sup_eq_left.2 bc] at h)
      (fun bc => by 

Proof state:
α : Type u
β : Type v
inst✝ : LinearOrder α
a b c d : α
h : a ≤ b ⊔ c
bc : b ≤ c
⊢ a ≤ c

Next tactic:
rwa [sup_eq_right.2 bc] at h
@[simp]
theorem lt_sup_iff : a < b ⊔ c ↔ a < b ∨ a < c := by
  

Proof state:
α : Type u
β : Type v
inst✝ : LinearOrder α
a b c d : α
⊢ a < b ⊔ c ↔ a < b ∨ a < c

Next tactic:
exact ⟨fun h =>
    (le_total c b).imp
      (fun bc => by rwa [sup_eq_left.2 bc] at h)
      (fun bc => by rwa [sup_eq_right.2 bc] at h),
    fun h => h.elim lt_sup_of_lt_left lt_sup_of_lt_right⟩