MatchingLogic.ProofSystem #
Rule (1): substitution instances of propositional tautologies #
Equations
- One or more equations did not get rendered due to their size.
- MatchingLogic.instDecidableEqPForm.decEq (MatchingLogic.PForm.atom a) (MatchingLogic.PForm.atom b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- MatchingLogic.instDecidableEqPForm.decEq (MatchingLogic.PForm.atom a) MatchingLogic.PForm.bot = isFalse ⋯
- MatchingLogic.instDecidableEqPForm.decEq (MatchingLogic.PForm.atom a) (a_1.imp a_2) = isFalse ⋯
- MatchingLogic.instDecidableEqPForm.decEq MatchingLogic.PForm.bot (MatchingLogic.PForm.atom a) = isFalse ⋯
- MatchingLogic.instDecidableEqPForm.decEq MatchingLogic.PForm.bot MatchingLogic.PForm.bot = isTrue ⋯
- MatchingLogic.instDecidableEqPForm.decEq MatchingLogic.PForm.bot (a.imp a_1) = isFalse ⋯
- MatchingLogic.instDecidableEqPForm.decEq (a.imp a_1) (MatchingLogic.PForm.atom a_2) = isFalse ⋯
- MatchingLogic.instDecidableEqPForm.decEq (a.imp a_1) MatchingLogic.PForm.bot = isFalse ⋯
Instances For
Boolean evaluation under an assignment to the atoms.
Equations
Instances For
Substituting patterns for the propositional atoms.
Equations
Instances For
Rule (3): variable-for-variable substitution, capture-avoiding #
φ[y/x], replacing the element variable x by y. Naive: it stops at a
binder for x, but does not itself avoid capture of y.
Equations
- MatchingLogic.substVar x y (MatchingLogic.Pattern.var z) = if z = x then MatchingLogic.Pattern.var y else MatchingLogic.Pattern.var z
- MatchingLogic.substVar x y MatchingLogic.Pattern.bot = MatchingLogic.Pattern.bot
- MatchingLogic.substVar x y (MatchingLogic.Pattern.app σ f) = MatchingLogic.Pattern.app σ fun (i : Fin (S.arity σ)) => MatchingLogic.substVar x y (f i)
- MatchingLogic.substVar x y (a.imp b) = (MatchingLogic.substVar x y a).imp (MatchingLogic.substVar x y b)
- MatchingLogic.substVar x y (MatchingLogic.Pattern.ex z a) = if z = x then MatchingLogic.Pattern.ex z a else MatchingLogic.Pattern.ex z (MatchingLogic.substVar x y a)
Instances For
substVar x y φ is capture-avoiding: no binder on the way to a substituted
occurrence of x binds y. This is the paper's side condition on rule (3).
The binder clause has three alternatives, and all three are needed:
z = x— the substitution stops here, sincexis rebound;x ∉ FV a—substVarchanges nothing under this binder, so it cannot introduce ayforzto capture, even whenz = y;z ≠ yand recursively —ymay be introduced, butzdoes not bind it.
The middle alternative was missing in the first version of this definition, and
two independent audits caught it. Its absence made the predicate SOUND but
strictly TOO STRONG: it rejected genuinely capture-safe substitutions, which
would have made rule (3) weaker than Figure 2 and could have left Corollary 15
unprovable, with nothing failing to compile anywhere. See
captureFree_needs_notFree below for a substitution the old version rejected.
Equations
- MatchingLogic.CaptureFree x y (MatchingLogic.Pattern.var z) = True
- MatchingLogic.CaptureFree x y MatchingLogic.Pattern.bot = True
- MatchingLogic.CaptureFree x y (MatchingLogic.Pattern.app σ f) = ∀ (i : Fin (S.arity σ)), MatchingLogic.CaptureFree x y (f i)
- MatchingLogic.CaptureFree x y (a.imp b) = (MatchingLogic.CaptureFree x y a ∧ MatchingLogic.CaptureFree x y b)
- MatchingLogic.CaptureFree x y (MatchingLogic.Pattern.ex z a) = (z = x ∨ x ∉ MatchingLogic.FV a ∨ z ≠ y ∧ MatchingLogic.CaptureFree x y a)
Instances For
The x ∉ FV a alternative is not vacuous. Substituting y for x in
∃y. z, where x does not occur, is harmless — substVar leaves the pattern
alone — yet the binder is y itself. Only the middle alternative admits it.
Rule (10): application contexts #
C[φ].
Equations
- MatchingLogic.AppCtx.hole.plug x✝ = x✝
- (MatchingLogic.AppCtx.node σ i args c).plug x✝ = MatchingLogic.Pattern.app σ (Function.update args i (c.plug x✝))
Instances For
Figure 2 #
Γ ⊢ φ. The ten schemes and rules of Figure 2, restricted to one sort.
- hyp
{S : Signature}
{Var : Type}
[DecidableEq Var]
{Γ : Set (Pattern S Var)}
{φ : Pattern S Var}
: φ ∈ Γ → Provable Γ φ
Membership in the theory.
- taut
{S : Signature}
{Var : Type}
[DecidableEq Var]
{Γ : Set (Pattern S Var)}
{p : PForm}
{θ : ℕ → Pattern S Var}
: p.Taut → Provable Γ (PForm.subst θ p)
(1) Tautology.
- mp
{S : Signature}
{Var : Type}
[DecidableEq Var]
{Γ : Set (Pattern S Var)}
{φ₁ φ₂ : Pattern S Var}
: Provable Γ φ₁ → Provable Γ (φ₁.imp φ₂) → Provable Γ φ₂
(2) Modus ponens.
- exQuant
{S : Signature}
{Var : Type}
[DecidableEq Var]
{Γ : Set (Pattern S Var)}
{x y : Var}
{φ : Pattern S Var}
: CaptureFree x y φ → Provable Γ ((substVar x y φ).imp (Pattern.ex x φ))
(3) ∃-quantifier, capture-avoiding.
- exGen
{S : Signature}
{Var : Type}
[DecidableEq Var]
{Γ : Set (Pattern S Var)}
{x : Var}
{φ₁ φ₂ : Pattern S Var}
: Provable Γ (φ₁.imp φ₂) → x ∉ FV φ₂ → Provable Γ ((Pattern.ex x φ₁).imp φ₂)
(4) ∃-generalization.
- propBot
{S : Signature}
{Var : Type}
[DecidableEq Var]
{Γ : Set (Pattern S Var)}
{σ : S.Sym}
{i : Fin (S.arity σ)}
{args : Fin (S.arity σ) → Pattern S Var}
: Provable Γ ((Pattern.app σ (Function.update args i Pattern.bot)).imp Pattern.bot)
(5) Propagation of
⊥. - propOr
{S : Signature}
{Var : Type}
[DecidableEq Var]
{Γ : Set (Pattern S Var)}
{σ : S.Sym}
{i : Fin (S.arity σ)}
{args : Fin (S.arity σ) → Pattern S Var}
{φ₁ φ₂ : Pattern S Var}
: Provable Γ
((Pattern.app σ (Function.update args i (φ₁.or φ₂))).imp
((Pattern.app σ (Function.update args i φ₁)).or (Pattern.app σ (Function.update args i φ₂))))
(6) Propagation of
∨. - propEx
{S : Signature}
{Var : Type}
[DecidableEq Var]
{Γ : Set (Pattern S Var)}
{σ : S.Sym}
{i : Fin (S.arity σ)}
{args : Fin (S.arity σ) → Pattern S Var}
{x : Var}
{φ : Pattern S Var}
: (∀ (j : Fin (S.arity σ)), j ≠ i → x ∉ FV (args j)) →
Provable Γ
((Pattern.app σ (Function.update args i (Pattern.ex x φ))).imp
(Pattern.ex x (Pattern.app σ (Function.update args i φ))))
(7) Propagation of
∃. - framing
{S : Signature}
{Var : Type}
[DecidableEq Var]
{Γ : Set (Pattern S Var)}
{σ : S.Sym}
{i : Fin (S.arity σ)}
{args : Fin (S.arity σ) → Pattern S Var}
{φ₁ φ₂ : Pattern S Var}
: Provable Γ (φ₁.imp φ₂) →
Provable Γ ((Pattern.app σ (Function.update args i φ₁)).imp (Pattern.app σ (Function.update args i φ₂)))
(8) Framing.
- existence
{S : Signature}
{Var : Type}
[DecidableEq Var]
{Γ : Set (Pattern S Var)}
{x : Var}
: Provable Γ (Pattern.ex x (Pattern.var x))
(9) Existence.
- singleton
{S : Signature}
{Var : Type}
[DecidableEq Var]
{Γ : Set (Pattern S Var)}
{x : Var}
{φ : Pattern S Var}
(C₁ C₂ : AppCtx S Var)
: Provable Γ ((C₁.plug ((Pattern.var x).and φ)).imp (C₂.plug ((Pattern.var x).and φ.nt)).nt)
(10) Singleton variable.
Instances For
Small public Hilbert toolkit #
Provability is monotone in its hypotheses.
⊤ is derivable in every theory.
Lemma 5 #
The propositional tautology introducing double negation.
Equations
Instances For
The propositional tautology expressing transitivity of implication.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Lemma 5 (necessitation). If Γ ⊢ ψ then Γ ⊢ [p]ψ for every word p.
The paper's proof, for a single coordinate e: the tautology
ψ → ((ψ → ⊥) → ⊥) with modus ponens gives Γ ⊢ ¬ψ → ⊥; framing in position
i with ⊤ elsewhere gives Γ ⊢ ⟨e⟩¬ψ → σ(⊤,…,⊥,…,⊤); propagation of ⊥
gives ⊢ σ(⊤,…,⊥,…,⊤) → ⊥; composing is propositional. Then iterate along p.
The two black boxes #
Finite conjunction, ⋀ l.
Equations
Instances For
(L) Strong local completeness. If Δ ⊨loc φ then ⊢ (⋀Δ₀) → φ for
some finite Δ₀ ⊆ Δ. The paper uses this as a black box, citing Definition 3.3
and "Theorem 3.8" of its reference [4] -- but Theorem 3.8 there is the WEAK
statement; strong local completeness is Theorem 3.7 (Theorem 83 of Chen and
Rosu, Matching μ-Logic, 2019 technical report,
https://hdl.handle.net/2142/102281). See
FINDINGS.md.
Equations
- One or more equations did not get rendered due to their size.
Instances For
(S) Soundness. Γ ⊢ φ implies Γ ⊨ φ. The paper uses this as a
black box too, but unlike (L) it is within reach here: see soundness below.
Equations
- MatchingLogic.Soundness S Var = ∀ (Γ : Set (MatchingLogic.Pattern S Var)) (φ : MatchingLogic.Pattern S Var), MatchingLogic.Provable Γ φ → MatchingLogic.GlobalCons Γ φ