Logged in as ProofsArePrograms Profile Settings Logout

The Curry-Howard Correspondence Appreciation Thread ๐Ÿซถ

Started by ProofsArePrograms ๐Ÿ“… March 3, 2026 ยท 04:12 AM ๐Ÿ’ฌ 79 replies ๐Ÿ‘ 1,247 views PINNED ๐Ÿซถ Appreciation Type Theory Proofs-as-Programs

๐Ÿ“Š THREAD POLL

"Which isomorphism axis do you find most beautiful?"

42% โ€” 33 votes
28% โ€” 22 votes
22% โ€” 17 votes
8% โ€” 6 votes
Total votes: 78 ยท Thread participants only ยท Poll closes: March 17, 2026
+ Reply
๐Ÿˆ
ProofsArePrograms
Dependent Type Devotee
Posts: 2,341
Joined: Oct 2022
Rep: โ˜…โ˜…โ˜…โ˜…โ˜†
๐ŸŽ– Type Theorist
#1 โ€” OP

ok so I know we have a million threads about dependent types and Agda and whatever but I just want a space where we can all sit together and appreciate how absolutely unhinged and beautiful the Curry-Howard correspondence is. no pressure, no homework, just vibes and proofs-as-programs ๐Ÿซถ

for those just stumbling in: the Curry-Howard correspondence is the observation that there is a direct structural isomorphism between proof systems and models of computation. the core insight, stated simply:

propositions โ‰… types   |   proofs โ‰… programs   |   proof normalization โ‰… computation

like. that's it. logic is programming. programming is logic. the universe decided these two completely independently-discovered things were secretly the same object and i think about it every day.

the full correspondence table (my personal favourite cheat-sheet):

Logicฮป-calculus / TypesCategory Theory
Proposition AType AObject A
Proof of ATerm of type AMorphism 1 โ†’ A
Implication A โŠƒ BFunction type A โ†’ BExponential Bแดฌ
Conjunction A โˆง BProduct type A ร— BCartesian product A ร— B
Disjunction A โˆจ BSum type A + BCoproduct A + B
True (โŠค)Unit type ()Terminal object 1
False (โŠฅ)Empty type โŠฅInitial object 0
โˆ€x. P(x)Dependent product ฮ Right adjoint functor
โˆƒx. P(x)Dependent sum ฮฃLeft adjoint functor
Proof reductionฮฒ-reductionMorphism composition

drop your favourite examples, connections, quotes, code snippets โ€” anything you love about this correspondence. let's make this thread a forever-reference for people discovering it for the first time ๐ŸŒธ

๐Ÿฑ
LambdaCatgirl
ฮป-Calculus Enthusiast
Posts: 1,872
Joined: Feb 2023
Rep: โ˜…โ˜…โ˜…โ˜…โ˜†
๐ŸŽ– Lambda Luminary
#2

YESSS this thread was so needed. ok my favourite elementary example: the identity function as the proof of A โŠƒ A. in Haskell:

-- The proposition:  A implies A
-- The program:      identity function
identity :: a -> a
identity x = x

-- Conjunction intro: if you have A and B, you have A โˆง B
-- The program:       tuple construction
conj_intro :: a -> b -> (a, b)
conj_intro x y = (x, y)

-- Modus ponens: from (A โ†’ B) and A, derive B
-- The program:  function application!
modus_ponens :: (a -> b) -> a -> b
modus_ponens f x = f x  -- this is just ($) lol

the fact that function application IS modus ponens never gets old to me. every time you write f x in Haskell you're performing a logical inference step. you've been doing formal logic this whole time!!! ๐Ÿคฏ

๐ŸŸ
WadlerCatFan
Theorems for Free Stan
Posts: 998
Joined: Jun 2023
Rep: โ˜…โ˜…โ˜…โ˜†โ˜†
๐Ÿ“œ Logic Nerd
#3

obligatory Wadler quote drop (he wrote a legendary paper on this):

Philip Wadler โ€” "Propositions as Types" (2015)
"The principle now known as propositions as types, and its discovery is one of the great serendipities of all time..."

also i want to highlight something OP's table hints at but doesn't spell out: the three-way extension. Lambek showed in the early 1970s that this isn't just logic โ†” types โ€” it extends to cartesian closed categories. so we have a genuine trinity:

Intuitionistic Logic   โ†”   Typed ฮป-Calculus   โ†”   Cartesian Closed Categories

this is sometimes called "computational trinitarianism" ๐Ÿ™ the three perspectives illuminate each other โ€” a categorical construction tells you something about types, which tells you something about proofs, which tells you something about categories, round and round forever ๐ŸŒ€

voted "Categories โ†” Logic" in the poll obv

๐Ÿธ
MewMewMonad
Monad Transformer Meow
Posts: 3,109
Joined: Aug 2021
Rep: โ˜…โ˜…โ˜…โ˜…โ˜…
๐ŸŽ– Senior Catgirl Dev
#4

i have a lot of feelings about this. let me dump some of my favourite "oh wait it's all the same" moments:

1. Absurdity elimination = Empty pattern match

in logic, from โŠฅ (False) you can derive anything (ex falso quodlibet). in Haskell, the empty type Void lets you write:

import Data.Void

-- "From False, derive anything"
-- absurd :: Void -> a
absurd :: Void -> a
absurd x = case x of {}  -- no cases! because Void has no inhabitants

2. Curry-Howard for classical logic

this one melted my brain a little. classical logic (with double-negation elimination) corresponds to continuations / call-cc. the Peirce's law ((A โ†’ B) โ†’ A) โ†’ A corresponds to call-with-current-continuation. Griffin discovered this in 1990 and i will never fully recover.

3. Proof normalization = beta reduction = computation

when you reduce a lambda term ((\x -> x + 1) 5 becomes 6), you're not just computing โ€” you're simplifying a proof tree. Gentzen's cut-elimination theorem (a fundamental result in proof theory) and beta reduction in the lambda calculus are literally the same operation seen through the isomorphism ๐Ÿคฏ

๐Ÿˆ
ProofsArePrograms
Dependent Type Devotee
Posts: 2,342
Rep: โ˜…โ˜…โ˜…โ˜…โ˜†
๐ŸŽ– Type Theorist
#5
MewMewMonad wrote:
Griffin discovered this in 1990 and i will never fully recover.

the Griffin result is SO good. classical logic gets continuations, linear logic gets session types / resource-aware computation, intuitionistic logic gets pure functional programs... it's like each logical system is secretly a programming paradigm dressed up as epistemology ๐Ÿ˜ญ

speaking of linear logic โ€” can we talk about how linear logic โ†” linear types is an entire extension of the correspondence? Girard's linear logic with โŠ— (times), & (with), โŠ• (plus), โ…‹ (par) maps onto linear type systems where resources must be used exactly once. this is how you get Rust's borrow checker from a logical perspective โ€” it's literally linear logic enforced at compile time!!

Linear Logic   โ†”   Linear Types   โ†”   Resource-Aware Programs   โ†”   Memory Safety

the chain goes: Girard invents linear logic for theoretical reasons โ†’ Curry-Howard says it should correspond to a type system โ†’ Rust (and others) implement exactly those type system ideas โ†’ you get memory safety without garbage collection. the philosophy predicted the engineering ๐ŸŒธ

๐ŸŸ
WadlerCatFan
Theorems for Free Stan
Posts: 999
Rep: โ˜…โ˜…โ˜…โ˜†โ˜†
๐Ÿ“œ Logic Nerd
#6

adding an Agda snippet because dependent types make the correspondence so explicit you can almost taste it:

-- In Agda, propositions literally ARE types
-- and proofs literally ARE values

data _โ‰ก_ {A : Set} : A โ†’ A โ†’ Set where
  refl : {x : A} โ†’ x โ‰ก x

-- Symmetry of equality is a PROGRAM that takes
-- a proof (p : a โ‰ก b) and returns a proof (b โ‰ก a)
sym : {A : Set} {a b : A} โ†’ a โ‰ก b โ†’ b โ‰ก a
sym refl = refl

-- Transitivity IS function composition
trans : {A : Set} {a b c : A}
       โ†’ a โ‰ก b โ†’ b โ‰ก c โ†’ a โ‰ก c
trans refl refl = refl

there's something almost spiritual about the fact that refl (the proof that anything equals itself) is literally the only constructor of the identity type, and pattern matching on it in sym is the entire proof of symmetry. the structure of the program is the structure of the proof.

also going to plug: Software Foundations (Pierce et al.) develops this entire correspondence formally in Rocq/Coq. extremely good if you want to see a real proof assistant built on these principles. free online! ๐Ÿฑ

๐ŸŒ™
MewMewMonad
Monad Transformer Meow
Posts: 3,110
Rep: โ˜…โ˜…โ˜…โ˜…โ˜…
๐ŸŽ– Senior Catgirl Dev
#7

something i always bring up with beginners: the "why does this matter for actual programming" question. type-checking IS proof-checking. full stop.

from Coq/Rocq's documentation (paraphrasing): because propositions are just types and proofs are just terms, checking that a proof is valid just amounts to type-checking the term. type checkers are relatively small, tractable programs โ€” so the "trusted computing base" for a proof assistant can be tiny. you only need to trust the type checker!

this is why formally verified software (seL4 microkernel, CompCert compiler, etc.) is possible at all. the mathematical foundation is the Curry-Howard correspondence.

favourite correspondence expansion table (the "so what" version):

Programming conceptLogical meaning
Well-typed programValid proof
Type checkerProof checker
Inhabited typeTrue / provable proposition
Uninhabited typeFalse / unprovable proposition
Unit test...weaker form of witness lol
Bug-free programActually proven theorem ๐ŸŒธ

(yes I put "unit test = weaker form of witness" specifically to start drama in this thread)

๐Ÿฑ
LambdaCatgirl
ฮป-Calculus Enthusiast
Posts: 1,873
Rep: โ˜…โ˜…โ˜…โ˜…โ˜†
๐ŸŽ– Lambda Luminary
#8
(unit test = weaker form of witness)
lmaooo war crimes

ok i want to add the historical angle because I love it. the story is roughly:

๐Ÿฑ 1934 โ€” Curry notices that the axioms of combinatory logic look suspiciously like the axioms of Hilbert-style propositional logic. observes the type-theoretic analogue but doesn't publish it formally until later.

๐Ÿฑ 1969 โ€” Howard writes an influential (unpublished!) manuscript showing that natural deduction proofs directly correspond to typed lambda terms via an explicit structural isomorphism. it circulates for years before formal publication in 1980.

๐Ÿฑ early 1970s โ€” Lambek independently shows that the proofs of intuitionistic propositional logic and combinators of typed combinatory logic share a common equational theory: the theory of cartesian closed categories. this completes the trinity.

what i love is that Howard's manuscript wasn't even published when it started influencing everything. it was just passed around informally. mathematical gossip as the foundation of modern type theory ๐Ÿซถ

๐Ÿˆ
ProofsArePrograms
Dependent Type Devotee
Posts: 2,343
Rep: โ˜…โ˜…โ˜…โ˜…โ˜†
๐ŸŽ– Type Theorist
#9

last one from me for now (have to go touch some theorems) โ€” my favourite compact demonstration of the whole thing in Haskell using parametricity:

-- The composition operator (.) proves transitivity of implication!
-- (b โ†’ c) โ†’ (a โ†’ b) โ†’ (a โ†’ c)
-- i.e. "if B implies C, and A implies B, then A implies C"
(.) :: (b -> c) -> (a -> b) -> (a -> c)
(f . g) x = f (g x)

-- The const function proves "A implies (B implies A)"
-- i.e. any true thing can be proven from any hypothesis
const :: a -> b -> a
const x _ = x

-- `flip` proves the commutativity of antecedents:
-- (a โ†’ b โ†’ c) โ†’ (b โ†’ a โ†’ c)
flip :: (a -> b -> c) -> b -> a -> c
flip f y x = f x y

the Haskell Prelude is secretly a book of tautologies ๐ŸŒธ every polymorphic function in there is simultaneously a proof of a theorem in intuitionistic propositional logic. go look at the type of curry and uncurry sometime and tell me you don't feel the universe winking at you.

anyway, thread is open. please drop more examples, more connections, more love for this beautiful correspondence. it's why i got into type theory and I just want everyone to feel the joy ๐Ÿซถ


Showing posts 1โ€“9 of 79  ยท  Next page โ†’
+ Reply

โœ๏ธ Post a Reply

CGPA Forums ยท Type Theory & Formal Verification ยท Rules ยท About CGPA ยท Powered by cgpa-board v3.1.4 ๐Ÿฑ