Documentation

LeanPool.MatchingLogic.SortedProof

MatchingLogic.SortedProof #

Free variables, at a sort #

Application contexts, at sorts #

inductive MatchingLogic.Sorted.MAppCtx (S : MSignature) (Var : Type) :
S.SrtS.SrtType

C ::= □ | σ(φ₁, …, C, …, φₙ), tracking both the hole's sort and the context's result sort.

Instances For
    @[irreducible]
    def MatchingLogic.Sorted.MAppCtx.plug {S : MSignature} {Var : Type} {sh st : S.Srt} :
    MAppCtx S Var sh stMPattern S Var shMPattern S Var st

    C[φ].

    Equations
    Instances For

      Variable-for-variable substitution, at a sort #

      def MatchingLogic.Sorted.msubstVar {S : MSignature} {Var : Type} [DecidableEq S.Srt] [DecidableEq Var] (s' : S.Srt) (x y : Var) {s : S.Srt} :
      MPattern S Var sMPattern S Var s

      φ[y/x] where x and y are variables of sort s'. As in the one-sorted development, substitution is variable-for-variable only and capture-avoidance is a side condition rather than a renaming.

      Equations
      Instances For
        def MatchingLogic.Sorted.MCaptureFree {S : MSignature} {Var : Type} (s' : S.Srt) (x y : Var) {s : S.Srt} :
        MPattern S Var sProp

        Capture-avoidance for msubstVar, with the same three alternatives as the one-sorted CaptureFree: the substitution stops here, or it changes nothing here, or this binder cannot capture y. The middle alternative is the one an audit had to restore in the one-sorted case.

        Equations
        Instances For

          Figure 2, many-sorted #

          inductive MatchingLogic.Sorted.MProvable {S : MSignature} {Var : Type} [DecidableEq S.Srt] [DecidableEq Var] { : S.Srt} (Γ : Set (MPattern S Var )) {s : S.Srt} :
          MPattern S Var sProp

          Γ ⊢ φ for a many-sorted theory Γ, all of whose members have sort . The rules are those of Figure 2, taken "at each symbol and each argument position", with the premise at the sort of that position and the conclusion at the symbol's result sort.

          Instances For

            Sort feeding #

            s feeds t: s = t, or some symbol has an argument of sort s and result sort t (paper, Section 8).

            Equations
            Instances For
              @[reducible, inline]

              , the reflexive transitive closure of Feeds.

              Equations
              Instances For

                In S3, sort a feeds only itself, because no symbol has an argument of sort a. This is the structural fact the whole argument rests on.

                Many-sorted soundness, assumed as the paper does #

                (S) at many sorts. The paper cites this to [3, Thm. 13] rather than proving it; our one-sorted soundness is proved, this is not.

                NARROWER THAN THE PAPER, deliberately: this quantifies only over HOMOGENEOUS theories, whereas the paper's many-sorted theories may mix sorts. That is exactly sufficient for Proposition 30, whose Γ is a singleton at sort a, and it keeps the induction below stated in terms of a single . An audit flagged the narrowing, so it is recorded here rather than silent.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For

                  Proposition 30, third claim #

                  theorem MatchingLogic.Sorted.mprovable_empty_of_not_feeds {S : MSignature} {Var : Type} [DecidableEq S.Srt] [DecidableEq Var] {s : S.Srt} (Γ : Set (MPattern S Var )) (φ : MPattern S Var s) (hfeed : ¬FeedsStar S s) (h : MProvable Γ φ) :

                  Every line of a derivation whose sort does not feed back to is derivable from the axioms alone: a hypothesis line has sort , and no rule carries an premise into a conclusion of a sort that does not feed.

                  theorem MatchingLogic.Sorted.Γ3_not_derives_φ3 {Var : Type} [DecidableEq Var] (hS : MSoundness S3 Var) (x y : Var) (hxy : x y) :
                  ¬MProvable (Γ3 x y) (φ3 x y)

                  Proposition 30, third claim. Γ ⊬ φ.

                  φ has sort c, and a feeds only a, so any derivation of φ from Γ would be a derivation from no hypotheses; soundness would then make φ valid, and it is not — take M_b = {r, s} with g_M(r) ≠ g_M(s).

                  theorem MatchingLogic.Sorted.no_faithful_translation {Var : Type} [DecidableEq Var] (hS : MSoundness S3 Var) (x y : Var) (hxy : x y) :
                  ¬∃ (T : Signature) ( : MPattern S3 Var Srt3.aPattern T Var) ( : MPattern S3 Var Srt3.cPattern T Var), StrongLocalCompleteness T Var (∀ γΓ3 x y, Closed ( γ)) Closed ( (φ3 x y)) (MGlobalCons (Γ3 x y) (φ3 x y)GlobalCons ( '' Γ3 x y) ( (φ3 x y))) (Provable ( '' Γ3 x y) ( (φ3 x y))MProvable (Γ3 x y) (φ3 x y))

                  Corollary 31, at the Proposition 30 data.

                  The paper states Corollary 31 in general: "There is no translation from many-sorted definedness-free matching logic into any one-sorted definedness-free matching logic that preserves global consequence and reflects derivability." Its proof is one line — preservation, then Corollary 15 in the target, then reflection would give Γ ⊢ φ.

                  What is stated here is the counterexample instance, not the general statement: there is no target signature and pair of translations that works for the Proposition 30 data. A full rendering would define a translation on the whole source language and state preservation and reflection generally; this is the lemma that instance argument needs, and the general form is future work.

                  Three hypotheses are load-bearing and were all missing from a first draft of this statement, which an audit showed to be concretely FALSE without them:

                  • hxy : xy — without it φ3 collapses to a derivable pattern, and the existential body is inhabited;
                  • StrongLocalCompleteness T Var — (L) must hold in the target, since the paper's proof applies Corollary 15 there. A first draft required it of an unrelated fixed signature;
                  • closedness of the translated patterns, which global_completeness requires.