TCS: Propositions as Types
本文含有大量复杂的LATEX公式,因此md文档效果不好,仅供参考!
Propositions as Types
Intuitionistic Logic and Natural Deduction
Intuitionistic logic insists upon a constructionist notion of truth. In particular, a proof of A∨B must show which of A or B holds (different from classic logic).
Natural Deduction
Proof rules should come in pairs:
- Introduction rules which are like definitions of the logic operators.
- Elimination rules which are the consequences of theirdefinitions.
Both of them should be in harmony.
We will define the four kinds of rules, conjunction, implication, disjunction and falsehood in order.
Gentzen’s contribution:
Subformula principle: Proofs can be normalized so that no concepts enter the proof other than those contained in the final result (subformula).
This means we can use only the known proposition and the subformulas of the conclusion.
Guiding Question for Defining Logic
Martin-Löf: The meaning of a proposition is determined by what counts as a verification (or proof) of it.
- Proposition: A
- Justification: A true, A is true at time t, …
So that we need to determin a proposition by a verification(not only itself).
In this lecture, we only consider justification A true so we omit thet suffix true
Conjunction
We use ‘→’ to represents the prooftree in PDF.
(∧I)(∧E1)(∧E2)(A,B)→(A∧B)(A∧B)→A(A∧B)→B
We define the local soundness and local completeness as follows:
Local Soundness: The elimination cannot give us new information.
((D→A),(E→B))→(A∧B)→A⇒R(D→A)
Local Completeness: The elimination can reconstitute the proof by introduction
(D→A)⇒E(((D→(A∧B))→A),((D→(A∧B))→B))→(A∧B)→A
Implication
We define the hypothetical judgment at first:
(A∧(B∧C))⊢B
This is not an inference as it consists of two inferences! We have conjunctions inferences at now.
Then we can define implication introduction and elimination rules:
(⊃Ix)(Ax→∗B)→(A⊃B)(⊃E)(A⊃B,A)→B
In which that the x means the local scope.
Disjunction
Define the disjunction as follows:
(∨I1)(∨I2)(∨Ex,y)A→(A∨B)B→(A∨B)(A∨B,Ax→∗C,By→∗C)→C
Falsehood
Falsehood is written as ⊥.
It has no introduction as we shouldn’t prove it.
(⊥E)⊥→C
Intuitionistic Natural Deduction
So, we can use these four to define some other operates such as ¬, ⊤ and ↔
¬A⊤A↔B=defA⊃⊥=def⊥⊃⊥=def(A⊃B)∧(B⊃A)
Now we can begin prove! The follows is some interesting conclusion:
A⊃A⊃(A⊃B)⊃¬(A∨B)↔B⊃A¬¬A(¬B⊃¬A)(¬A∧¬B)
But some weird things hapend as the following is not provable:
((A⊃B)⊃A)¬¬A(¬A⊃¬B)¬(A∧B)↔⊃A⊃A⊃(B⊃A)(¬A∨¬B)
What the f***!
The most interesting is that:
(Gilvenko’s Theorem):, A is valid in classical logic if and only if ¬¬A is valid in intuitionistic logic!
And intuitionistic logic is PSPACE-complete!
Propositions as Types
We write M:A to represent that M is a proof of A and alternatively M is a program of type A.
So we can rewrite the four kinds of roles by λ-calculus!
Implication
(⊃Ix)(⊃E)((x:Ax)→(M:B))→(λx.M):(A⊃B)((M:(A⊃B)),(N:A))→(MN:B)
From its local soundness we can get β reduction, and from local completeness we can get η rule!
Turing has proved that typed λ-calculus always terminates.
Conjunction
(∧I)((M:A),(N:B))(∧E1)(M:(A∧B))(∧E2)(M:(A∧B))→(⟨M,N⟩:A∧B)→((fstM):A)→((sndM):B)
The local reduction and expansion can give out the meaning of ⟨⋅,⋅⟩, fst and snd
Disjunction
(∨I1)(M:A)(∨I2)(M:B)(∨Ex,y)(M:(A∨B),→((inlM):A∨B)→((inrM):A∨B)(x:Ax→(N:C)),(y:By→(P:C)))→case(M,x.N,y.P):C
Falsehood
No introduction rule.
(⊥E)(M:⊥)→(abortM:C)