Documentation

LeanPool.MatchingLogic.EntryIII.WitnessElim

MatchingLogic.EntryIII.WitnessElim #

Empty-theory derivability is admissibly closed under total capture-avoiding substitution.

Total capture-avoiding substitution respects proof-theoretic alpha equivalence.

Source substitution composition modulo alpha equivalence. The intermediate name is fresh only from free variables; the final name is arbitrary.

theorem MatchingLogic.IsMCS.exList_witness_elim {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) (hnested : Pattern.exList (List.ofFn y) (Pattern.app sigma fun (i : Fin (S.arity sigma)) => (Phi i).and ((Pattern.ex x p).imp (Pattern.captureAvoidingSubst x (y i) p))) Gamma) :
∃ (z : Fin (S.arity sigma)), (∀ (i : Fin (S.arity sigma)), z ip.allVars) (∀ (i j : Fin (S.arity sigma)), z i(Phi j).allVars) (Pattern.app sigma fun (i : Fin (S.arity sigma)) => (Phi i).and ((Pattern.ex x p).imp (Pattern.captureAvoidingSubst x (z i) p))) Gamma

Eliminate the nested witnesses produced by Lemma 80 and normalize every sequential raw substitution back to one source-style substitution.

theorem MatchingLogic.IsMCS.witnessPush_elim {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 : Fin (S.arity sigma)), (∀ (i : Fin (S.arity sigma)), z ip.allVars) (∀ (i j : Fin (S.arity sigma)), z i(Phi j).allVars) (Pattern.app sigma fun (i : Fin (S.arity sigma)) => (Phi i).and ((Pattern.ex x p).imp (Pattern.captureAvoidingSubst x (z i) p))) Gamma

Stage-recursion interface: apply Lemma 80 and immediately eliminate its nested witnesses inside a witnessed MCS.