-- 8th Summer School on Formal Techniques -- Menlo College, Atherton, California, US -- -- 21-25 May 2018 -- -- Lecture 2: Representing Logics and Programming Languages in Agda -- -- File 3: Substitution property {-# OPTIONS --allow-unsolved-metas #-} module Substitution where open import Library open import IPL open import Interpretation -- Renaming -- If we can prove C from a context Δ we can also prove it -- from Γ if every hypothesis in Δ can also be found in Γ. -- Thus, Γ can be a permutation of Δ or extension of Δ or both. -- A "renaming" r : Ren Γ Δ is a map from the hypotheses of Δ -- to the hypotheses of Γ. -- -- If we apply r to an address x : Hyp Δ A of hypothesis A in Δ, -- we get the address r x : Hyp Γ A of this hypothesis in Γ. Ren : (Γ Δ : Cxt) → Set Ren Γ Δ = ∀{A} → Hyp Δ A → Hyp Γ A -- A renaming r from Δ to Γ can be lifted to a renaming -- liftRen r from Δ ∙ A to Γ ∙ A which leaves the position -- of the new hypothesis A unchanged on the top. liftRen : ∀{Γ Δ A} (r : Ren Γ Δ) → Ren (Γ ∙ A) (Δ ∙ A) liftRen r x = {!!} -- Stability of derivations under renaming. ren : ∀{Γ Δ A} (r : Ren Δ Γ) (t : Γ ⊢ A) → Δ ⊢ A ren r t = {!!} -- Substitution Sub : (Γ Δ : Cxt) → Set Sub Γ Δ = ∀{A} → Hyp Δ A → Γ ⊢ A -- A substitution s from Δ to Γ can be lifted to a substitution -- liftSub s from Δ ∙ A to Γ ∙ A which leaves substitutes -- the top hypothesis A by itself. liftSub : ∀{Γ Δ A} (s : Sub Γ Δ) → Sub (Γ ∙ A) (Δ ∙ A) liftSub s x = {!!} -- Stability of derivations under substitution. subst : ∀{Γ Δ A} (s : Sub Δ Γ) (t : Γ ⊢ A) → Δ ⊢ A subst s t = {!!} -- -} -- -}