l3lab/ntp-mathlib huggingface dataset:
theorem le_iff_exists_sup : a ≤ b ↔ ∃ c, b = a ⊔ c := by
  constructor
  · intro h
    exact ⟨b, (sup_eq_right.mpr h).symm⟩
  · 

Proof state:
case mpr
α : Type u
β : Type v
inst✝ : SemilatticeSup α
a b c d : α
⊢ (∃ c, b = a ⊔ c) → a ≤ b

Next tactic:
rintro ⟨c, rfl : _ = _ ⊔ _⟩
theorem le_iff_exists_sup : a ≤ b ↔ ∃ c, b = a ⊔ c := by
  constructor
  · intro h
    exact ⟨b, (sup_eq_right.mpr h).symm⟩
  · rintro ⟨c, rfl : _ = _ ⊔ _⟩
    

Proof state:
case mpr.intro
α : Type u
β : Type v
inst✝ : SemilatticeSup α
a c✝ d c : α
⊢ a ≤ a ⊔ c

Next tactic:
exact le_sup_left
theorem sup_idem : a ⊔ a = a := by 

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

Next tactic:
simp
theorem sup_comm : a ⊔ b = b ⊔ a := by 

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

Next tactic:
apply le_antisymm
theorem sup_comm : a ⊔ b = b ⊔ a := by apply le_antisymm <;> 

Proof state:
case a
α : Type u
β : Type v
inst✝ : SemilatticeSup α
a b c d : α
⊢ a ⊔ b ≤ b ⊔ a

Next tactic:
simp
theorem sup_comm : a ⊔ b = b ⊔ a := by apply le_antisymm <;> 

Proof state:
case a
α : Type u
β : Type v
inst✝ : SemilatticeSup α
a b c d : α
⊢ b ⊔ a ≤ a ⊔ b

Next tactic:
simp
theorem sup_assoc : a ⊔ b ⊔ c = a ⊔ (b ⊔ c) :=
  eq_of_forall_ge_iff $ fun x => by 

Proof state:
α : Type u
β : Type v
inst✝ : SemilatticeSup α
a b c d x : α
⊢ a ⊔ b ⊔ c ≤ x ↔ a ⊔ (b ⊔ c) ≤ x

Next tactic:
simp only [sup_le_iff]
theorem sup_assoc : a ⊔ b ⊔ c = a ⊔ (b ⊔ c) :=
  eq_of_forall_ge_iff $ fun x => by simp only [sup_le_iff]; 

Proof state:
α : Type u
β : Type v
inst✝ : SemilatticeSup α
a b c d x : α
⊢ (a ≤ x ∧ b ≤ x) ∧ c ≤ x ↔ a ≤ x ∧ b ≤ x ∧ c ≤ x

Next tactic:
rw [and_assoc]
theorem sup_left_right_swap (a b c : α) : a ⊔ b ⊔ c = c ⊔ b ⊔ a := by
  

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

Next tactic:
rw [sup_comm, @sup_comm _ _ a, sup_assoc]
theorem sup_left_idem : a ⊔ (a ⊔ b) = a ⊔ b := by 

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

Next tactic:
simp
theorem sup_right_idem : a ⊔ b ⊔ b = a ⊔ b := by 

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

Next tactic:
simp
theorem sup_left_comm (a b c : α) : a ⊔ (b ⊔ c) = b ⊔ (a ⊔ c) := by
  

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

Next tactic:
rw [← sup_assoc, ← sup_assoc, @sup_comm α _ a]
theorem sup_right_comm (a b c : α) : a ⊔ b ⊔ c = a ⊔ c ⊔ b := by
  

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

Next tactic:
rw [sup_assoc, sup_assoc, @sup_comm _ _ b]
theorem sup_sup_sup_comm (a b c d : α) : a ⊔ b ⊔ (c ⊔ d) = a ⊔ c ⊔ (b ⊔ d) := by
  

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

Next tactic:
rw [sup_assoc, sup_left_comm b, ← sup_assoc]
theorem sup_sup_distrib_left (a b c : α) : a ⊔ (b ⊔ c) = a ⊔ b ⊔ (a ⊔ c) := by
  

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

Next tactic:
rw [sup_sup_sup_comm, sup_idem]
theorem sup_sup_distrib_right (a b c : α) : a ⊔ b ⊔ c = a ⊔ c ⊔ (b ⊔ c) := by
  

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

Next tactic:
rw [sup_sup_sup_comm, sup_idem]
theorem SemilatticeSup.ext_sup {α} {A B : SemilatticeSup α}
    (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y)
    (x y : α) :
    (haveI := A; x ⊔ y) = x ⊔ y :=
  eq_of_forall_ge_iff $ fun c => by 

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

Next tactic:
simp only [sup_le_iff]
theorem SemilatticeSup.ext_sup {α} {A B : SemilatticeSup α}
    (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y)
    (x y : α) :
    (haveI := A; x ⊔ y) = x ⊔ y :=
  eq_of_forall_ge_iff $ fun c => by simp only [sup_le_iff]; 

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

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

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

Next tactic:
have ss : A.toSup = B.toSup := by ext; apply SemilatticeSup.ext_sup H
theorem SemilatticeSup.ext {α} {A B : SemilatticeSup α}
    (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y) :
    A = B := by
  have ss : A.toSup = B.toSup := by 

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

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

Proof state:
case sup.h.h
α✝ : Type u
β : Type v
inst✝ : SemilatticeSup α✝
a b c d : α✝
α : Type u_1
A B : SemilatticeSup α
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
x✝¹ x✝ : α
⊢ x✝¹ ⊔ x✝ = x✝¹ ⊔ x✝

Next tactic:
apply SemilatticeSup.ext_sup H
theorem SemilatticeSup.ext {α} {A B : SemilatticeSup α}
    (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y) :
    A = B := by
  have ss : A.toSup = B.toSup := by ext; apply SemilatticeSup.ext_sup H
  

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

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

Proof state:
case mk
α✝ : Type u
β : Type v
inst✝ : SemilatticeSup α✝
a b c d : α✝
α : Type u_1
B : SemilatticeSup α
toSup✝ : Sup α
toPartialOrder✝ : PartialOrder α
le_sup_left✝ : ∀ (a b : α), a ≤ a ⊔ b
le_sup_right✝ : ∀ (a b : α), b ≤ a ⊔ b
sup_le✝ : ∀ (a b c : α), a ≤ c → b ≤ c → a ⊔ b ≤ c
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
ss : toSup = toSup
⊢ mk le_sup_left✝ le_sup_right✝ sup_le✝ = B

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

Proof state:
case mk.mk
α✝ : Type u
β : Type v
inst✝ : SemilatticeSup α✝
a b c d : α✝
α : Type u_1
toSup✝¹ : Sup α
toPartialOrder✝¹ : PartialOrder α
le_sup_left✝¹ : ∀ (a b : α), a ≤ a ⊔ b
le_sup_right✝¹ : ∀ (a b : α), b ≤ a ⊔ b
sup_le✝¹ : ∀ (a b c : α), a ≤ c → b ≤ c → a ⊔ b ≤ c
toSup✝ : Sup α
toPartialOrder✝ : PartialOrder α
le_sup_left✝ : ∀ (a b : α), a ≤ a ⊔ b
le_sup_right✝ : ∀ (a b : α), b ≤ a ⊔ b
sup_le✝ : ∀ (a b c : α), a ≤ c → b ≤ c → a ⊔ b ≤ c
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
ss : toSup = toSup
⊢ mk le_sup_left✝¹ le_sup_right✝¹ sup_le✝¹ = mk le_sup_left✝ le_sup_right✝ sup_le✝

Next tactic:
cases PartialOrder.ext H
theorem SemilatticeSup.ext {α} {A B : SemilatticeSup α}
    (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y) :
    A = B := by
  have ss : A.toSup = B.toSup := by ext; apply SemilatticeSup.ext_sup H
  cases A
  cases B
  cases PartialOrder.ext H
  

Proof state:
case mk.mk.refl
α✝ : Type u
β : Type v
inst✝ : SemilatticeSup α✝
a b c d : α✝
α : Type u_1
toSup✝¹ : Sup α
toPartialOrder✝ : PartialOrder α
le_sup_left✝¹ : ∀ (a b : α), a ≤ a ⊔ b
le_sup_right✝¹ : ∀ (a b : α), b ≤ a ⊔ b
sup_le✝¹ : ∀ (a b c : α), a ≤ c → b ≤ c → a ⊔ b ≤ c
toSup✝ : Sup α
le_sup_left✝ : ∀ (a b : α), a ≤ a ⊔ b
le_sup_right✝ : ∀ (a b : α), b ≤ a ⊔ b
sup_le✝ : ∀ (a b c : α), a ≤ c → b ≤ c → a ⊔ b ≤ c
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
ss : toSup = toSup
⊢ mk le_sup_left✝¹ le_sup_right✝¹ sup_le✝¹ = mk le_sup_left✝ le_sup_right✝ sup_le✝

Next tactic:
congr
@[simp]
theorem inf_eq_left : a ⊓ b = a ↔ a ≤ b :=
  le_antisymm_iff.trans $ by 

Proof state:
α : Type u
β : Type v
inst✝ : SemilatticeInf α
a b c d : α
⊢ a ⊓ b ≤ a ∧ a ≤ a ⊓ b ↔ a ≤ b

Next tactic:
simp [le_rfl]
@[simp]
theorem inf_eq_right : a ⊓ b = b ↔ b ≤ a :=
  le_antisymm_iff.trans $ by 

Proof state:
α : Type u
β : Type v
inst✝ : SemilatticeInf α
a b c d : α
⊢ a ⊓ b ≤ b ∧ b ≤ a ⊓ b ↔ b ≤ a

Next tactic:
simp [le_rfl]
theorem SemilatticeInf.ext_inf {α} {A B : SemilatticeInf α}
    (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y)
    (x y : α) :
    (haveI := A; x ⊓ y) = x ⊓ y :=
  eq_of_forall_le_iff $ fun c => by 

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

Next tactic:
simp only [le_inf_iff]
theorem SemilatticeInf.ext_inf {α} {A B : SemilatticeInf α}
    (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y)
    (x y : α) :
    (haveI := A; x ⊓ y) = x ⊓ y :=
  eq_of_forall_le_iff $ fun c => by simp only [le_inf_iff]; 

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

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

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

Next tactic:
have ss : A.toInf = B.toInf := by ext; apply SemilatticeInf.ext_inf H
theorem SemilatticeInf.ext {α} {A B : SemilatticeInf α}
    (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y) :
    A = B := by
  have ss : A.toInf = B.toInf := by 

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

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

Proof state:
case inf.h.h
α✝ : Type u
β : Type v
inst✝ : SemilatticeInf α✝
a b c d : α✝
α : Type u_1
A B : SemilatticeInf α
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
x✝¹ x✝ : α
⊢ x✝¹ ⊓ x✝ = x✝¹ ⊓ x✝

Next tactic:
apply SemilatticeInf.ext_inf H
theorem SemilatticeInf.ext {α} {A B : SemilatticeInf α}
    (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y) :
    A = B := by
  have ss : A.toInf = B.toInf := by ext; apply SemilatticeInf.ext_inf H
  

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

Next tactic:
cases A
theorem SemilatticeInf.ext {α} {A B : SemilatticeInf α}
    (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y) :
    A = B := by
  have ss : A.toInf = B.toInf := by ext; apply SemilatticeInf.ext_inf H
  cases A
  

Proof state:
case mk
α✝ : Type u
β : Type v
inst✝ : SemilatticeInf α✝
a b c d : α✝
α : Type u_1
B : SemilatticeInf α
toInf✝ : Inf α
toPartialOrder✝ : PartialOrder α
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
ss : toInf = toInf
⊢ mk inf_le_left✝ inf_le_right✝ le_inf✝ = B

Next tactic:
cases B
theorem SemilatticeInf.ext {α} {A B : SemilatticeInf α}
    (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y) :
    A = B := by
  have ss : A.toInf = B.toInf := by ext; apply SemilatticeInf.ext_inf H
  cases A
  cases B
  

Proof state:
case mk.mk
α✝ : Type u
β : Type v
inst✝ : SemilatticeInf α✝
a b c d : α✝
α : Type u_1
toInf✝¹ : Inf α
toPartialOrder✝¹ : PartialOrder α
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 α
toPartialOrder✝ : PartialOrder α
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
ss : toInf = toInf
⊢ mk inf_le_left✝¹ inf_le_right✝¹ le_inf✝¹ = mk inf_le_left✝ inf_le_right✝ le_inf✝

Next tactic:
cases PartialOrder.ext H
theorem SemilatticeInf.ext {α} {A B : SemilatticeInf α}
    (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y) :
    A = B := by
  have ss : A.toInf = B.toInf := by ext; apply SemilatticeInf.ext_inf H
  cases A
  cases B
  cases PartialOrder.ext H
  

Proof state:
case mk.mk.refl
α✝ : Type u
β : Type v
inst✝ : SemilatticeInf α✝
a b c d : α✝
α : Type u_1
toInf✝¹ : Inf α
toPartialOrder✝ : PartialOrder α
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
ss : toInf = toInf
⊢ mk inf_le_left✝¹ inf_le_right✝¹ le_inf✝¹ = mk inf_le_left✝ inf_le_right✝ le_inf✝

Next tactic:
congr
/--
A type with a commutative, associative and idempotent binary `inf` operation has the structure of a
meet-semilattice.

The partial order is defined so that `a ≤ b` unfolds to `b ⊓ a = a`; cf. `inf_eq_right`.
-/
def SemilatticeInf.mk' {α : Type*} [Inf α] (inf_comm : ∀ a b : α, a ⊓ b = b ⊓ a)
    (inf_assoc : ∀ a b c : α, a ⊓ b ⊓ c = a ⊓ (b ⊓ c)) (inf_idem : ∀ a : α, a ⊓ a = a) :
    SemilatticeInf α := by
  

Proof state:
α✝ : Type u
β : Type v
α : Type u_1
inst✝ : Inf α
inf_comm : ∀ (a b : α), a ⊓ b = b ⊓ a
inf_assoc : ∀ (a b c : α), a ⊓ b ⊓ c = a ⊓ (b ⊓ c)
inf_idem : ∀ (a : α), a ⊓ a = a
⊢ SemilatticeInf α

Next tactic:
haveI : SemilatticeSup αᵒᵈ := SemilatticeSup.mk' inf_comm inf_assoc inf_idem
/--
A type with a commutative, associative and idempotent binary `inf` operation has the structure of a
meet-semilattice.

The partial order is defined so that `a ≤ b` unfolds to `b ⊓ a = a`; cf. `inf_eq_right`.
-/
def SemilatticeInf.mk' {α : Type*} [Inf α] (inf_comm : ∀ a b : α, a ⊓ b = b ⊓ a)
    (inf_assoc : ∀ a b c : α, a ⊓ b ⊓ c = a ⊓ (b ⊓ c)) (inf_idem : ∀ a : α, a ⊓ a = a) :
    SemilatticeInf α := by
  haveI : SemilatticeSup αᵒᵈ := SemilatticeSup.mk' inf_comm inf_assoc inf_idem
  

Proof state:
α✝ : Type u
β : Type v
α : Type u_1
inst✝ : Inf α
inf_comm : ∀ (a b : α), a ⊓ b = b ⊓ a
inf_assoc : ∀ (a b c : α), a ⊓ b ⊓ c = a ⊓ (b ⊓ c)
inf_idem : ∀ (a : α), a ⊓ a = a
this : SemilatticeSup αᵒᵈ
⊢ SemilatticeInf α

Next tactic:
haveI i := OrderDual.semilatticeInf αᵒᵈ
/--
A type with a commutative, associative and idempotent binary `inf` operation has the structure of a
meet-semilattice.

The partial order is defined so that `a ≤ b` unfolds to `b ⊓ a = a`; cf. `inf_eq_right`.
-/
def SemilatticeInf.mk' {α : Type*} [Inf α] (inf_comm : ∀ a b : α, a ⊓ b = b ⊓ a)
    (inf_assoc : ∀ a b c : α, a ⊓ b ⊓ c = a ⊓ (b ⊓ c)) (inf_idem : ∀ a : α, a ⊓ a = a) :
    SemilatticeInf α := by
  haveI : SemilatticeSup αᵒᵈ := SemilatticeSup.mk' inf_comm inf_assoc inf_idem
  haveI i := OrderDual.semilatticeInf αᵒᵈ
  

Proof state:
α✝ : Type u
β : Type v
α : Type u_1
inst✝ : Inf α
inf_comm : ∀ (a b : α), a ⊓ b = b ⊓ a
inf_assoc : ∀ (a b c : α), a ⊓ b ⊓ c = a ⊓ (b ⊓ c)
inf_idem : ∀ (a : α), a ⊓ a = a
this : SemilatticeSup αᵒᵈ
i : SemilatticeInf αᵒᵈᵒᵈ
⊢ SemilatticeInf α

Next tactic:
exact i
/-- The partial orders from `SemilatticeSup_mk'` and `SemilatticeInf_mk'` agree
if `sup` and `inf` satisfy the lattice absorption laws `sup_inf_self` (`a ⊔ a ⊓ b = a`)
and `inf_sup_self` (`a ⊓ (a ⊔ b) = a`). -/
theorem semilatticeSup_mk'_partialOrder_eq_semilatticeInf_mk'_partialOrder
    {α : Type*} [Sup α] [Inf α]
    (sup_comm : ∀ a b : α, a ⊔ b = b ⊔ a) (sup_assoc : ∀ a b c : α, a ⊔ b ⊔ c = a ⊔ (b ⊔ c))
    (sup_idem : ∀ a : α, a ⊔ a = a) (inf_comm : ∀ a b : α, a ⊓ b = b ⊓ a)
    (inf_assoc : ∀ a b c : α, a ⊓ b ⊓ c = a ⊓ (b ⊓ c)) (inf_idem : ∀ a : α, a ⊓ a = a)
    (sup_inf_self : ∀ a b : α, a ⊔ a ⊓ b = a) (inf_sup_self : ∀ a b : α, a ⊓ (a ⊔ b) = a) :
    @SemilatticeSup.toPartialOrder _ (SemilatticeSup.mk' sup_comm sup_assoc sup_idem) =
      @SemilatticeInf.toPartialOrder _ (SemilatticeInf.mk' inf_comm inf_assoc inf_idem) :=
  PartialOrder.ext $ fun a b =>
    show a ⊔ b = b ↔ b ⊓ a = a from
      ⟨fun h => 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)
sup_idem : ∀ (a : α), a ⊔ a = a
inf_comm : ∀ (a b : α), a ⊓ b = b ⊓ a
inf_assoc : ∀ (a b c : α), a ⊓ b ⊓ c = a ⊓ (b ⊓ c)
inf_idem : ∀ (a : α), a ⊓ a = a
sup_inf_self : ∀ (a b : α), a ⊔ a ⊓ b = a
inf_sup_self : ∀ (a b : α), a ⊓ (a ⊔ b) = a
a b : α
h : a ⊔ b = b
⊢ b ⊓ a = a

Next tactic:
rw [← h, inf_comm, inf_sup_self]
/-- The partial orders from `SemilatticeSup_mk'` and `SemilatticeInf_mk'` agree
if `sup` and `inf` satisfy the lattice absorption laws `sup_inf_self` (`a ⊔ a ⊓ b = a`)
and `inf_sup_self` (`a ⊓ (a ⊔ b) = a`). -/
theorem semilatticeSup_mk'_partialOrder_eq_semilatticeInf_mk'_partialOrder
    {α : Type*} [Sup α] [Inf α]
    (sup_comm : ∀ a b : α, a ⊔ b = b ⊔ a) (sup_assoc : ∀ a b c : α, a ⊔ b ⊔ c = a ⊔ (b ⊔ c))
    (sup_idem : ∀ a : α, a ⊔ a = a) (inf_comm : ∀ a b : α, a ⊓ b = b ⊓ a)
    (inf_assoc : ∀ a b c : α, a ⊓ b ⊓ c = a ⊓ (b ⊓ c)) (inf_idem : ∀ a : α, a ⊓ a = a)
    (sup_inf_self : ∀ a b : α, a ⊔ a ⊓ b = a) (inf_sup_self : ∀ a b : α, a ⊓ (a ⊔ b) = a) :
    @SemilatticeSup.toPartialOrder _ (SemilatticeSup.mk' sup_comm sup_assoc sup_idem) =
      @SemilatticeInf.toPartialOrder _ (SemilatticeInf.mk' inf_comm inf_assoc inf_idem) :=
  PartialOrder.ext $ fun a b =>
    show a ⊔ b = b ↔ b ⊓ a = a from
      ⟨fun h => by rw [← h, inf_comm, inf_sup_self], fun h => 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)
sup_idem : ∀ (a : α), a ⊔ a = a
inf_comm : ∀ (a b : α), a ⊓ b = b ⊓ a
inf_assoc : ∀ (a b c : α), a ⊓ b ⊓ c = a ⊓ (b ⊓ c)
inf_idem : ∀ (a : α), a ⊓ a = a
sup_inf_self : ∀ (a b : α), a ⊔ a ⊓ b = a
inf_sup_self : ∀ (a b : α), a ⊓ (a ⊔ b) = a
a b : α
h : b ⊓ a = a
⊢ a ⊔ b = b

Next tactic:
rw [← h, sup_comm, sup_inf_self]
/-- 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 

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
b : α
⊢ b ⊔ b = b ⊔ b ⊓ (b ⊔ b)

Next tactic:
rw [inf_sup_self]
/-- 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 

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
b : α
⊢ b ⊔ b ⊓ (b ⊔ b) = b

Next tactic:
rw [sup_inf_self]
/-- 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 

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
b : α
⊢ b ⊓ b = b ⊓ (b ⊔ b ⊓ b)

Next tactic:
rw [sup_inf_self]
/-- 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 

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
b : α
⊢ b ⊓ (b ⊔ b ⊓ b) = b

Next tactic:
rw [inf_sup_self]