open Term
| n, vau t => FreeIn (n + 1) t
| n, vau0 t => FreeIn n t
| n, vau2 t => FreeIn n t
| n, wrap t => FreeIn n t
| n, eval t => FreeIn n t
| vau0 t => vau0 (rename rn t)
| vau2 t => vau2 (rename rn t)
| wrap t => wrap (rename rn t)
| eval t => eval (rename rn t)
| n + 1 => rename Nat.succ (sg n)
| vau0 t => vau0 (subst sg t)
| vau2 t => vau2 (subst sg t)
| wrap t => wrap (subst sg t)
| eval t => eval (subst sg t)
theorem lift_comp (rn xi : Nat -> Nat) : Function.comp (lift rn) (lift xi) = lift (Function.comp rn xi) := by¶ node
| _ => simp_all [rename]
theorem up_comp_lift (sg : Nat -> Term) (xi : Nat -> Nat) : Function.comp (up sg) (lift xi) = up (Function.comp sg xi) := by¶ node
| vau t ih => simp only [rename, subst, ih, up_comp_lift]
theorem lift_comp_succ (rn : Nat -> Nat) : Function.comp (lift rn) Nat.succ = Function.comp Nat.succ rn := by¶ node
simp only [Function.comp, up, rename_rename]
| vau t ih => simp only [rename, subst, ih, rename_comp_up]
theorem up_comp_succ (sg : Nat -> Term) : Function.comp (up sg) Nat.succ = Function.comp (rename Nat.succ) sg := by¶ node
simp only [Function.comp, up, subst_rename, rename_subst]
| vau t ih => simp only [subst, ih, subst_comp_up]
| _ => simp_all [subst]
| _ => simp_all [subst]
theorem up_var_comp (rn : Nat -> Nat) : up (Function.comp var rn) = Function.comp var (lift rn) := by¶ node
theorem rename_eq_subst (rn : Nat -> Nat) (t : Term) : rename rn t = subst (Function.comp var rn) t := by¶ node
| vau t ih => simp only [rename, subst, ih, up_var_comp]
simp only [inst, subst_subst]
simp only [Function.comp, scons, up, subst, subst_rename]
exact (subst_var (sg n)).symm
simp only [rename_eq_subst, subst_inst, up_var_comp]
theorem SelfEval.rename {s : Term} (rn : Nat -> Nat) (h : SelfEval s) : SelfEval (rename rn s) := by¶ node
theorem SelfEval.subst {s : Term} (sg : Nat -> Term) (h : SelfEval s) : SelfEval (subst sg s) := by¶ node
theorem IsValue.rename {v : Term} (rn : Nat -> Nat) (h : IsValue v) : IsValue (rename rn v) := by¶ node
theorem IsValue.subst {v : Term} {sg : Nat -> Term} (hsg : forall n, IsValue (sg n)) (h : IsValue v) :¶ node
theorem IsValue.up {sg : Nat -> Term} (hsg : forall n, IsValue (sg n)) : forall n, IsValue (up sg n)¶ node