0

In other words, the Curry–Howard correspondence is the observation that two families of seemingly unrelated formalisms—namely, the proof systems on one hand, and the models of computation on the other—are in fact the same kind of mathematical objects.

[1] In other words, every math proof has a corresponding computer program.

[According to the Church–Turing thesis, Turing machines and the lambda calculus are capable of computing anything that is computable.]( https://en.wikipedia.org/wiki/Alan_Turing)

[2] In other words, every computer program has a corresponding Turing Machine.

[3] By [1] and [2] every math proof has a corresponding Turing Machine.

[4] Every Turing Machine has a corresponding Unrestricted grammar

[5] By [3] and [4] every math proof has a corresponding Unrestricted grammar.

Are axioms in math equivalent to production rules in unrestricted grammars (example to follow)?

For example, here's a set of production rules that prove (10)+(10)=(100) (2+2=4 in base-2):

[a] (1)=(1) (You start with this sequence of characters)

[b] = | +(1)=(1)+ (You may replace the character sequence = with the character sequence +(1)=(1)+)

[c] )+(1) | a)

[d] 0a | 1

[e] 1a | a0

[f] (a | (1

Proof:

(1)=(1) [a]

(1)+(1)=(1)+(1) [b]

(1)+(1)+(1)=(1)+(1)+(1) [b]

(1)+(1)+(1)+(1)=(1)+(1)+(1)+(1) [b]

(1a)+(1a)=(1a)+(1)+(1) [c] (made 3 substitutions using [c] rule simultaneously)

(a0)+(a0)=(a0)+(1)+(1) [e] (made 3 substitutions using [e] rule simultaneously)

(10)+(10)=(10)+(1)+(1) [f] (made 3 substitutions using [f] rule simultaneously)

(10)+(10)=(11)+(1) [d]

(10)+(10)=(11a) [c]

(10)+(10)=(1a0) [e]

(10)+(10)=(a00) [e]

(10)+(10)=(100) [f]

Perhaps those six production rules allow one to (tediously) prove true statements involving addition of base-2 integers greater than 0. (I do not have a rigorous proof that these production rules are correct.)

(Having given an example,) Are axioms in math equivalent to production rules in unrestricted grammars?

  • If yes then what? – Salihcyilmaz Apr 17 '20 at 18:57
  • Try handling quantifiers ... – Noah Schweber Apr 17 '20 at 18:57
  • Or deductions involving combining hypotheses: how would you get "$y=0$" from "$x+y=1$" and "$x-y=1$"? Production rules are really too limited; regardless of their formal power, trying to use them this way will create huge amounts of unnecessary tedium. – Noah Schweber Apr 17 '20 at 19:17
  • @NoahSchweber Regarding quantifiers, "there exists" can implicit - construct the object. "for all" - if universe is finite, handle it recursively. For example prime(n) means "for all m, 1<=m<n notDivides(m,n)" - you could define notDividesAll(n, m) recursively: notDividesAll(n, m) <=> ((notDivides((n), (m))) and (notDividesAll((n), ((m)-(1))))) (you'd need to define notDivides and a base case when (m) = (1)) – Jesus is Lord Apr 17 '20 at 20:25
  • @WordsLikeJared But most of the time the world is not finite, or even linearly ordered in a natural way (consider $\mathbb{C}$ ...)! And what about alternating quantifiers ("$\forall x\exists y\forall z ...$")? This is really just a bad route to take. – Noah Schweber Apr 17 '20 at 20:26
  • "Or deductions involving combining hypotheses" You could prove (y)=(0) and (x)=(1) is a possible solution to equation set by adding production rules (y) | (0) and (x) | (1) and then deriving (1)+(0)=(1) and ((1)-(0))=(1) from your addition/subtraction production rules and substituting (y) and (x) to get the equations you asked for – Jesus is Lord Apr 17 '20 at 20:29
  • @NoahSchweber "the time the world is not finite, or even linearly ordered in a natural way" The world may not be, but what about statements about the world? Can those be enumerated in a natural way? Assuming finite set of symbols and finite statement length all statements correspond to natural numbers, yes? – Jesus is Lord Apr 17 '20 at 20:30
  • @Salihcyilmaz If goal is rigorous math proofs, production rules could be used in elementary school, maybe? – Jesus is Lord Apr 17 '20 at 20:31
  • 1
    @WordsLikeJared "The world may not be, but what about statements about the world?" Doesn't matter: we can have $\exists x\varphi(x)$ be true in $M$ without $\varphi(c)$ being true in $M$ for any $M$-definable $c$, and if this happens then shifting attention to formulas isn't enough. And even ignoring that it's still not enough since representing an existential as a disjunction over specific instances winds up producing an "infinitely long" formula if $M$ is infinite. Either that's not a formula after all, or there are too many formulas. – Noah Schweber Apr 17 '20 at 20:40
  • @NoahSchweber "without...definable " Wasn't aware, but makes sense (related to Godel's incompleteness?); "tons of rephrasing effort" automate it? – Jesus is Lord Apr 17 '20 at 20:44
  • 1
    ""tons of rephrasing effort" automate it?" How do you guarantee the end result will be easily usable (which was your original goal after all)? I really think committing to such a limited formalism is ultimately going to prevent usability. (Are you familiar with Hilbert-style, or sequent calculus, or similar, proof systems? If you are, what about them do you find unclear? They're broadly the same sort of thing as a production rule set, but more flexible.) – Noah Schweber Apr 17 '20 at 20:46
  • That said, you might be interested in combinatory logic. But I think CL is actually much harder to learn than classical first-order logic, unless the student is already comfortable with computer programming. – Noah Schweber Apr 17 '20 at 20:47
  • "How do you guarantee" I don't "Are you familiar with..." I'm not "you might be interested..." thanks! – Jesus is Lord Apr 17 '20 at 20:48
  • @Salihcyilmaz "If yes then what?" See https://math.stackexchange.com/questions/3631885/can-all-math-be-done-with-axioms-of-length-3-or-less – Jesus is Lord Apr 18 '20 at 16:37
  • @NoahSchweber "Try handling quantifiers ..." You can certainly create a grammar that introduces quantifiers to the wffs of prop. logic. But the challenge seems to arise when we interpret what the symbols mean, especially in the case of predicates over infinite sets. However I've yet to find a mathematician still proving their first theorem involving all the elements of an infinite set, which makes me suspicious that there might be some "finite workarounds", from a formalist perspective, to this. Edit: Perhaps such a grammar would only be able to meddle with a finite amount of identifiers. – Threnody Jul 13 '20 at 14:03

1 Answers1

2

Throughout this answer I'm ignoring the idea of semantics, since you seem to be focusing on the purely formalist aspects of logic for now, and while semantics can indeed be implemented in a formalist way that adds some serious complexity to the situation.


The stuff about Curry-Howard at the beginning really seems like a red herring; in light of your comment "I found formal logic confusing, too," I think it's a good idea to look at the following more general version of your question:

Is there a way to view proofs of theorems from axiom systems as being generated by some simple set of "string-manipulation rules"?

(Until later on I'm ignoring the problem that precedes even this one - that is, fixing a syntax for our formulas to live in. Before we can talk about proofs, we need to know what a formula is in the first place.)

Production systems are a particular example of such a set of rules, but they're quite limited. Formulas are in general a lot more complicated than just equations (think about quantifiers), and moreover proof steps that involve combining two hypotheses are hard to model naturally in this way. To get a satisfying positive answer, we really need to look at things more flexible than production systems - but which are still just sets of easy-to-use string manipulation rules.

These systems also address another of your concerns: "I found ZFC confusing [...] it felt like other logical axioms were "implied" in addition to the ZFC axioms that were spelled out." What's missing is exactly the relevant rule system, which comes before ZFC. (Actually, they're really independent of each other: we can consider different axiom systems over the same rule set, or the same axiom system over different rule sets.)


It's probably worth considering a concrete example at this point.

A Hilbert-style system is a family of rules which generate a set of formulas which we call "tautologies." For example, one such rule is: "For all formulas $\varphi,\psi$, the formula $\varphi\rightarrow(\psi\rightarrow\varphi)$ is a tautology." Another is: "If $\varphi$ and $\varphi\rightarrow\psi$ are tautologies, then $\psi$ is a tautology." Yet a third is: "For any term $t$ and any formula $\varphi$, if $\forall x(\varphi(x))$ is a tautology then $\varphi(t)$ is a tautology."

A given axiom set is then "slapped on top of" a Hilber-style system. When we say "$T$ proves $\varphi$" what we really mean is that there are some sentences $\alpha_1,\alpha_2,...,\alpha_n\in T$ such that $$\alpha_1\rightarrow(\alpha_2\rightarrow...\rightarrow(\alpha_n\rightarrow\varphi)...))$$ is a tautology. (Remember that "$A$ implies ($B$ implies $C$)" is equivalent to "($A$ and $B$) implies $C$;" for technical reasons, it's often useful to phrase everything in terms of $\rightarrow$ whenever possible.)


Another example, which is often confusing at first but is ultimately super important and valuable, is sequent calculus.

A sequent is an expression of the form "$\Gamma\vdash\varphi$" for $\Gamma$ a set of formulas and $\varphi$ a single formula; such a sequent intuitively means "$\Gamma$ proves $\varphi$." A sequent calculus is a system for building up a collection of "valid sequents" - and in this system, saying "$\Gamma$ proves $\varphi$" is shorthand for "'$\Gamma\vdash\varphi$' is in the set of sequents that the rules generate."

(Preempting a common question at this point, you should resist the urge to conflate "$\vdash$" and "$\rightarrow$". It's totally understandable, but will ultimately steer you wrong.)

Here are a couple examples of sequent rules:

  • "If $\varphi\in \Gamma$ then $\Gamma\vdash\varphi$ is a valid sequent."

    • This is (basically) reflexivity: statements entail themselves (and adding "superfluous hypotheses," namely the other formulas in $\Gamma$, doesn't change that).
  • "If $\Gamma\vdash\forall x\varphi(x)$ is a valid sequent, then so is $\Gamma\vdash\varphi(t)$ for any term $t$."

    • This is universal instantiation: it says that if we can deduce the formula $\forall x\varphi(x)$ from the set of formulas $\Gamma$, then - for any term $t$ - we can also deduce the formula $\varphi(t)$ from $\Gamma$.
  • "If $\Gamma\vdash\varphi$ and $\Gamma\vdash\psi$ are each valid sequents, so is $\Gamma\vdash\varphi\wedge\psi$."

    • This is "$\wedge$-introduction" - it tells us how to show that a conjunction $(\varphi\wedge\psi)$ is provable from a set of hypotheses $(\Gamma)$.
  • If $\Gamma\vdash\varphi\wedge\psi$ is a valid sequent, then so are each of $\Gamma\vdash\varphi$ and $\Gamma\vdash\psi$."

    • These are the left and right "$\wedge$-elimination" rules, respectively. (It may be tempting at this point to think of the introduction and elimination rules as defining $\wedge$ in the first place; this idea turns out to be surprisingly subtle, and an important search term here is "logical harmony.")

For example, applying reflexivity twice and $\wedge$-introduction once we get (for any choice of formulas $\varphi,\psi$) that $$\{\varphi,\psi\}\vdash \varphi\wedge\psi$$ is a valid sequent. The construction of this sequent from the rules involved looks like a tree with a "root" and two "leaves:" the first leaf is $\{\varphi,\psi\}\vdash\varphi$ (which we get for free from reflexivity), the second leaf is $\{\varphi,\psi\}\vdash\psi$ (ditto), and the root is $\{\varphi,\psi\}\vdash\varphi\wedge\psi$ (which we get from the two leaves via $\wedge$-introduction).


To sum up, when we really go fully formal we wind up looking at a combination of three things:

  • A syntax, telling us what a formula is.

  • A proof system, which is some collection of rules for generating "valid" formulas, sequents, or similar, together with an interpretation of "$\Gamma$ proves $\varphi$."

  • An axiom set, which is just a set of formulas.

These three pieces are, to a surprisingly large extent, independent; really the only constraint is that the syntax limits what the proof system and axiom set can involve in the first place. The proof system is the part of this apparatus which is most relevant to your question, and in setting one up we have various choices to make. One particularly important choice is what sort of "simplicity" we're going for. Production rules are quite simple, but are also very limited and result in lots of tedium. Sequent rules (for example) are much more flexible and lead to fairly natural proofs, but are more complicated objects in the first place.

One final thing that needs to be mentioned is the notion of comparison of proof systems. Fixing a common syntax for simplicity (we can talk about different syntaces but that quickly gets weird), we say:

  • Proof system $\mathbb{P}_1$ is at least as strong as proof system $\mathbb{P}_2$ if whenever $\Gamma$ proves $\varphi$ in the sense of $\mathbb{P}_2$, we also have that $\Gamma$ proves $\varphi$ in the sense of $\mathbb{P}_1$.

  • Two proof systems which are each at least as strong as the other are equivalent.

We can then prove, for example, that such-and-such Hilbert-style system is equivalent to such-and-such sequent calculus. Broad equivalence phenomena (e.g. from a semantic perspective, see here), similar to the broad equivalences between different models of computation, then ultimately lead us to - in most cases - suppress the choice of particular proof system.

Noah Schweber
  • 245,398
  • Incredibly helpful! Thank you! "A given axiom set is then "slapped on top of" a Hilber-style system." Are axioms elements of the set of tautologies generated by the Hilbert system? – Jesus is Lord Apr 17 '20 at 21:07
  • 1
    @WordsLikeJared No, axioms are unrelated sentences; the tautologies are the things which are guaranteed to always be true, while a given axiom system describes a specific context. For example (and mildly abusing syntax), "$\forall x,y(xy=yx)\rightarrow \forall u,v(uv=vu)$" is a tautology (bound variables can be renamed appropriately. Meanwhile, "$\forall x,y,z(x(yz)=(xy)z)$" is not a tautology (think about working in the structure $\mathbb{N}$ with $$ interpreted as subtraction), but it is* one of the group axioms. – Noah Schweber Apr 17 '20 at 21:26
  • 1
    Think of the tautologies as the things which are true in every structure, whereas axioms amount to restricting attention to a particular collection of structures. (Semantics is creeping in here when I talk about structures, but this is justified by Godel's completeness theorem - and that's not a typo!) The sequent calculus analogue of an axiom, btw, is a sentence $\varphi$ such that $\emptyset\vdash\varphi$ (often abbreviated "$\vdash\varphi$"). – Noah Schweber Apr 17 '20 at 21:27
  • @WordsLikeJared If you're interested in seeing an actual implementation of something like this stuff in terms of simple string replacement rules, you can check out the Metamath Proof Explorer. – Mark S. Apr 18 '20 at 13:10
  • @MarkS. Thanks! Metamath seemed easier (to me) than other automated proof systems. A while back I implemented a Metamath proof verifier in JavaScript from the definitions in a PDF, but still didn't understand how its proof verification algorithm actually worked. The "Distinct Variables", for example, threw me off. – Jesus is Lord Apr 18 '20 at 16:04