PFPL Chapter 12 Constructive Logic

This part is not shown on PFPL preview version.

What is Constructive Logic

Constructive logic codifies the principles of mathematical reasoning as it is actually practiced.

In mathematics, a proposition is judged true exactly when it has a proof, and false exactly when refutation occurs. Since there’re always, and will always be, unsolved problems, we can’t expect in general a proposition be either true or false.

Constructive Semantics

Constructive logic is concerned with 2 judgments:

  • ϕ prop, stating ϕ expresses a proposition.
  • ϕ true, stating ϕ is a true proposition.

What distinguishes constructive from non-constructive logic is that proposition is not conceived of merely a truth value, but instead as a problem statement whose solution, if it has one, is given by a proof.

Truth with Proof

Identifying truth with proof has some consequences. One cannot say that a proposition is either true or false. There exists a chaos state indicating there’s no proof for it.

In this sense, constructive logic is a logic of positive, or affirmative, information. One must have explicit evidence in the form of a proof or refutation to prove the truth or falsity of the proposition.

Decidable or Undecidable

It’s clear that not every proposition is either true or false. If ϕ expresses an unsolved problem, such as P=?NP, since we have no proof nor refutation for it. Such problem is undecidable, precisely because it hasn’t been solved.

My Personal Fav

The constructive attitude is simply to accept the situation as inevitable, and make out peace with that.

When faced with a problem, we have no choice but to roll up our sleeves and try to prove it or refute it. There is not guarantee of success! Life is hard, but we muddle though somehow.

Constructive Logic

Judgments ϕ prop and ϕ true are rarely of interest by themselves, but rather in a context of a hypothetical judgment of the form ϕ1 true,,ϕn trueϕ true. The judgment says proposition ϕ is true (with proof) under the assumptions that ϕi are true (with proofs).

The structural properties of the hypothetical judgment, when specialized to constructive logic, define what we mean by reasoning under hypotheses
Γ,ϕ trueϕ trueΓϕ1 trueΓ,ϕ1 trueϕ2 trueΓϕ2 trueΓϕ2 trueΓ,ϕ1 trueϕ2 true
Two more rules are required in that we regard Γ as a set of hypotheses, so that two “copies” are as good as one, and the order doesn’t matter
Γ,ϕ1 true,ϕ1 trueϕ2 trueΓ,ϕ1 trueϕ2 trueΓ1,ϕ1 true,ϕ2 true,Γ2ϕ trueΓ1,ϕ2 true,ϕ1 true,Γ2ϕ true

Provability

The syntax table of constructive logic is
Propτ::=truthfalsity(ϕ1;ϕ2)ϕ1ϕ2disjunction(ϕ1;ϕ2)ϕ1ϕ2conjunction(ϕ1;ϕ2)ϕ1ϕ2implication
The connectives of propositional logic are given meaning by rules that define

  • what constitutes a “direct” proof of propositional formed form that connective
  • how to exploit existence of such proof in an “indirect” proof of another proposition.

These are called introduction and elimination rules for the connectives.

The principle of conservation of proof states that these rules are inverse to one another: the elimination cannot extract more information than information we put it by introduction rule, and vise versa.

Truth

Truth proposition is trivially true, no information goes into proving it, no information can be obtained from it.
Γ true

Thus there is no elimination form only introduction form.

Conjunction

Γϕ1 trueΓϕ2 trueΓϕ1ϕ2 trueΓϕ1ϕ2 trueΓϕ1 trueΓϕ1ϕ2 trueΓϕ2 true

Implication

Γ,ϕ1 trueϕ2 trueΓϕ1ϕ2 trueΓϕ1ϕ2 trueΓϕ1 trueΓϕ2 true

Falsehood

Falsehood expresses the trivially false (refutable) proposition.

Thus there is no introduction form since no judgment supports falsehood, only elimination form.

Γ trueΓϕ true

Disjunction

Γϕ1 trueΓϕ1ϕ2 trueΓϕ2 trueΓϕ1ϕ2 trueΓϕ1ϕ2 trueΓ,ϕ1 trueϕ trueΓ,ϕ2 trueϕ trueΓϕ true

Negnation

¬ϕ is defined as ϕ. As a result, ¬ϕ true if ϕ true true, which is to say that the truth of ϕ is refutable.

Since constructive truth is defined to be the existence of proof, the implied semantics of negation is strong.

A problem ϕ is open exactly when neither affirm it or refute it. In contrast, classical conception of tuth assigns a fixed truth value to each proposition.

Proof Terms

The key to propositions-as-types principles is to make explicit the forms of proof.

Basic judgment ϕ true, which states that ϕ has a proof, is replaced by judgment p:ϕ, stating p is a proof for ϕ.

The hypothetical judgment form is changed into form x1:ϕ1,,xn:ϕnp:ϕ. (xi stands for presumed, but unknown, proofs.)

We again let Γ range over such hypothesis lists, subject to the restriction that no variable occurs more than once.

The syntax table for proof terms is
Prf p::=true-Itruth introand-I(p1;p2)p1,p2conj. introand-E[l](p)plconj. elimand-E[r](p)prconj. elimimp-I(x.p)λ(x)pimpl. introimp-E(p1;p2)p1(p2)impl. elimfalse-E(p)abort(p)false elimor-I[l](p)lpdisj. introor-I[r](p)rpdisj. introor-E(p;x1.p1;x2.p2)case p{lx1p1rx2p2}disj. elim
The rules of constructive propositional logic can be restated with proof terms

Truth

Γ:

Conjunction

Γp1:ϕ1Γp2:ϕ2Γp1,p2:ϕ1ϕ2Γp1:ϕ1ϕ2Γp1l:ϕ1Γp1:ϕ1ϕ2Γp1r:ϕ2

Implication

Γ,x:ϕ1p2:ϕ2Γλ(x)p2:ϕ1ϕ1Γp:ϕ1ϕ2Γp1:ϕ1Γp(p1):ϕ2

Falsehood

Γp:Γabort(p):ϕ

Disjunction

Γp1:ϕ1Γlp1:ϕ1ϕ2Γp2:ϕ2Γrp2:ϕ1ϕ2Γp:ϕ1ϕ2Γ,x1:ϕ1p1:ϕΓ,x2:ϕ2p2:ϕΓcase p{lx1p1rx2p2}:ϕ

Proof Dynamics

Proof terms in constructive logic are given a dynamics by Gentzen’s Principle, stating that elimination forms are inverse to the introduction forms.

One aspect of Gentzen’s Principle is the principle of conservation of proof.

Conjunction

Γp1:ϕ1Γp2:ϕ2Γp1,p2lp1:ϕ1Γp1:ϕ1Γp2:ϕ2Γp1,p2rp2:ϕ2Γpl:ϕ1Γpr:ϕ2Γpl,prp:ϕ1ϕ2

Implication

Γ,x:ϕ1p2:ϕ2Γp1:ϕ1Γ(λ(x)p2)(p1)[p1/x]p2:ϕ2Γp:ϕ1ϕ2Γλ(x)(p(x))p:ϕ1ϕ2

Disjunction

Γp:ϕ1ϕ2Γ,x1:ϕ1p1:ψΓ,x2:ϕ2p2:ψΓcase lp{lx1p1rx2p2}[p/x1]p1:ψΓp:ϕ1ϕ2Γ,x1:ϕ1p1:ψΓ,x2:ϕ2p2:ψΓcase rp{lx1p1rx2p2}[p/x2]p2:ψΓp:ϕ1ϕ2Γ,x:ϕ1ϕ2q:ψΓ[p/x]qcase p{lx1[lx1/x]qrx2[rx2/x]q}:ψ

Falsehood

Γp:Γ,x:q:ψΓ[p/x]qabort(p):ψ

Propositions as Types

PropTypeunitvoidϕ1ϕ2τ1×τ2ϕ1ϕ2τ1+τ2ϕ1ϕ2τ1τ2

Exercise

Law of the Excluded Middle

For ¬¬(ϕ¬ϕ) true, we can assume that ¬(ϕ¬ϕ) true and derive contradiction. Then we need to prove ϕ¬ϕ.

Plausible: LEM cannot be expected to hold for a general ϕ.

For ϕ¬ϕ, it suffices to prove one of its disjuncts. The following steps seems to be trivial.

Formally, we can see that the type of the proposition is ((τ+(τvoid))void)void.

Thus we can construct proof term as λ(x)x(rλ(y)x(ly)).

Double Negation Elimination

Suppose LEM holds universally, ϕ and assume ¬¬ϕ true, trying to derive ϕ true.

By LEM, ¬ϕϕ true. If ϕ true then goal reached. If ¬ϕ true, we need to derive contradiction for that.

By previous problem, we can derive proof term as λ(y) case LEMϕ{ly1y1ry2case y2(y){}}.

General Heyting Algebra Distributivity

Consider the equivalence ϕ(ψ1ψ2)(ϕψ1)(ϕψ2).

Let λ stands for left-hand side, ρ for right-hand side.

Assume the equivalence is achieved. Then we can see that ρϕ and ρψ1ψ2.

The former and latter ones are immediate, which are trivial. Thus ρλ.

If we want to show ρλ, we can show ϕρψ1ψ2. By exponential feature, ϕρψ1 and ϕρψ2.

This only shows that ϕψ1ρ and ϕψ2ρ. Thus it is proved.

For ϕ(ψ1ψ2)(ϕψ1)(ϕψ2), we still apply similar methods. Let λ for lhs and ρ for rhs.

On ρλ, one can easily see that ϕψ1λ and ϕψ2λ. The rest is trivial.

On λρ, ρϕψ1 and ρϕψ2. By transitive, the rest is trivial.

Boolean/Heyting Algebra De Morgen

One can see that ϕϕ in Boolean algebra as (¬ϕ)ϕ. Then it is consistent to adjoin LEM to constructive logic.

According to definition, the first de Morgan duality law can be proved by any Heyting Algebra.

The second one might encounter the case ψ as ¬ϕ. Then only Boolean Algebra can ensure negation is always the complement of the negated.