definition example theorem

A Heyting algebra is a poset with finite meets , finite joins , top , bottom , and an implication characterized by

i.e. is a Galois Connection. Negation is . A Heyting algebra is exactly a thin Bicartesian Closed Category; it is a Boolean algebra when moreover (equivalently ).

Sources: 7 Sketches §7.4.3 (“the poset of predicates on forms what’s called a Heyting algebra”), §7.4.2, Exercises 7.11, 7.59, 7.60, Remark 7.33; DaoFP §6 (bicartesian closed categories).

Docs: C-set morphisms · Graphs · Vignette: subgraphs

using Catlab
# Sub(G) of a C-set is a Heyting algebra: meet, join, top, bottom, implies, negate
G = cycle_graph(Graph, 4)
A = Subobject(G, V=[1, 2], E=[1]); B = Subobject(G, V=[2, 3], E=[2])
sh(s) = (c = components(s); (collect(c[:V]), collect(c[:E])))
sh(implies(A, B))                         # ([2, 3, 4], [2, 3]): the largest r with r ∧ A ≤ B
sh(implies(A, B) ∧ A)                     # ([2], []) ⊆ B
sh(top(G)), sh(bottom(G))
import Mathlib
#check @HeytingAlgebra                    -- class with ⇨ (himp) and ᶜ
#check @le_himp_iff                       -- a ≤ b ⇨ c ↔ a ⊓ b ≤ c
#check @HeytingAlgebra.toBooleanAlgebra   -- not a thing: Boolean needs a ⊔ aᶜ = ⊤
example (X : Type) [TopologicalSpace X] : HeytingAlgebra (TopologicalSpace.Opens X) := inferInstance
class Heyting h where
  top, bot :: h
  (/\), (\/), (==>) :: h -> h -> h
neg :: Heyting h => h -> h
neg p = p ==> bot
instance Heyting Bool where
  top = True; bot = False
  (/\) = (&&); (\/) = (||); p ==> q = not p || q