Proving decidability
of Intuitionistic Propositional Calculus
on Coq
Masaki Hara (qnighy)
University of Tokyo, first grade
Logic Zoo 2013 にて
Slide 2
Slide 2 text
1. Task & Known results
2. Brief methodology of the proof
1. Cut elimination
2. Contraction elimination
3. →
elimination
4. Proof of strictly-decreasingness
3. Implementation detail
4. Further implementation plan
Slide 3
Slide 3 text
Task
• Proposition: , ∧, ∨, →, ⊥
• Task: Is given propositional formula P provable
in LJ?
– It’s known to be decidable. [Dyckhoff]
• This talk: how to prove this decidability on
Coq
Slide 4
Slide 4 text
Known results
• Decision problem on IPC is PSPACE complete
[Statman]
– Especially, O(N log N) space decision procedure is
known [Hudelmaier]
• These approaches are backtracking on LJ
syntax.
Slide 5
Slide 5 text
Known results
• cf. classical counterpart of this problem is
co-NP complete.
– Proof: find counterexample in boolean-valued
semantics (SAT).
Slide 6
Slide 6 text
methodology
• To prove decidability, all rules should be
strictly decreasing on some measuring.
• More formally, for all rules 1,2,…,
0
and all number (1 ≤ ≤ ),
< 0
on certain well-founded relation <.
Slide 7
Slide 7 text
methodology
1. Eliminate cut rule of LJ
2. Eliminate contraction rule
3. Split →
rule into 4 pieces
4. Prove that every rule is strictly decreasing
Cut elimination
• 1. Prove these rule by induction on proof structure.
• Γ⊢
Δ,Γ⊢
Δ,Δ,Γ⊢
Δ,Γ⊢
• Γ⊢⊥
Γ⊢
⊥
• Γ⊢∧
Γ⊢
∧1
Γ⊢∧
Γ⊢
∧2
• Γ⊢→
,Γ⊢
→
• If Γ1⊢ ,Δ1⊢1
Γ1,Δ1⊢1
(
) and Γ2⊢ ,Δ2⊢2
Γ2,Δ2⊢2
(
) for all
Γ1
, Γ2
, Δ1
, Δ2
, 1
, 2
, then Γ⊢∨ A,Δ⊢ ,Δ⊢
Γ,Δ⊢
(∨
)
Slide 11
Slide 11 text
Cut elimination
• 2. Prove the general cut rule
Γ ⊢ , Δ ⊢
Γ, Δ ⊢
by induction on the size of
and proof structure of the right hand.
• 3. specialize (n = 1) ■
Correctness of Terminating LJ
• 1. If Γ ⊢ is provable in Contraction-free LJ,
At least one of these is true:
– Γ includes ⊥, ∧ , or ∨
– Γ includes both () and →
– Γ ⊢ has a proof whose bottommost rule is not
the form of
→, ,Γ⊢ , ,Γ⊢
→,(),Γ⊢
(→
)
• Proof: induction on proof structure
Slide 23
Slide 23 text
Correctness of Terminating LJ
• 2. every sequent provable in Contraction-free
LJ is also provable in Terminating LJ.
• Proof: induction by size of the sequent.
– Size: we will introduce later
Proof of termination
• ordering of Proposition List
– Use Multiset ordering (Dershowitz and Manna
ordering)
Slide 27
Slide 27 text
Multiset Ordering
• Multiset Ordering: a binary relation between
multisets (not necessarily be ordering)
• > ⇔
A
B
Not empty
Slide 28
Slide 28 text
Multiset Ordering
• If is a well-founded binary relation, the
Multiset Ordering over is also well-founded.
• Well-founded: every element is accessible
• is accessible : every element such that
< is accessible
Slide 29
Slide 29 text
Multiset Ordering
Proof
• 1. induction on list
• Nil ⇒ there is no such that <
Nil,
therefore it’s accessible.
• We will prove:
⇒
( ∷ )
Slide 30
Slide 30 text
Multiset Ordering
• 2. duplicate assumption
• Using () and
(), we will prove
⇒
( ∷ )
• 3. induction on and
– We can use these two inductive hypotheses.
1. ∀ , < ⇒
⇒
( ∷ )
2. ∀, <
⇒
⇒
( ∷ )
Slide 31
Slide 31 text
Multiset Ordering
• 4. Case Analysis
• By definition,
( ∷ ) is equivalent to
∀, <
( ∷ ) ⇒
()
• And there are 3 patterns:
1. includes
2. includes s s.t. < , and minus all such is
equal to
3. includes s s.t. < , and minus all such is
less than
• Each pattern is proved using the Inductive
Hypotheses.
Slide 32
Slide 32 text
Decidability
• Now, decidability can be proved by induction
on the size of sequent.
Permutation solver (Coq)
• Permutation should be solved automatically
Ltac perm :=
match goal with
…
Slide 39
Slide 39 text
Further implementation plan
•
Slide 40
Slide 40 text
Further implementation plan
• Refactoring (1) : improve Permutation-
associated tactics
– A smarter auto-unifying tactics is needed
– Write tactics using Objective Caml
• Refactoring (2) : use Ssreflect tacticals
– This makes the proof more manageable
Slide 41
Slide 41 text
Further implementation plan
• Refactoring (3) : change proof order
– Contraction first, cut next
– It will make the proof shorter
• Refactoring (4) : discard Multiset Ordering
– If we choose appropriate weight function of
Propositional Formula, we don’t need Multiset
Ordering. (See [Hudelmaier])
– It also enables us to analyze complexity of this
procedure
Slide 42
Slide 42 text
Further implementation plan
• Refactoring (5) : Proof of completeness
– Now completeness theorem depends on the
decidability
• New Theorem (1) : Other Syntaxes
– NJ and HJ may be introduced
• New Theorem (2) : Other Semantics
– Heyting Algebra
Slide 43
Slide 43 text
Further implementation plan
• New Theorem (3) : Other decision procedure
– Decision procedure using semantics (if any)
– More efficient decision procedure (especially
( log )-space decision procedure)
• New Theorem (4) : Complexity
– Proof of PSPACE-completeness