{"id":22258107,"url":"https://github.com/coot/heyting-algebras","last_synced_at":"2025-07-28T07:32:08.255Z","repository":{"id":53505559,"uuid":"151000431","full_name":"coot/heyting-algebras","owner":"coot","description":"Heyting Algebras in Haskell","archived":false,"fork":false,"pushed_at":"2022-12-15T13:15:51.000Z","size":122,"stargazers_count":13,"open_issues_count":3,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-03-30T05:11:33.442Z","etag":null,"topics":["haskell-library","logic"],"latest_commit_sha":null,"homepage":"https://hackage.haskell.org/package/heyting-algebras","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coot.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-30T19:43:35.000Z","updated_at":"2023-03-29T11:35:15.000Z","dependencies_parsed_at":"2023-01-29T03:16:24.827Z","dependency_job_id":null,"html_url":"https://github.com/coot/heyting-algebras","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coot%2Fheyting-algebras","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coot%2Fheyting-algebras/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coot%2Fheyting-algebras/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coot%2Fheyting-algebras/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coot","download_url":"https://codeload.github.com/coot/heyting-algebras/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227877782,"owners_count":17833559,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["haskell-library","logic"],"created_at":"2024-12-03T08:13:30.285Z","updated_at":"2024-12-03T08:13:30.909Z","avatar_url":"https://github.com/coot.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Heyting Algebras\n[![Maintainer: coot](https://img.shields.io/badge/maintainer-coot-lightgrey.svg)](http://github.com/coot)\n[![POSIX](https://github.com/coot/heyting-algebras/actions/workflows/posix.yml/badge.svg)](https://github.com/coot/heyting-algebras/actions/workflows/posix.yml)\n\n\nThis package now extends\n[lattices](https://hackage.haskell.org/package/lattices) by providing more\nHeyting algebras.  The package also defines a type class for Boolean algebras\nand comes with many useful instances.\n\nA note about notation: this package is based on\n[lattices](https://hackage.haskell.org/package/lattices), and both are using\nnotation and names common in lattice theory and logic.  Where `\u0026\u0026` becomes `∧`\nand is called `meet` and `||` is denoted by `∨` and is usually called\n`join`.  The `lattice` package provides `\\/` and `/\\` operators as well as type\nclasses for various flavors of posets and lattices.\n\nA very good introduction to Heyting algebras can be found at\n[ncatlab](https://ncatlab.org/nlab/show/Heyting%2Balgebra).  Heyting algebras\nare the crux of [intuitionistic\nlogic](https://en.wikipedia.org/wiki/Intuitionistic_logic), which drops the\naxiom of excluded middle.  From categorical point of view, Heyting algebras are\nposets (categories with at most one arrow between any objects), which are also\nCartesian closed (and finitely (co-)complete).  Note that this makes any\nHeyting algebra a simply typed lambda calculus; hence one more incentive to\nlearn about them.  For example currying holds in every Heyting algebra:\n`a =\u003e (b ⇒ c)` is equal to `(a ∧ b) ⇒ c`\n\nThe most important operation is implication `(==\u003e) :: HeytingAlgebra a =\u003e a -\u003e\na -\u003e a` (which we might also write as ⇒ in documentation).  Every Boolean\nalgebra is a Heyting algebra via `a ==\u003e b = not a \\/ b` (using the lattice\nnotation for `or`).  It is very handy in expression conditional logic.\n\nSome examples of Heyting algebras:\n* `Bool` is a Boolean algebra\n* `(Ord a, Bounded a) =\u003e a`; the implication is defined as: if `a ≤ b` then `a\n  ⇒ b = maxBound`, otherwise `a ⇒ b = b`; e.g. integers with both `±∞` (it can\n  be represented by `Levitated Int`.  Note that it is not a Boolean algebra.\n* The power set is a Boolean algebra, in Haskell it can be represented by `Set\n  a` (one might need to require `a` to be finite though, otherwise `not (not\n  empty)` might be `undefined` rather than `empty`).  It is a well known fact\n  that every Boolean algebra is isomorphic to a power set.\n* ```haskell\n    type CounterExample a = Lifted (Op (Set a))\n  ```\n  is a Heyting algebra; it is useful for gathering counter examples in\n  a similar way that `Property` from `QuickCheck` library does (put pure).\n  This library provides some useful functions for this type, see the\n  `Algebra.Heyting.Properties` and tests for example usage.\n* More generally every type `(Ord k, Finite k, HeytingAlgebra v) =\u003e Map k a` is\n  a Heyting algebra (though in general not a Boolean one).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoot%2Fheyting-algebras","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoot%2Fheyting-algebras","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoot%2Fheyting-algebras/lists"}