21 B Basic properties on nominal rewriting In this section we show basic properties on nominal rewriting. We use the following facts. 0 0 I Proposition B.1. π·(π 0 ·t) = (π ◦ π 0 )·t and (tπ )π = tπ ◦π . I Proposition B.2 ([FG07]). π·(tσ) = (π·t)σ. I 1. 2. 3. 4. Proposition B.3 ([FG07]). ∇ ` a#t if and only if ∇ ` π·a#π·t. ∇ ` t ≈α s if and only if ∇ ` π·t ≈α π·s. If ∇ ` a#t and ∇ ` t ≈α s then ∇ ` a#s. ∀a ∈ ds(π, π 0 ). ∇ ` a#t if and only if ∇ ` π·t ≈α π 0 ·t. I Proposition B.4 ([FG07]). For any freshness context ∇, the binary relation ∇ ` − ≈α − is a congruence (i.e. an equivalence relation that is closed under any context C[ ]). I Lemma B.5. π·(tσ) = tπ (π·σ). Proof. By induction on t. Case t = a. Then π·(aσ) = π·a = π(a) = aπ = aπ (π·σ). Case t = τ ·X. Then π·((τ ·X)σ) = (π◦τ )·σ(X) = (π◦τ ◦π −1 ◦π)·σ(X) = (π◦τ ◦π −1 )·((π·σ)(X)) = (τ ·X)π (π·σ). Case t = f s. From induction hypothesis, we have π·((f s)σ) = f (π·sσ) = f (sπ (π·σ)) = (f sπ )(π·σ) = (f s)π (π·σ). Case t = (t1 , . . . , tn ). From induction hypothesis, we have π·((t1 , . . . , tn )σ) = (π·t1 σ, . . . , π·tn σ) = (tπ1 (π·σ), . . . , tπn (π·σ)) = (tπ1 , . . . , tπn )(π·σ) = (t1 , . . . , tn )π (π·σ). Case t = [a]s. From induction hypothesis, we have π·(([a]s)σ) = [π·a]π·sσ = [π·a]sπ (π·σ) = ([a]s)π (π·σ). J I Lemma B.6. If ∆ ` ∇σ then ∆ ` ∇π (π·σ). Proof. Let a#X ∈ ∇. By Lemma B.3(1), we have ∆ ` a#Xσ ⇐⇒ ∆ ` π·a#(π·Xσ) ⇐⇒ ∆ ` π·a#X(π·σ). Hence the claim follows. J I Lemma B.7. If ∆ ` s →hR,π,p,σi t then ∆ ` τ ·s →hR,τ ◦π,p,τ ·σi τ ·t. Proof. Suppose R = ∇ ` l → r and s = C[s0 ]p . We have ∆ ` ∇π σ, s0 ≈α lπ σ and t = C[rπ σ] by the definition of the rewrite relation. First, for α-equivalence part, by ∆ ` s0 ≈α lπ σ and Proposition B.3(2), we have ∆ ` τ ·s0 ≈α τ ·(lπ σ). Now, by Lemma B.5, we have τ ·(lπ σ) = lτ ◦π (τ ·σ). Thus, we have ∆ ` τ ·s0 ≈α lτ ◦π (τ ·σ). Next, for freshness constraints part, by ∆ ` ∇π σ and Lemma B.6, we have ∆ ` ∇τ ◦π (τ ·σ). Combining these properties, we have ∆ ` (τ ·C)[τ ·s0 ]p →hR,τ ◦π,p,τ ·σi (τ ·C)[rτ ◦π (τ ·σ)]p . Here, τ ·t = (τ ·C)[rτ ◦π (τ ·σ)] is followed from Lemma B.5. We also have τ ·s = (τ ·C)[τ ·s0 ]p . Thus, we obtain ∆ ` τ ·s →hR,τ ◦π,p,τ ·σi τ ·t as required. J I Lemma B.8 ([FG07]). Let R be a uniform nominal rewrite rule. If ∆ ` a#s and ∆ ` s →R t then ∆ ` a#t. I Lemma B.9 (Strong compatibility with ≈α ). Let R be a uniform nominal rewrite rule. If ∆ ` s0 ≈α s →hR,π,p,σi t then there exist π 0 , σ 0 and t0 such that ∆ ` s0 →hR,π0 ,p,σ0 i t0 ≈α t. Proof. By induction on the length of p. Suppose R = ∇ ` l → r. Case p = ε. By the definition of rewrite relation, we have s ≈α lπ σ. From the hypothesis, we have s0 ≈α lπ σ using transitivity of ≈α . Thus, the claim follows by taking π 0 = π, σ 0 = σ and t0 = t. 22 Case p = ip0 . For the cases s = f u and s = (u1 , . . . , un ), it is easily seen that the claim follows from the induction hypothesis. So we only consider the case s = [a]u. By the definition of the rewrite relation, we have u = C[v]p0 , ∆ ` v ≈α lπ σ, ∇π σ, t = [a]C[rπ σ]p0 . By the hypothesis ∆ ` [a]u ≈α s0 , we have s0 = [b]u0 from the rules for α-equivalence. For the case a = b, the claim follows from the induction hypothesis, so we only consider the case a 6= b. In this case, we have ∆ ` (a b)·u ≈α u0 , b#u from the rule for α-equivalence. By Proposition B.3(2), we have ∆ ` u ≈α (a b)·u0 . By the definition of the rewrite relation, we have ∆ ` u →hR,π,p0 ,σi C[rπ σ]p0 . Using the induction hypothesis for these properties, we have ∆ ` (a b)·u0 →hR,π̂,p0 ,σ̂i v 0 ≈α C[rπ σ]p0 for some π̂, σ̂, v 0 . Thus, by Lemma B.7, we have ∆ ` u0 →hR,(a b)◦π̂,p0 ,(a b)·σi (a b)·v 0 . By the definition of the rewrite relation, we have ∆ ` [b]u0 →hR,(a b)◦π̂,p,(a b)·σi [b](a b)·v 0 . Now, we consider ∆ ` u →hR,π,p0 ,σi C[rπ σ]p0 , b#u. By Proposition B.8, we have ∆ ` b#C[rπ σ]p0 and by ∆ ` v 0 ≈α C[rπ σ]p0 and Proposition B.3(2), we have ∆ ` (a b)·v 0 ≈α (a b)·C[rπ σ]p0 . From these properties, we have ∆ ` [a]C[rπ σ]p0 ≈α [b](a b)·v 0 by the rule for α-equivalence. Thus, we have ∆ ` [b]u0 →hR,(a b)◦π̂,p,(a b)·σ̂i [b](a b)·v 0 ≈α [a]C[rπ σ]p0 . Hence, the claim follows by taking π 0 = (a b) ◦ π̂, σ 0 = (a b)·σ̂ and t0 = [b](a b)·v 0 . J I Lemma B.10. 1. If Γ ` s ≈α t and ∆ ` Γσ then ∆ ` sσ ≈α tσ. 2. If Γ ` s →R t and ∆ ` Γσ then ∆ ` sσ →R tσ. Proof. 1. By induction on the derivation of Γ ` s ≈α t, similarly to the proof of Lemma 22 in [FG07]. If the last applied rule of the derivation is the one for moderated variables, then we use Lemma B.3(4). 2. Using 1, we can show the claim similarly to the proof of Theorem 49(2) in [FG07]. J I Lemma B.11. 1. If Γ ` s ≈α t and ∆ ` Γπ θ then ∆ ` C[sπ θ] ≈α C[tπ θ]. 2. If Γ ` s →R t and ∆ ` Γπ θ then ∆ ` C[sπ θ] →R C[tπ θ]. Proof. 1. Suppose Γ ` s ≈α t and ∆ ` Γπ θ. Then by Lemma B.6, we have ∆ ` Γ(π −1 ·θ), and so by Lemma B.10(1), we have ∆ ` s(π −1 ·θ) ≈α t(π −1 ·θ). Hence by Lemmas B.3(2) and B.5, we have ∆ ` sπ θ ≈α tπ θ, and by Lemma B.4, we obtain ∆ ` C[sπ θ] ≈α C[tπ θ]. 2. Similar, using Lemmas B.10(2) and B.7 instead of Lemmas B.10(1) and B.3(2). J References FG07 M. Fernández and M. J. Gabbay. Nominal rewriting. Information and Computation, 205:917–965, 2007.