Documentation

LeanPool.MatchingLogic.EntryIII.FreshWitnessElim

MatchingLogic.EntryIII.FreshWitnessElim #

Exact composition when the result name is fresh for the current body. The z = y case is an inert self-substitution; otherwise support tracking shows that the second capture-avoidance pass is a raw substitution.

theorem MatchingLogic.IsMCS.freshWitness_elim {S : Signature} {Gamma : Set (Pattern S )} (hM : IsMCS Gamma) (hW : FreshWitnessed Gamma) {y : } {q : Pattern S } (hmem : Pattern.ex y q Gamma) :
zq.allVars, Pattern.captureAvoidingSubst y z q Gamma

One fresh witness may be eliminated inside an MCS while retaining the strong raw freshness fact needed by subsequent substitutions.

The body obtained by successively eliminating an ordered list of names.

Equations
Instances For

    The stronger freshness record carried through a nested witness elimination. Each returned name is fresh for the exact remaining body.

    Equations
    Instances For
      theorem MatchingLogic.IsMCS.exList_freshWitness_elim {S : Signature} {Gamma : Set (Pattern S )} (hM : IsMCS Gamma) (hW : FreshWitnessed Gamma) (ys : List ) (hys : ys.Nodup) (p : Pattern S ) (hmem : Pattern.exList ys p Gamma) :
      ∃ (zs : List ), Pattern.FreshExListTrace ys zs p Pattern.substList ys zs p Gamma

      Recursively eliminate an exList in a fresh-witness MCS. The result is an actual raw substitution trace, not an appeal to alpha quotienting.

      theorem MatchingLogic.IsMCS.witnessPush_freshTrace {S : Signature} {Gamma : Set (Pattern S )} (hM : IsMCS Gamma) (hW : FreshWitnessed Gamma) {sigma : S.Sym} (Phi : Fin (S.arity sigma)Pattern S ) (p : Pattern S ) (x : ) (y : Fin (S.arity sigma)) (hyinj : Function.Injective y) (hyfreshP : ∀ (i : Fin (S.arity sigma)), y ip.allVars) (hyfreshPhi : ∀ (i j : Fin (S.arity sigma)), y i(Phi j).allVars) (happ : Pattern.app sigma Phi Gamma) :
      ∃ (z : List ), Pattern.FreshExListTrace (List.ofFn y) z (Pattern.app sigma fun (i : Fin (S.arity sigma)) => (Phi i).and ((Pattern.ex x p).imp (Pattern.captureAvoidingSubst x (y i) p))) Pattern.substList (List.ofFn y) z (Pattern.app sigma fun (i : Fin (S.arity sigma)) => (Phi i).and ((Pattern.ex x p).imp (Pattern.captureAvoidingSubst x (y i) p))) Gamma

      Apply Lemma 80 and eliminate its nested existential witnesses using the fresh strengthened interface. FreshExListTrace records exactly the all-variable freshness available at every recursive step, so consumers do not need to guess a raw-syntax normalization convention.