l3lab/ntp-mathlib huggingface dataset:
/-- The **deduction theorem** in the Heyting algebra model of intuitionistic logic:
an implication holds iff the conclusion follows from the hypothesis. -/
@[simp]
theorem himp_eq_top_iff : a ⇨ b = ⊤ ↔ a ≤ b := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a b c d : α
⊢ a ⇨ b = ⊤ ↔ a ≤ b

Next tactic:
rw [← top_le_iff, le_himp_iff, top_inf_eq]
@[simp]
theorem top_himp : ⊤ ⇨ a = a :=
  eq_of_forall_le_iff fun b => by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a b✝ c d b : α
⊢ b ≤ ⊤ ⇨ a ↔ b ≤ a

Next tactic:
rw [le_himp_iff, inf_top_eq]
theorem himp_himp (a b c : α) : a ⇨ b ⇨ c = a ⊓ b ⇨ c :=
  eq_of_forall_le_iff fun d => by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a✝ b✝ c✝ d✝ a b c d : α
⊢ d ≤ a ⇨ b ⇨ c ↔ d ≤ a ⊓ b ⇨ c

Next tactic:
simp_rw [le_himp_iff, inf_assoc]
theorem himp_le_himp_himp_himp : b ⇨ c ≤ (a ⇨ b) ⇨ a ⇨ c := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a b c d : α
⊢ b ⇨ c ≤ (a ⇨ b) ⇨ a ⇨ c

Next tactic:
rw [le_himp_iff, le_himp_iff, inf_assoc, himp_inf_self, ← inf_assoc, himp_inf_self, inf_assoc]
theorem himp_le_himp_himp_himp : b ⇨ c ≤ (a ⇨ b) ⇨ a ⇨ c := by
  rw [le_himp_iff, le_himp_iff, inf_assoc, himp_inf_self, ← inf_assoc, himp_inf_self, inf_assoc]
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a b c d : α
⊢ c ⊓ (b ⊓ a) ≤ c

Next tactic:
exact inf_le_left
@[simp]
theorem himp_inf_himp_inf_le : (b ⇨ c) ⊓ (a ⇨ b) ⊓ a ≤ c := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a b c d : α
⊢ (b ⇨ c) ⊓ (a ⇨ b) ⊓ a ≤ c

Next tactic:
simpa using @himp_le_himp_himp_himp
theorem himp_left_comm (a b c : α) : a ⇨ b ⇨ c = b ⇨ a ⇨ c := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a✝ b✝ c✝ d a b c : α
⊢ a ⇨ b ⇨ c = b ⇨ a ⇨ c

Next tactic:
simp_rw [himp_himp, inf_comm]
@[simp]
theorem himp_idem : b ⇨ b ⇨ a = b ⇨ a := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a b c d : α
⊢ b ⇨ b ⇨ a = b ⇨ a

Next tactic:
rw [himp_himp, inf_idem]
theorem himp_inf_distrib (a b c : α) : a ⇨ b ⊓ c = (a ⇨ b) ⊓ (a ⇨ c) :=
  eq_of_forall_le_iff fun d => by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a✝ b✝ c✝ d✝ a b c d : α
⊢ d ≤ a ⇨ b ⊓ c ↔ d ≤ (a ⇨ b) ⊓ (a ⇨ c)

Next tactic:
simp_rw [le_himp_iff, le_inf_iff, le_himp_iff]
theorem sup_himp_distrib (a b c : α) : a ⊔ b ⇨ c = (a ⇨ c) ⊓ (b ⇨ c) :=
  eq_of_forall_le_iff fun d => by
    

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a✝ b✝ c✝ d✝ a b c d : α
⊢ d ≤ a ⊔ b ⇨ c ↔ d ≤ (a ⇨ c) ⊓ (b ⇨ c)

Next tactic:
rw [le_inf_iff, le_himp_comm, sup_le_iff]
theorem sup_himp_distrib (a b c : α) : a ⊔ b ⇨ c = (a ⇨ c) ⊓ (b ⇨ c) :=
  eq_of_forall_le_iff fun d => by
    rw [le_inf_iff, le_himp_comm, sup_le_iff]
    

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a✝ b✝ c✝ d✝ a b c d : α
⊢ a ≤ d ⇨ c ∧ b ≤ d ⇨ c ↔ d ≤ a ⇨ c ∧ d ≤ b ⇨ c

Next tactic:
simp_rw [le_himp_comm]
@[simp]
theorem sup_himp_self_left (a b : α) : a ⊔ b ⇨ a = b ⇨ a := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a✝ b✝ c d a b : α
⊢ a ⊔ b ⇨ a = b ⇨ a

Next tactic:
rw [sup_himp_distrib, himp_self, top_inf_eq]
@[simp]
theorem sup_himp_self_right (a b : α) : a ⊔ b ⇨ b = a ⇨ b := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a✝ b✝ c d a b : α
⊢ a ⊔ b ⇨ b = a ⇨ b

Next tactic:
rw [sup_himp_distrib, himp_self, inf_top_eq]
theorem Codisjoint.himp_eq_right (h : Codisjoint a b) : b ⇨ a = a := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a b c d : α
h : Codisjoint a b
⊢ b ⇨ a = a

Next tactic:
conv_rhs => rw [← @top_himp _ _ a]
theorem Codisjoint.himp_eq_right (h : Codisjoint a b) : b ⇨ a = a := by
  conv_rhs => 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a b c d : α
h : Codisjoint a b
| a

Next tactic:
rw [← @top_himp _ _ a]
theorem Codisjoint.himp_eq_right (h : Codisjoint a b) : b ⇨ a = a := by
  conv_rhs => rw [← @top_himp _ _ a]
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a b c d : α
h : Codisjoint a b
⊢ b ⇨ a = ⊤ ⇨ a

Next tactic:
rw [← h.eq_top, sup_himp_self_left]
theorem Codisjoint.himp_inf_cancel_right (h : Codisjoint a b) : a ⇨ a ⊓ b = b := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a b c d : α
h : Codisjoint a b
⊢ a ⇨ a ⊓ b = b

Next tactic:
rw [himp_inf_distrib, himp_self, top_inf_eq, h.himp_eq_left]
theorem Codisjoint.himp_inf_cancel_left (h : Codisjoint a b) : b ⇨ a ⊓ b = a := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a b c d : α
h : Codisjoint a b
⊢ b ⇨ a ⊓ b = a

Next tactic:
rw [himp_inf_distrib, himp_self, inf_top_eq, h.himp_eq_right]
theorem himp_triangle (a b c : α) : (a ⇨ b) ⊓ (b ⇨ c) ≤ a ⇨ c := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a✝ b✝ c✝ d a b c : α
⊢ (a ⇨ b) ⊓ (b ⇨ c) ≤ a ⇨ c

Next tactic:
rw [le_himp_iff, inf_right_comm, ← le_himp_iff]
theorem himp_triangle (a b c : α) : (a ⇨ b) ⊓ (b ⇨ c) ≤ a ⇨ c := by
  rw [le_himp_iff, inf_right_comm, ← le_himp_iff]
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a✝ b✝ c✝ d a b c : α
⊢ (a ⇨ b) ⊓ a ≤ (b ⇨ c) ⇨ c

Next tactic:
exact himp_inf_le.trans le_himp_himp
instance (priority := 100) GeneralizedHeytingAlgebra.toDistribLattice : DistribLattice α :=
  DistribLattice.ofInfSupLe fun a b c => by
    

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a✝ b✝ c✝ d a b c : α
⊢ a ⊓ (b ⊔ c) ≤ a ⊓ b ⊔ a ⊓ c

Next tactic:
simp_rw [@inf_comm _ _ a, ← le_himp_iff, sup_le_iff, le_himp_iff, ← sup_le_iff]
instance (priority := 100) GeneralizedHeytingAlgebra.toDistribLattice : DistribLattice α :=
  DistribLattice.ofInfSupLe fun a b c => by
    simp_rw [@inf_comm _ _ a, ← le_himp_iff, sup_le_iff, le_himp_iff, ← sup_le_iff]; 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a✝ b✝ c✝ d a b c : α
⊢ b ⊓ a ⊔ c ⊓ a ≤ b ⊓ a ⊔ c ⊓ a

Next tactic:
rfl
instance : GeneralizedCoheytingAlgebra αᵒᵈ :=
  { OrderDual.lattice α, OrderDual.orderBot α with
    sdiff := fun a b => toDual (ofDual b ⇨ ofDual a),
    sdiff_le_iff := fun a b c => by
      

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a✝ b✝ c✝ d : α
src✝¹ : Lattice αᵒᵈ := lattice α
src✝ : OrderBot αᵒᵈ := orderBot α
a b c : αᵒᵈ
⊢ a \ b ≤ c ↔ a ≤ b ⊔ c

Next tactic:
rw [sup_comm]
instance : GeneralizedCoheytingAlgebra αᵒᵈ :=
  { OrderDual.lattice α, OrderDual.orderBot α with
    sdiff := fun a b => toDual (ofDual b ⇨ ofDual a),
    sdiff_le_iff := fun a b c => by
      rw [sup_comm]
      

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedHeytingAlgebra α
a✝ b✝ c✝ d : α
src✝¹ : Lattice αᵒᵈ := lattice α
src✝ : OrderBot αᵒᵈ := orderBot α
a b c : αᵒᵈ
⊢ a \ b ≤ c ↔ a ≤ c ⊔ b

Next tactic:
exact le_himp_iff
instance Pi.generalizedHeytingAlgebra {α : ι → Type*} [∀ i, GeneralizedHeytingAlgebra (α i)] :
    GeneralizedHeytingAlgebra (∀ i, α i) :=
  { Pi.lattice, Pi.orderTop with
    le_himp_iff := fun i => by 

Proof state:
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : GeneralizedHeytingAlgebra α✝
a b c d : α✝
α : ι → Type u_4
inst✝ : (i : ι) → GeneralizedHeytingAlgebra (α i)
src✝¹ : Lattice ((i : ι) → α i) := lattice
src✝ : OrderTop ((i : ι) → α i) := orderTop
i : (i : ι) → α i
⊢ ∀ (b c : (i : ι) → α i), i ≤ b ⇨ c ↔ i ⊓ b ≤ c

Next tactic:
simp [le_def]
theorem sdiff_le_iff' : a \ b ≤ c ↔ a ≤ c ⊔ b := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
⊢ a \ b ≤ c ↔ a ≤ c ⊔ b

Next tactic:
rw [sdiff_le_iff, sup_comm]
theorem sdiff_le_comm : a \ b ≤ c ↔ a \ c ≤ b := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
⊢ a \ b ≤ c ↔ a \ c ≤ b

Next tactic:
rw [sdiff_le_iff, sdiff_le_iff']
theorem sdiff_le_iff_left : a \ b ≤ b ↔ a ≤ b := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
⊢ a \ b ≤ b ↔ a ≤ b

Next tactic:
rw [sdiff_le_iff, sup_idem]
theorem le_sdiff_sup : a ≤ a \ b ⊔ b := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
⊢ a ≤ a \ b ⊔ b

Next tactic:
rw [sup_comm, ← sdiff_le_iff]
@[simp]
theorem sdiff_sup_self (a b : α) : b \ a ⊔ a = b ⊔ a := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a✝ b✝ c d a b : α
⊢ b \ a ⊔ a = b ⊔ a

Next tactic:
rw [sup_comm, sup_sdiff_self, sup_comm]
theorem sup_sdiff_cancel' (hab : a ≤ b) (hbc : b ≤ c) : b ⊔ c \ a = c := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
hab : a ≤ b
hbc : b ≤ c
⊢ b ⊔ c \ a = c

Next tactic:
rw [sup_sdiff_eq_sup hab, sup_of_le_right hbc]
theorem sdiff_sup_cancel (h : b ≤ a) : a \ b ⊔ b = a := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
h : b ≤ a
⊢ a \ b ⊔ b = a

Next tactic:
rw [sup_comm, sup_sdiff_cancel_right h]
@[simp]
theorem sdiff_eq_bot_iff : a \ b = ⊥ ↔ a ≤ b := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
⊢ a \ b = ⊥ ↔ a ≤ b

Next tactic:
rw [← le_bot_iff, sdiff_le_iff, sup_bot_eq]
@[simp]
theorem sdiff_bot : a \ ⊥ = a :=
  eq_of_forall_ge_iff fun b => by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b✝ c d b : α
⊢ a \ ⊥ ≤ b ↔ a ≤ b

Next tactic:
rw [sdiff_le_iff, bot_sup_eq]
theorem sdiff_sdiff_sdiff_le_sdiff : (a \ b) \ (a \ c) ≤ c \ b := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
⊢ (a \ b) \ (a \ c) ≤ c \ b

Next tactic:
rw [sdiff_le_iff, sdiff_le_iff, sup_left_comm, sup_sdiff_self, sup_left_comm, sdiff_sup_self,
    sup_left_comm]
theorem sdiff_sdiff_sdiff_le_sdiff : (a \ b) \ (a \ c) ≤ c \ b := by
  rw [sdiff_le_iff, sdiff_le_iff, sup_left_comm, sup_sdiff_self, sup_left_comm, sdiff_sup_self,
    sup_left_comm]
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
⊢ a ≤ a ⊔ (b ⊔ c)

Next tactic:
exact le_sup_left
@[simp]
theorem le_sup_sdiff_sup_sdiff : a ≤ b ⊔ (a \ c ⊔ c \ b) := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
⊢ a ≤ b ⊔ (a \ c ⊔ c \ b)

Next tactic:
simpa using @sdiff_sdiff_sdiff_le_sdiff
theorem sdiff_sdiff (a b c : α) : (a \ b) \ c = a \ (b ⊔ c) :=
  eq_of_forall_ge_iff fun d => by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a✝ b✝ c✝ d✝ a b c d : α
⊢ (a \ b) \ c ≤ d ↔ a \ (b ⊔ c) ≤ d

Next tactic:
simp_rw [sdiff_le_iff, sup_assoc]
theorem sdiff_right_comm (a b c : α) : (a \ b) \ c = (a \ c) \ b := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a✝ b✝ c✝ d a b c : α
⊢ (a \ b) \ c = (a \ c) \ b

Next tactic:
simp_rw [sdiff_sdiff, sup_comm]
@[simp]
theorem sdiff_idem : (a \ b) \ b = a \ b := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
⊢ (a \ b) \ b = a \ b

Next tactic:
rw [sdiff_sdiff_left, sup_idem]
@[simp]
theorem sdiff_sdiff_self : (a \ b) \ a = ⊥ := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
⊢ (a \ b) \ a = ⊥

Next tactic:
rw [sdiff_sdiff_comm, sdiff_self, bot_sdiff]
theorem sup_sdiff_distrib (a b c : α) : (a ⊔ b) \ c = a \ c ⊔ b \ c :=
  eq_of_forall_ge_iff fun d => by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a✝ b✝ c✝ d✝ a b c d : α
⊢ (a ⊔ b) \ c ≤ d ↔ a \ c ⊔ b \ c ≤ d

Next tactic:
simp_rw [sdiff_le_iff, sup_le_iff, sdiff_le_iff]
theorem sdiff_inf_distrib (a b c : α) : a \ (b ⊓ c) = a \ b ⊔ a \ c :=
  eq_of_forall_ge_iff fun d => by
    

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a✝ b✝ c✝ d✝ a b c d : α
⊢ a \ (b ⊓ c) ≤ d ↔ a \ b ⊔ a \ c ≤ d

Next tactic:
rw [sup_le_iff, sdiff_le_comm, le_inf_iff]
theorem sdiff_inf_distrib (a b c : α) : a \ (b ⊓ c) = a \ b ⊔ a \ c :=
  eq_of_forall_ge_iff fun d => by
    rw [sup_le_iff, sdiff_le_comm, le_inf_iff]
    

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a✝ b✝ c✝ d✝ a b c d : α
⊢ a \ d ≤ b ∧ a \ d ≤ c ↔ a \ b ≤ d ∧ a \ c ≤ d

Next tactic:
simp_rw [sdiff_le_comm]
@[simp]
theorem sup_sdiff_right_self : (a ⊔ b) \ b = a \ b := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
⊢ (a ⊔ b) \ b = a \ b

Next tactic:
rw [sup_sdiff, sdiff_self, sup_bot_eq]
@[simp]
theorem sup_sdiff_left_self : (a ⊔ b) \ a = b \ a := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
⊢ (a ⊔ b) \ a = b \ a

Next tactic:
rw [sup_comm, sup_sdiff_right_self]
@[simp]
theorem sdiff_inf_self_left (a b : α) : a \ (a ⊓ b) = a \ b := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a✝ b✝ c d a b : α
⊢ a \ (a ⊓ b) = a \ b

Next tactic:
rw [sdiff_inf, sdiff_self, bot_sup_eq]
@[simp]
theorem sdiff_inf_self_right (a b : α) : b \ (a ⊓ b) = b \ a := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a✝ b✝ c d a b : α
⊢ b \ (a ⊓ b) = b \ a

Next tactic:
rw [sdiff_inf, sdiff_self, sup_bot_eq]
theorem Disjoint.sdiff_eq_left (h : Disjoint a b) : a \ b = a := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
h : Disjoint a b
⊢ a \ b = a

Next tactic:
conv_rhs => rw [← @sdiff_bot _ _ a]
theorem Disjoint.sdiff_eq_left (h : Disjoint a b) : a \ b = a := by
  conv_rhs => 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
h : Disjoint a b
| a

Next tactic:
rw [← @sdiff_bot _ _ a]
theorem Disjoint.sdiff_eq_left (h : Disjoint a b) : a \ b = a := by
  conv_rhs => rw [← @sdiff_bot _ _ a]
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
h : Disjoint a b
⊢ a \ b = a \ ⊥

Next tactic:
rw [← h.eq_bot, sdiff_inf_self_left]
theorem Disjoint.sup_sdiff_cancel_left (h : Disjoint a b) : (a ⊔ b) \ a = b := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
h : Disjoint a b
⊢ (a ⊔ b) \ a = b

Next tactic:
rw [sup_sdiff, sdiff_self, bot_sup_eq, h.sdiff_eq_right]
theorem Disjoint.sup_sdiff_cancel_right (h : Disjoint a b) : (a ⊔ b) \ b = a := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
h : Disjoint a b
⊢ (a ⊔ b) \ b = a

Next tactic:
rw [sup_sdiff, sdiff_self, sup_bot_eq, h.sdiff_eq_left]
theorem sdiff_triangle (a b c : α) : a \ c ≤ a \ b ⊔ b \ c := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a✝ b✝ c✝ d a b c : α
⊢ a \ c ≤ a \ b ⊔ b \ c

Next tactic:
rw [sdiff_le_iff, sup_left_comm, ← sdiff_le_iff]
theorem sdiff_triangle (a b c : α) : a \ c ≤ a \ b ⊔ b \ c := by
  rw [sdiff_le_iff, sup_left_comm, ← sdiff_le_iff]
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a✝ b✝ c✝ d a b c : α
⊢ a \ (a \ b) ≤ c ⊔ b \ c

Next tactic:
exact sdiff_sdiff_le.trans le_sup_sdiff
theorem sdiff_le_sdiff_of_sup_le_sup_left (h : c ⊔ a ≤ c ⊔ b) : a \ c ≤ b \ c := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
h : c ⊔ a ≤ c ⊔ b
⊢ a \ c ≤ b \ c

Next tactic:
rw [← sup_sdiff_left_self, ← @sup_sdiff_left_self _ _ _ b]
theorem sdiff_le_sdiff_of_sup_le_sup_left (h : c ⊔ a ≤ c ⊔ b) : a \ c ≤ b \ c := by
  rw [← sup_sdiff_left_self, ← @sup_sdiff_left_self _ _ _ b]
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
h : c ⊔ a ≤ c ⊔ b
⊢ (c ⊔ a) \ c ≤ (c ⊔ b) \ c

Next tactic:
exact sdiff_le_sdiff_right h
theorem sdiff_le_sdiff_of_sup_le_sup_right (h : a ⊔ c ≤ b ⊔ c) : a \ c ≤ b \ c := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
h : a ⊔ c ≤ b ⊔ c
⊢ a \ c ≤ b \ c

Next tactic:
rw [← sup_sdiff_right_self, ← @sup_sdiff_right_self _ _ b]
theorem sdiff_le_sdiff_of_sup_le_sup_right (h : a ⊔ c ≤ b ⊔ c) : a \ c ≤ b \ c := by
  rw [← sup_sdiff_right_self, ← @sup_sdiff_right_self _ _ b]
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a b c d : α
h : a ⊔ c ≤ b ⊔ c
⊢ (a ⊔ c) \ c ≤ (b ⊔ c) \ c

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

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a✝ b✝ c✝ d : α
src✝ : GeneralizedCoheytingAlgebra α := inst✝
a b c : α
⊢ (a ⊔ b) ⊓ (a ⊔ c) ≤ a ⊔ b ⊓ c

Next tactic:
simp_rw [← sdiff_le_iff, le_inf_iff, sdiff_le_iff, ← le_inf_iff]
instance (priority := 100) GeneralizedCoheytingAlgebra.toDistribLattice : DistribLattice α :=
  { ‹GeneralizedCoheytingAlgebra α› with
    le_sup_inf :=
      fun a b c => by simp_rw [← sdiff_le_iff, le_inf_iff, sdiff_le_iff, ← le_inf_iff]; 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a✝ b✝ c✝ d : α
src✝ : GeneralizedCoheytingAlgebra α := inst✝
a b c : α
⊢ (a ⊔ b) ⊓ (a ⊔ c) ≤ (a ⊔ b) ⊓ (a ⊔ c)

Next tactic:
rfl
instance : GeneralizedHeytingAlgebra αᵒᵈ :=
  { OrderDual.lattice α, OrderDual.orderTop α with
    himp := fun a b => toDual (ofDual b \ ofDual a),
    le_himp_iff := fun a b c => by
      

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a✝ b✝ c✝ d : α
src✝¹ : Lattice αᵒᵈ := lattice α
src✝ : OrderTop αᵒᵈ := orderTop α
a b c : αᵒᵈ
⊢ a ≤ b ⇨ c ↔ a ⊓ b ≤ c

Next tactic:
rw [inf_comm]
instance : GeneralizedHeytingAlgebra αᵒᵈ :=
  { OrderDual.lattice α, OrderDual.orderTop α with
    himp := fun a b => toDual (ofDual b \ ofDual a),
    le_himp_iff := fun a b c => by
      rw [inf_comm]
      

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : GeneralizedCoheytingAlgebra α
a✝ b✝ c✝ d : α
src✝¹ : Lattice αᵒᵈ := lattice α
src✝ : OrderTop αᵒᵈ := orderTop α
a b c : αᵒᵈ
⊢ a ≤ b ⇨ c ↔ b ⊓ a ≤ c

Next tactic:
exact sdiff_le_iff
instance Pi.generalizedCoheytingAlgebra {α : ι → Type*} [∀ i, GeneralizedCoheytingAlgebra (α i)] :
    GeneralizedCoheytingAlgebra (∀ i, α i) :=
  { Pi.lattice, Pi.orderBot with
    sdiff_le_iff := fun i => by 

Proof state:
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : GeneralizedCoheytingAlgebra α✝
a b c d : α✝
α : ι → Type u_4
inst✝ : (i : ι) → GeneralizedCoheytingAlgebra (α i)
src✝¹ : Lattice ((i : ι) → α i) := lattice
src✝ : OrderBot ((i : ι) → α i) := orderBot
i : (i : ι) → α i
⊢ ∀ (b c : (i : ι) → α i), i \ b ≤ c ↔ i ≤ b ⊔ c

Next tactic:
simp [le_def]
theorem compl_sup_distrib (a b : α) : (a ⊔ b)ᶜ = aᶜ ⊓ bᶜ := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : HeytingAlgebra α
a✝ b✝ c a b : α
⊢ (a ⊔ b)ᶜ = aᶜ ⊓ bᶜ

Next tactic:
simp_rw [← himp_bot, sup_himp_distrib]
@[simp]
theorem himp_compl (a : α) : a ⇨ aᶜ = aᶜ := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : HeytingAlgebra α
a✝ b c a : α
⊢ a ⇨ aᶜ = aᶜ

Next tactic:
rw [← himp_bot, himp_himp, inf_idem]
theorem himp_compl_comm (a b : α) : a ⇨ bᶜ = b ⇨ aᶜ := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : HeytingAlgebra α
a✝ b✝ c a b : α
⊢ a ⇨ bᶜ = b ⇨ aᶜ

Next tactic:
simp_rw [← himp_bot, himp_left_comm]
theorem le_compl_iff_disjoint_right : a ≤ bᶜ ↔ Disjoint a b := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : HeytingAlgebra α
a b c : α
⊢ a ≤ bᶜ ↔ Disjoint a b

Next tactic:
rw [← himp_bot, le_himp_iff, disjoint_iff_inf_le]
theorem le_compl_comm : a ≤ bᶜ ↔ b ≤ aᶜ := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : HeytingAlgebra α
a b c : α
⊢ a ≤ bᶜ ↔ b ≤ aᶜ

Next tactic:
rw [le_compl_iff_disjoint_right, le_compl_iff_disjoint_left]
@[simp]
theorem compl_top : (⊤ : α)ᶜ = ⊥ :=
  eq_of_forall_le_iff fun a => by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : HeytingAlgebra α
a✝ b c a : α
⊢ a ≤ ⊤ᶜ ↔ a ≤ ⊥

Next tactic:
rw [le_compl_iff_disjoint_right, disjoint_top, le_bot_iff]
@[simp]
theorem compl_bot : (⊥ : α)ᶜ = ⊤ := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : HeytingAlgebra α
a b c : α
⊢ ⊥ᶜ = ⊤

Next tactic:
rw [← himp_bot, himp_self]
@[simp] theorem le_compl_self : a ≤ aᶜ ↔ a = ⊥ := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : HeytingAlgebra α
a b c : α
⊢ a ≤ aᶜ ↔ a = ⊥

Next tactic:
rw [le_compl_iff_disjoint_left, disjoint_self]
@[simp] theorem ne_compl_self [Nontrivial α] : a ≠ aᶜ := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : HeytingAlgebra α
a b c : α
inst✝ : Nontrivial α
⊢ a ≠ aᶜ

Next tactic:
intro h
@[simp] theorem ne_compl_self [Nontrivial α] : a ≠ aᶜ := by
  intro h
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : HeytingAlgebra α
a b c : α
inst✝ : Nontrivial α
h : a = aᶜ
⊢ False

Next tactic:
cases le_compl_self.1 (le_of_eq h)
@[simp] theorem ne_compl_self [Nontrivial α] : a ≠ aᶜ := by
  intro h
  cases le_compl_self.1 (le_of_eq h)
  

Proof state:
case refl
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : HeytingAlgebra α
b c : α
inst✝ : Nontrivial α
h : ⊥ = ⊥ᶜ
⊢ False

Next tactic:
simp at h
@[simp] theorem lt_compl_self [Nontrivial α] : a < aᶜ ↔ a = ⊥ := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : HeytingAlgebra α
a b c : α
inst✝ : Nontrivial α
⊢ a < aᶜ ↔ a = ⊥

Next tactic:
rw [lt_iff_le_and_ne]
@[simp] theorem lt_compl_self [Nontrivial α] : a < aᶜ ↔ a = ⊥ := by
  rw [lt_iff_le_and_ne]; 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : HeytingAlgebra α
a b c : α
inst✝ : Nontrivial α
⊢ a ≤ aᶜ ∧ a ≠ aᶜ ↔ a = ⊥

Next tactic:
simp
@[simp]
theorem disjoint_compl_compl_left_iff : Disjoint aᶜᶜ b ↔ Disjoint a b := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : HeytingAlgebra α
a b c : α
⊢ Disjoint aᶜᶜ b ↔ Disjoint a b

Next tactic:
simp_rw [← le_compl_iff_disjoint_left, compl_compl_compl]
@[simp]
theorem disjoint_compl_compl_right_iff : Disjoint a bᶜᶜ ↔ Disjoint a b := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : HeytingAlgebra α
a b c : α
⊢ Disjoint a bᶜᶜ ↔ Disjoint a b

Next tactic:
simp_rw [← le_compl_iff_disjoint_right, compl_compl_compl]
theorem compl_compl_inf_distrib (a b : α) : (a ⊓ b)ᶜᶜ = aᶜᶜ ⊓ bᶜᶜ := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : HeytingAlgebra α
a✝ b✝ c a b : α
⊢ (a ⊓ b)ᶜᶜ = aᶜᶜ ⊓ bᶜᶜ

Next tactic:
refine' ((compl_anti compl_sup_compl_le).trans (compl_sup_distrib _ _).le).antisymm _
theorem compl_compl_inf_distrib (a b : α) : (a ⊓ b)ᶜᶜ = aᶜᶜ ⊓ bᶜᶜ := by
  refine' ((compl_anti compl_sup_compl_le).trans (compl_sup_distrib _ _).le).antisymm _
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : HeytingAlgebra α
a✝ b✝ c a b : α
⊢ aᶜᶜ ⊓ bᶜᶜ ≤ (a ⊓ b)ᶜᶜ

Next tactic:
rw [le_compl_iff_disjoint_right, disjoint_assoc, disjoint_compl_compl_left_iff,
    disjoint_left_comm, disjoint_compl_compl_left_iff, ← disjoint_assoc, inf_comm]
theorem compl_compl_inf_distrib (a b : α) : (a ⊓ b)ᶜᶜ = aᶜᶜ ⊓ bᶜᶜ := by
  refine' ((compl_anti compl_sup_compl_le).trans (compl_sup_distrib _ _).le).antisymm _
  rw [le_compl_iff_disjoint_right, disjoint_assoc, disjoint_compl_compl_left_iff,
    disjoint_left_comm, disjoint_compl_compl_left_iff, ← disjoint_assoc, inf_comm]
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : HeytingAlgebra α
a✝ b✝ c a b : α
⊢ Disjoint (a ⊓ b) (a ⊓ b)ᶜ

Next tactic:
exact disjoint_compl_right