Built with Alectryon, running Coq+SerAPI v8.17.0+0.17.1. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+πŸ–±οΈ to focus. On Mac, use ⌘ instead of Ctrl.
From OGS Require Import Prelude.
From OGS.Utils Require Import Psh Rel.
From OGS.Ctx Require Import All Ctx Covering Subset.
From OGS.ITree Require Import Event ITree Eq Delay Structure Properties.
From OGS.OGS Require Import Soundness.
Set Equations Transparent.

Inductive pre_ty : Type :=
| Zer : pre_ty
| One : pre_ty
| Prod : pre_ty -> pre_ty -> pre_ty
| Sum : pre_ty -> pre_ty -> pre_ty
| Arr : pre_ty -> pre_ty -> pre_ty
.
Notation "`0" := (Zer) : ty_scope.
Notation "`1" := (One) : ty_scope.
Notation "A `Γ— B" := (Prod A B) (at level 40) : ty_scope.
Notation "A `+ B" := (Sum A B) (at level 40) : ty_scope.
Notation "A `β†’ B" := (Arr A B) (at level 40) : ty_scope .

Variant ty : Type :=
| LTy : pre_ty -> ty
| RTy : pre_ty -> ty
.
Derive NoConfusion for ty.
Bind Scope ty_scope with ty.
#[global] Coercion LTy : pre_ty >-> ty.
#[global] Notation "↑ t" := (LTy t) (at level 5) : ty_scope .
#[global] Notation "Β¬ t" := (RTy t) (at level 5) : ty_scope .
Open Scope ty_scope.

Equations t_neg : ty -> ty :=
  t_neg ↑a := Β¬a ;
  t_neg Β¬a := ↑a .
Notation "a †" := (t_neg a) (at level 5) : ty_scope.

Definition t_ctx : Type := ctx ty.
Bind Scope ctx_scope with t_ctx.

Inductive term : t_ctx -> ty -> Type :=
| Val {Ξ“ A} : whn Ξ“ A -> term Ξ“ ↑A
| Mu {Ξ“ A} : state (Ξ“ β–Άβ‚“ Β¬A) -> term Ξ“ ↑A

| VarR {Ξ“ A} : Ξ“ βˆ‹ Β¬A -> term Ξ“ Β¬A
| MuT {Ξ“ A} : state (Ξ“ β–Άβ‚“ ↑A) -> term Ξ“ Β¬A

| Boom {Ξ“} : term Ξ“ Β¬`0
| Case {Ξ“ A B} : state (Ξ“ β–Άβ‚“ ↑A) -> state (Ξ“ β–Άβ‚“ ↑B) -> term Ξ“ Β¬(A `+ B)

| Fst {Ξ“ A B} : term Ξ“ Β¬A -> term Ξ“ Β¬(A `Γ— B)
| Snd {Ξ“ A B} : term Ξ“ Β¬B -> term Ξ“ Β¬(A `Γ— B)
| App {Ξ“ A B} : whn Ξ“ A -> term Ξ“ Β¬B -> term Ξ“ Β¬(A `β†’ B)

with whn : t_ctx -> pre_ty -> Type :=
| VarL {Ξ“ A} : Ξ“ βˆ‹ ↑A -> whn Ξ“ A

| Inl {Ξ“ A B} : whn Ξ“ A -> whn Ξ“ (A `+ B)
| Inr {Ξ“ A B} : whn Ξ“ B -> whn Ξ“ (A `+ B)

| Tt {Ξ“} : whn Ξ“ `1
| Pair {Ξ“ A B} : state (Ξ“ β–Άβ‚“ Β¬A) -> state (Ξ“ β–Άβ‚“ Β¬B) -> whn Ξ“ (A `Γ— B)
| Lam {Ξ“ A B} : state (Ξ“ β–Άβ‚“ ↑(A `β†’ B) β–Άβ‚“ ↑A β–Άβ‚“ Β¬B) -> whn Ξ“ (A `β†’ B)

with state : t_ctx -> Type :=
| Cut {Ξ“ A} : term Ξ“ ↑A -> term Ξ“ Β¬A -> state Ξ“
.

Definition Cut' {Ξ“ A} : term Ξ“ A -> term Ξ“ A† -> state Ξ“
  := match A with
     | ↑_ => fun x y => Cut x y
     | Β¬_ => fun x y => Cut y x
     end .

Equations val : t_ctx -> ty -> Type :=
  val Ξ“ ↑A := whn Ξ“ A ;
  val Ξ“ Β¬A := term Ξ“ Β¬A .

Equations Var Ξ“ A : Ξ“ βˆ‹ A -> val Ξ“ A :=
  Var _ ↑_ i := VarL i ;
  Var _ Β¬_ i := VarR i .
Arguments Var {Ξ“} [A] i.

Equations t_of_v Ξ“ A : val Ξ“ A -> term Ξ“ A :=
  t_of_v _ ↑_ v := Val v ;
  t_of_v _ Β¬_ k := k .
Arguments t_of_v [Ξ“ A] v.
Coercion t_of_v : val >-> term.

Equations t_rename : term ⇒₁ ⟦ c_var , term βŸ§β‚ :=
  t_rename _ _ (Mu c)     _ f := Mu (s_rename _ c _ (r_shift1 f)) ;
  t_rename _ _ (Val v)    _ f := Val (w_rename _ _ v _ f) ;
  t_rename _ _ (VarR i)   _ f := VarR (f _ i) ;
  t_rename _ _ (MuT c)    _ f := MuT (s_rename _ c _ (r_shift1 f)) ;
  t_rename _ _ (Boom)     _ f := Boom ;
  t_rename _ _ (App u k)  _ f := App (w_rename _ _ u _ f) (t_rename _ _ k _ f) ;
  t_rename _ _ (Fst k)    _ f := Fst (t_rename _ _ k _ f) ;
  t_rename _ _ (Snd k)    _ f := Snd (t_rename _ _ k _ f) ;
  t_rename _ _ (Case u v) _ f :=
    Case (s_rename _ u _ (r_shift1 f))
         (s_rename _ v _ (r_shift1 f))
with w_rename : whn ⇒₁ ⟦ c_var , val βŸ§β‚ :=
  w_rename _ _ (VarL i)   _ f := VarL (f _ i) ;
  w_rename _ _ (Tt)       _ f := Tt ;
  w_rename _ _ (Lam u)    _ f := Lam (s_rename _ u _ (r_shift3 f)) ;
  w_rename _ _ (Pair u v) _ f :=
    Pair (s_rename _ u _ (r_shift1 f))
         (s_rename _ v _ (r_shift1 f)) ;
  w_rename _ _ (Inl u)    _ f := Inl (w_rename _ _ u _ f) ;
  w_rename _ _ (Inr u)    _ f := Inr (w_rename _ _ u _ f)
with s_rename : state β‡’β‚€ ⟦ c_var , state βŸ§β‚€ :=
   s_rename _ (Cut v k) _ f := Cut (t_rename _ _ v _ f) (t_rename _ _ k _ f) .

Equations v_rename : val ⇒₁ ⟦ c_var , val βŸ§β‚ :=
  v_rename _ ↑_ v _ f := w_rename _ _ v _ f ;
  v_rename _ Β¬_ k _ f := t_rename _ _ k _ f .

Notation "t β‚œβŠ›α΅£ r" := (t_rename _ _ t _ r%asgn) (at level 14).
Notation "w `α΅₯βŠ›α΅£ r" := (w_rename _ _ w _ r%asgn) (at level 14).
Notation "v α΅₯βŠ›α΅£ r" := (v_rename _ _ v _ r%asgn) (at level 14).
Notation "s β‚›βŠ›α΅£ r" := (s_rename _ s _ r%asgn) (at level 14).

Definition a_ren {Ξ“1 Ξ“2 Ξ“3} : Ξ“1 =[val]> Ξ“2 -> Ξ“2 βŠ† Ξ“3 -> Ξ“1 =[val]> Ξ“3 :=
  fun f g _ i => v_rename _ _ (f _ i) _ g .
Arguments a_ren {_ _ _} _ _ _ _ /.
Notation "a βŠ›α΅£ r" := (a_ren a r%asgn) (at level 14) : asgn_scope.

Definition t_shift1 {Ξ“ A} : term Ξ“  β‡’α΅’ term (Ξ“ β–Άβ‚“ A) := fun _ t => t β‚œβŠ›α΅£ r_pop.
Definition w_shift1 {Ξ“ A} : whn Ξ“   β‡’α΅’ whn (Ξ“ β–Άβ‚“ A)  := fun _ w => w `α΅₯βŠ›α΅£ r_pop.
Definition s_shift1 {Ξ“ A} : state Ξ“ -> state (Ξ“ β–Άβ‚“ A) := fun s => s β‚›βŠ›α΅£ r_pop.
Definition v_shift1 {Ξ“ A} : val Ξ“   β‡’α΅’ val (Ξ“ β–Άβ‚“ A)  := fun _ v => v α΅₯βŠ›α΅£ r_pop.
Definition v_shift3 {Ξ“ A B C} : val Ξ“ β‡’α΅’ val (Ξ“ β–Άβ‚“ A β–Άβ‚“ B β–Άβ‚“ C)
  := fun _ v => v α΅₯βŠ›α΅£ (r_pop α΅£βŠ› r_pop α΅£βŠ› r_pop).
Definition a_shift1 {Ξ“ Ξ”} [A] (a : Ξ“ =[val]> Ξ”) : (Ξ“ β–Άβ‚“ A) =[val]> (Ξ” β–Άβ‚“ A)
  := [ fun _ i => v_shift1 _ (a _ i) ,β‚“ Var top ].
Definition a_shift3 {Ξ“ Ξ”} [A B C] (a : Ξ“ =[val]> Ξ”)
  : (Ξ“ β–Άβ‚“ A β–Άβ‚“ B β–Άβ‚“ C) =[val]> (Ξ” β–Άβ‚“ A β–Άβ‚“ B β–Άβ‚“ C)
  := [ [ [ fun _ i => v_shift3 _ (a _ i) ,β‚“
           Var (pop (pop top)) ] ,β‚“
         Var (pop top) ] ,β‚“
       Var top ].

Equations t_subst : term ⇒₁ ⟦ val , term βŸ§β‚ :=
  t_subst _ _ (Mu c)     _ f := Mu (s_subst _ c _ (a_shift1 f)) ;
  t_subst _ _ (Val v)    _ f := Val (w_subst _ _ v _ f) ;
  t_subst _ _ (VarR i)   _ f := f _ i ;
  t_subst _ _ (MuT c)    _ f := MuT (s_subst _ c _ (a_shift1 f)) ;
  t_subst _ _ (Boom)     _ f := Boom ;
  t_subst _ _ (App u k)  _ f := App (w_subst _ _ u _ f) (t_subst _ _ k _ f) ;
  t_subst _ _ (Fst k)    _ f := Fst (t_subst _ _ k _ f) ;
  t_subst _ _ (Snd k)    _ f := Snd (t_subst _ _ k _ f) ;
  t_subst _ _ (Case u v) _ f :=
    Case (s_subst _ u _ (a_shift1 f))
          (s_subst _ v _ (a_shift1 f))
with w_subst : forall Ξ“ A, whn Ξ“ A -> forall Ξ”, Ξ“ =[val]> Ξ” -> whn Ξ” A :=
  w_subst _ _ (VarL i)   _ f := f _ i ;
  w_subst _ _ (Tt)       _ f := Tt ;
  w_subst _ _ (Lam u)    _ f := Lam (s_subst _ u _ (a_shift3 f)) ;
  w_subst _ _ (Pair u v) _ f := Pair (s_subst _ u _ (a_shift1 f))
                                     (s_subst _ v _ (a_shift1 f)) ;
  w_subst _ _ (Inl u)    _ f := Inl (w_subst _ _ u _ f) ;
  w_subst _ _ (Inr u)    _ f := Inr (w_subst _ _ u _ f)
with s_subst : state β‡’β‚€ ⟦ val , state βŸ§β‚€ :=
   s_subst _ (Cut v k) _ f := Cut (t_subst _ _ v _ f) (t_subst _ _ k _ f) .

Notation "t `β‚œβŠ› a" := (t_subst _ _ t _ a%asgn) (at level 30).
Notation "w `α΅₯βŠ› a" := (w_subst _ _ w _ a%asgn) (at level 30).

Equations v_subst : val ⇒₁ ⟦ val , val βŸ§β‚ :=
  v_subst _ ↑_ v _ f := v `α΅₯βŠ› f ;
  v_subst _ Β¬_ k _ f := k `β‚œβŠ› f .

#[global] Instance val_monoid : subst_monoid val :=
  {| v_var := @Var ; v_sub := v_subst |} .
#[global] Instance state_module : subst_module val state :=
  {| c_sub := s_subst |} .

Definition asgn1 {Ξ“ A} (v : val Ξ“ A) : (Ξ“ β–Άβ‚“ A) =[val]> Ξ“
  := [ Var ,β‚“ v ] .
Definition asgn3 {Ξ“ A B C} (v1 : val Ξ“ A) (v2 : val Ξ“ B) (v3 : val Ξ“ C)
  : (Ξ“ β–Άβ‚“ A β–Άβ‚“ B β–Άβ‚“ C) =[val]> Ξ“
  := [ [ [ Var ,β‚“ v1 ] ,β‚“ v2 ] ,β‚“ v3 ].
Arguments asgn1 {_ _} & _.
Arguments asgn3 {_ _ _ _} & _ _.

Notation "₁[ v ]" := (asgn1 v).
Notation "₃[ v1 , v2 , v3 ]" := (asgn3 v1 v2 v3).

(*
Variant forcing0 (Ξ“ : t_ctx) : pre_ty -> Type :=
| FBoom : forcing0 Ξ“ Zer
| FApp {a b} : whn Ξ“ a -> term Ξ“ Β¬b -> forcing0 Ξ“ (a `β†’ b)
| FFst {a b} : term Ξ“ Β¬a -> forcing0 Ξ“ (a `Γ— b)
| FSnd {a b} : term Ξ“ Β¬b -> forcing0 Ξ“ (a `Γ— b)
| FCase {a b} : state (Ξ“ β–Άβ‚“ ↑a) -> state (Ξ“ β–Άβ‚“ ↑b) -> forcing0 Ξ“ (a `+ b)
.
Arguments FBoom {Ξ“}.
Arguments FApp {Ξ“ a b}.
Arguments FFst {Ξ“ a b}.
Arguments FSnd {Ξ“ a b}.
Arguments FCase {Ξ“ a b}.

Equations f0_subst {Ξ“ Ξ”} : Ξ“ =[val]> Ξ” -> forcing0 Ξ“ β‡’α΅’ forcing0 Ξ” :=
  f0_subst f a (FBoom)        := FBoom ;
  f0_subst f a (FApp v k)     := FApp (w_subst f _ v) (t_subst f _ k) ;
  f0_subst f a (FFst k)       := FFst (t_subst f _ k) ;
  f0_subst f a (FSnd k)       := FSnd (t_subst f _ k) ;
  f0_subst f a (FCase s1 s2) := FCase (s_subst (a_shift1 f) s1) (s_subst (a_shift1 f) s2) .

Equations forcing : t_ctx -> ty -> Type :=
  forcing Ξ“ (t+ a) := whn Ξ“ a ;
  forcing Ξ“ (t- a) := forcing0 Ξ“ a .

Equations f_subst {Ξ“ Ξ”} : Ξ“ =[val]> Ξ” -> forcing Ξ“ β‡’α΅’ forcing Ξ” :=
  f_subst s (t+ a) v := w_subst s a v ;
  f_subst s (t- a) f := f0_subst s a f .
*)

Equations is_neg_pre : pre_ty -> SProp :=
  is_neg_pre `0       := sEmpty ;
  is_neg_pre `1       := sUnit ;
  is_neg_pre (_ `Γ— _) := sUnit ;
  is_neg_pre (_ `+ _) := sEmpty ;
  is_neg_pre (_ `β†’ _) := sUnit .

Equations is_neg : ty -> SProp :=
  is_neg ↑a := is_neg_pre a ;
  is_neg Β¬a := sUnit .

Definition neg_ty : Type := sigS is_neg.
Definition neg_coe : neg_ty -> ty := sub_elt.
Global Coercion neg_coe : neg_ty >-> ty.

Definition neg_ctx : Type := ctxS ty t_ctx is_neg.
Definition neg_c_coe : neg_ctx -> ctx ty := sub_elt.
Global Coercion neg_c_coe : neg_ctx >-> ctx.

Bind Scope ctx_scope with neg_ctx.
Bind Scope ctx_scope with ctx.

Inductive pat : ty -> Type :=
| PTt : pat ↑`1
| PPair {a b} : pat ↑(a `Γ— b)
| PInl {a b} : pat ↑a -> pat ↑(a `+ b)
| PInr {a b} : pat ↑b -> pat ↑(a `+ b)
| PLam {a b} : pat ↑(a `β†’ b)
| PFst {a b} : pat Β¬(a `Γ— b)
| PSnd {a b} : pat Β¬(a `Γ— b)
| PApp {a b} : pat ↑a -> pat Β¬(a `β†’ b)
.

Equations pat_dom {t} : pat t -> neg_ctx :=
  pat_dom (PInl u) := pat_dom u ;
  pat_dom (PInr u) := pat_dom u ;
  pat_dom (PTt) := βˆ…β‚› β–Άβ‚› {| sub_elt := ↑`1 ; sub_prf := stt |} ;
  pat_dom (@PLam a b) := βˆ…β‚› β–Άβ‚› {| sub_elt := ↑(a `β†’ b) ; sub_prf := stt |} ;
  pat_dom (@PPair a b) := βˆ…β‚› β–Άβ‚› {| sub_elt := ↑(a `Γ— b) ; sub_prf := stt |} ;
  pat_dom (@PApp a b v) := pat_dom v β–Άβ‚› {| sub_elt := Β¬b ; sub_prf := stt |} ;
  pat_dom (@PFst a b) := βˆ…β‚› β–Άβ‚› {| sub_elt := Β¬a ; sub_prf := stt |} ;
  pat_dom (@PSnd a b) := βˆ…β‚› β–Άβ‚› {| sub_elt := Β¬b ; sub_prf := stt |} .

Definition op_pat : Oper ty neg_ctx :=
  {| o_op a := pat a ; o_dom _ p := (pat_dom p) |} .

Definition op_copat : Oper ty neg_ctx :=
  {| o_op a := pat (t_neg a) ; o_dom _ p := (pat_dom p) |} .

Definition bare_copat := op_copatβˆ™ .

Equations v_of_p {A} (p : pat A) : val (pat_dom p) A :=
  v_of_p (PInl u) := Inl (v_of_p u) ;
  v_of_p (PInr u) := Inr (v_of_p u) ;
  v_of_p (PTt) := VarL top ;
  v_of_p (PLam) := VarL top ;
  v_of_p (PPair) := VarL top ;
  v_of_p (PApp v) := App (v_shift1 _ (v_of_p v)) (VarR top) ;
  v_of_p (PFst) := Fst (VarR top) ;
  v_of_p (PSnd) := Snd (VarR top) .
Coercion v_of_p : pat >-> val.

Definition elim_var_zer {A : Type} {Ξ“ : neg_ctx} (i : Ξ“ βˆ‹ ↑ `0) : A
  := match s_prf i with end .
Definition elim_var_sum {A : Type} {Ξ“ : neg_ctx} {s t} (i : Ξ“ βˆ‹ ↑ (s `+ t)) : A
  := match s_prf i with end .

Equations p_of_w {Ξ“ : neg_ctx} a : whn Ξ“ a -> pat ↑a :=
  p_of_w (`0)     (VarL i) := elim_var_zer i ;
  p_of_w (a `+ b) (VarL i) := elim_var_sum i ;
  p_of_w (a `+ b) (Inl v)  := PInl (p_of_w _ v) ;
  p_of_w (a `+ b) (Inr v)  := PInr (p_of_w _ v) ;
  p_of_w (`1)     _        := PTt ;
  p_of_w (a `Γ— b) _        := PPair ;
  p_of_w (a `β†’ b) _        := PLam .

Equations p_dom_of_w {Ξ“ : neg_ctx} a (v : whn Ξ“ a) : pat_dom (p_of_w a v) =[val]> Ξ“ :=
  p_dom_of_w (`0)     (VarL i) := elim_var_zer i ;
  p_dom_of_w (a `+ b) (VarL i) := elim_var_sum i ;
  p_dom_of_w (a `+ b) (Inl v)  := p_dom_of_w a v ;
  p_dom_of_w (a `+ b) (Inr v)  := p_dom_of_w b v ;
  p_dom_of_w (`1)     v        := [ ! ,β‚“ v ] ;
  p_dom_of_w (a `β†’ b) v        := [ ! ,β‚“ v ] ;
  p_dom_of_w (a `Γ— b) v        := [ ! ,β‚“ v ] .

Program Definition w_split {Ξ“ : neg_ctx} a (v : whn Ξ“ a) : (op_copat # val) Ξ“ Β¬a
  := p_of_w _ v ⦇ p_dom_of_w _ v ⦈ .

Definition L_nf : Famβ‚€ ty neg_ctx := c_var βˆ₯β‚› (op_copat # val ).

(*
Definition n_rename {Ξ“ Ξ” : neg_ctx} : Ξ“ βŠ† Ξ” -> L_nf Ξ“ -> L_nf Ξ”
  := fun r n => r _ (nf_var n) β‹… nf_obs n ⦇ a_ren r (nf_args n) ⦈.
*)

(*
Definition nf0_eq {Ξ“ a} : relation (nf0 Ξ“ a) :=
  fun a b => exists H : projT1 a = projT1 b, rew H in projT2 a ≑ₐ projT2 b .

Definition nf_eq {Ξ“} : relation (nf Ξ“) :=
  fun a b => exists H : projT1 a = projT1 b,
      (rew H in fst (projT2 a) = fst (projT2 b)) /\ (nf0_eq (rew H in snd (projT2 a)) (snd (projT2 b))).

#[global] Instance nf0_eq_rfl {Ξ“ t} : Reflexive (@nf0_eq Ξ“ t) .
  intros [ m a ]; unshelve econstructor; auto.
Qed.

#[global] Instance nf0_eq_sym {Ξ“ t} : Symmetric (@nf0_eq Ξ“ t) .
  intros [ m1 a1 ] [ m2 a2 ] [ p q ]; unshelve econstructor; cbn in *.
  - now symmetry.
  - revert a1 q ; rewrite p; intros a1 q.
    now symmetry.
Qed.

#[global] Instance nf0_eq_tra {Ξ“ t} : Transitive (@nf0_eq Ξ“ t) .
  intros [ m1 a1 ] [ m2 a2 ] [ m3 a3 ] [ p1 q1 ] [ p2 q2 ]; unshelve econstructor; cbn in *.
  - now transitivity m2.
  - transitivity (rew [fun p : pat (t_neg t) => pat_dom p =[ val ]> Ξ“] p2 in a2); auto.
    now rewrite <- p2.
Qed.

#[global] Instance nf_eq_rfl {Ξ“} : Reflexiveα΅’ (fun _ : T1 => @nf_eq Ξ“) .
  intros _ [ x [ i n ] ].
  unshelve econstructor; auto.
Qed.

#[global] Instance nf_eq_sym {Ξ“} : Symmetricα΅’ (fun _ : T1 => @nf_eq Ξ“) .
  intros _ [ x1 [ i1 n1 ] ] [ x2 [ i2 n2 ] ] [ p [ q1 q2 ] ].
  unshelve econstructor; [ | split ]; cbn in *.
  - now symmetry.
  - revert i1 q1; rewrite p; intros i1 q1; now symmetry.
  - revert n1 q2; rewrite p; intros n1 q2; now symmetry.
Qed.

#[global] Instance nf_eq_tra {Ξ“} : Transitiveα΅’ (fun _ : T1 => @nf_eq Ξ“) .
  intros _ [ x1 [ i1 n1 ] ] [ x2 [ i2 n2 ] ] [ x3 [ i3 n3 ] ] [ p1 [ q1 r1 ] ] [ p2 [ q2 r2 ] ].
  unshelve econstructor; [ | split ]; cbn in *.
  - now transitivity x2.
  - transitivity (rew [has Ξ“] p2 in i2); auto.
    now rewrite <- p2.
  - transitivity (rew [nf0 Ξ“] p2 in n2); auto.
    now rewrite <- p2.
Qed.

Definition comp_eq {Ξ“} : relation (delay (nf Ξ“)) :=
  it_eq (fun _ : T1 => nf_eq) (i := T1_0) .
Notation "u ≋ v" := (comp_eq u v) (at level 40) .

Definition pat_of_nf : nf β‡’α΅’ pat' :=
  fun Ξ“ u => (projT1 u ,' (fst (projT2 u) , projT1 (snd (projT2 u)))) .
*)

Program Definition app_nf {Ξ“ : neg_ctx} {a b} (i : Ξ“ βˆ‹ ↑(a `β†’ b))
  (v : whn Ξ“ a) (k : term Ξ“ Β¬b) : L_nf Ξ“
  := i β‹… PApp (p_of_w _ v) ⦇ [ p_dom_of_w _ v ,β‚“ (k : val _ Β¬_) ] ⦈ .

Program Definition fst_nf {Ξ“ : neg_ctx} {a b} (i : Ξ“ βˆ‹ ↑(a `Γ— b))
  (k : term Ξ“ Β¬a) : L_nf Ξ“
  := i β‹… PFst ⦇ [ ! ,β‚“ (k : val _ Β¬_) ] ⦈ .

Program Definition snd_nf {Ξ“ : neg_ctx} {a b} (i : Ξ“ βˆ‹ ↑(a `Γ— b))
  (k : term Ξ“ Β¬b) : L_nf Ξ“
  := i β‹… PSnd ⦇ [ ! ,β‚“ (k : val _ Β¬_) ] ⦈ .

Equations eval_aux {Ξ“ : neg_ctx} : state Ξ“ -> (state Ξ“ + L_nf Ξ“) :=
  eval_aux (Cut (Mu s)           (k))        := inl (s β‚œβŠ› ₁[ k ]) ;
  eval_aux (Cut (Val v)          (MuT s))    := inl (s β‚œβŠ› ₁[ v ]) ;

  eval_aux (Cut (Val v)          (VarR i))   := inr (s_var_upg i β‹… w_split _ v) ;

  eval_aux (Cut (Val (VarL i))   (Boom))     := elim_var_zer i ;
  eval_aux (Cut (Val (VarL i))   (Case s t)) := elim_var_sum i ;

  eval_aux (Cut (Val (VarL i))   (App v k))  := inr (app_nf i v k) ;
  eval_aux (Cut (Val (VarL i))   (Fst k))    := inr (fst_nf i k) ;
  eval_aux (Cut (Val (VarL i))   (Snd k))    := inr (snd_nf i k) ;


  eval_aux (Cut (Val (Lam s))    (App v k))  := inl (s β‚œβŠ› ₃[ Lam s , v , k ]) ;
  eval_aux (Cut (Val (Pair s t)) (Fst k))    := inl (s β‚œβŠ› ₁[ k ]) ;
  eval_aux (Cut (Val (Pair s t)) (Snd k))    := inl (t β‚œβŠ› ₁[ k ]) ;
  eval_aux (Cut (Val (Inl u))    (Case s t)) := inl (s β‚œβŠ› ₁[ u ]) ;
  eval_aux (Cut (Val (Inr u))    (Case s t)) := inl (t β‚œβŠ› ₁[ u ]) .

Definition eval {Ξ“ : neg_ctx} : state Ξ“ -> delay (L_nf Ξ“)
  := iter_delay (fun c => Ret' (eval_aux c)).

(*
Definition refold {Ξ“ : neg_ctx} (p : nf Ξ“)
  : (Ξ“ βˆ‹ (projT1 p) * val Ξ“ (t_neg (projT1 p)))%type.
destruct p as [x [i [ p s ]]]; cbn in *.
exact (i , v_subst s _ (v_of_p p)).
Defined.
*)

Definition p_app {Ξ“ A} (v : val Ξ“ A) (m : pat A†) (e : pat_dom m =[val]> Ξ“) : state Ξ“
  := Cut' v (m `β‚œβŠ› e) .

(*
Definition emb {Ξ“} (m : pat' Ξ“) : state (Ξ“ +β–Άβ‚“ pat_dom' Ξ“ m) .
  destruct m as [a [i v]]; cbn in *.
  destruct a.
  - refine (Cut _ _).
    + refine (Val (VarL (r_concat_l _ i))).
    + refine (t_rename r_concat_r _ (v_of_p v)).
  - refine (Cut _ _).
    + refine (Val (v_rename r_concat_r _ (v_of_p v))).
    + refine (VarR (r_concat_l _ i)).
Defined.
*)

Scheme term_mut := Induction for term Sort Prop
  with whn_mut := Induction for whn Sort Prop
  with state_mut := Induction for state Sort Prop.

Record syn_ind_args (Pt : forall Ξ“ A, term Ξ“ A -> Prop)
                    (Pv : forall Ξ“ A, whn Ξ“ A -> Prop)
                    (Ps : forall Ξ“, state Ξ“ -> Prop) :=
{
  ind_s_mu : forall Ξ“ A s, Ps _ s -> Pt Ξ“ ↑A (Mu s) ;
  ind_s_val : forall Ξ“ A v, Pv _ _ v -> Pt Ξ“ ↑A (Val v) ;
  ind_s_varn : forall Ξ“ A i, Pt Ξ“ Β¬A (VarR i) ;
  ind_s_mut : forall Ξ“ A s, Ps _ s -> Pt Ξ“ Β¬A (MuT s) ;
  ind_s_zer : forall Ξ“, Pt Ξ“ Β¬`0 Boom ;
  ind_s_app : forall Ξ“ A B, forall v, Pv _ _ v -> forall k, Pt _ _ k -> Pt Ξ“ Β¬(A `β†’ B) (App v k) ;
  ind_s_fst : forall Ξ“ A B, forall k, Pt _ _ k -> Pt Ξ“ Β¬(A `Γ— B) (Fst k) ;
  ind_s_snd : forall Ξ“ A B, forall k, Pt _ _ k -> Pt Ξ“ Β¬(A `Γ— B) (Snd k) ;
  ind_s_match : forall Ξ“ A B, forall s, Ps _ s -> forall t, Ps _ t -> Pt Ξ“ Β¬(A `+ B) (Case s t) ;
  ind_s_varp : forall Ξ“ A i, Pv Ξ“ A (VarL i) ;
  ind_s_inl : forall Ξ“ A B v, Pv _ _ v -> Pv Ξ“ (A `+ B) (Inl v) ;
  ind_s_inr : forall Ξ“ A B v, Pv _ _ v -> Pv Ξ“ (A `+ B) (Inr v) ;
  ind_s_onei : forall Ξ“, Pv Ξ“ `1 Tt ;
  ind_s_lam : forall Ξ“ A B s, Ps _ s -> Pv Ξ“ (A `β†’ B) (Lam s) ;
  ind_s_pair : forall Ξ“ A B, forall s, Ps _ s -> forall t, Ps _ t -> Pv Ξ“ (A `Γ— B) (Pair s t) ;
  ind_s_cut : forall Ξ“ A, forall u, Pt _ _ u -> forall v, Pt _ _ v -> Ps Ξ“ (@Cut _ A u v)
} .

Pt: forall (Ξ“ : t_ctx) (A : ty), term Ξ“ A -> Prop
Pv: forall (Ξ“ : t_ctx) (A : pre_ty), whn Ξ“ A -> Prop
Ps: forall Ξ“ : t_ctx, state Ξ“ -> Prop
arg: syn_ind_args Pt Pv Ps
Ξ“: t_ctx
A: ty
u: term Ξ“ A

Pt Ξ“ A u
destruct arg; now apply (term_mut Pt Pv Ps). Qed.
Pt: forall (Ξ“ : t_ctx) (A : ty), term Ξ“ A -> Prop
Pv: forall (Ξ“ : t_ctx) (A : pre_ty), whn Ξ“ A -> Prop
Ps: forall Ξ“ : t_ctx, state Ξ“ -> Prop
arg: syn_ind_args Pt Pv Ps
Ξ“: t_ctx
A: pre_ty
v: whn Ξ“ A

Pv Ξ“ A v
destruct arg; now apply (whn_mut Pt Pv Ps). Qed.
Pt: forall (Ξ“ : t_ctx) (A : ty), term Ξ“ A -> Prop
Pv: forall (Ξ“ : t_ctx) (A : pre_ty), whn Ξ“ A -> Prop
Ps: forall Ξ“ : t_ctx, state Ξ“ -> Prop
arg: syn_ind_args Pt Pv Ps
Ξ“: t_ctx
s: state Ξ“

Ps Ξ“ s
destruct arg; now apply (state_mut Pt Pv Ps). Qed. Definition t_ren_proper_P Ξ“ A (t : term Ξ“ A) : Prop := forall Ξ” (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> t β‚œβŠ›α΅£ f1 = t β‚œβŠ›α΅£ f2 . Definition w_ren_proper_P Ξ“ A (v : whn Ξ“ A) : Prop := forall Ξ” (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> v `α΅₯βŠ›α΅£ f1 = v `α΅₯βŠ›α΅£ f2 . Definition s_ren_proper_P Ξ“ (s : state Ξ“) : Prop := forall Ξ” (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2 .

syn_ind_args t_ren_proper_P w_ren_proper_P s_ren_proper_P

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), s_ren_proper_P (Ξ“ β–Άβ‚“ Β¬ A) s -> t_ren_proper_P Ξ“ ↑ A (Mu s)

forall (Ξ“ : t_ctx) (A : pre_ty) (v : whn Ξ“ A), w_ren_proper_P Ξ“ A v -> t_ren_proper_P Ξ“ ↑ A (Val v)

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ Β¬ A), t_ren_proper_P Ξ“ Β¬ A (VarR i)

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), s_ren_proper_P (Ξ“ β–Άβ‚“ ↑ A) s -> t_ren_proper_P Ξ“ Β¬ A (MuT s)

forall Ξ“ : t_ctx, t_ren_proper_P Ξ“ Β¬ `0 Boom

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), w_ren_proper_P Ξ“ A v -> forall k : term Ξ“ Β¬ B, t_ren_proper_P Ξ“ Β¬ B k -> t_ren_proper_P Ξ“ Β¬ (A `β†’ B) (App v k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ A), t_ren_proper_P Ξ“ Β¬ A k -> t_ren_proper_P Ξ“ Β¬ (A `Γ— B) (Fst k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ B), t_ren_proper_P Ξ“ Β¬ B k -> t_ren_proper_P Ξ“ Β¬ (A `Γ— B) (Snd k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), s_ren_proper_P (Ξ“ β–Άβ‚“ ↑ A) s -> forall t : state (Ξ“ β–Άβ‚“ ↑ B), s_ren_proper_P (Ξ“ β–Άβ‚“ ↑ B) t -> t_ren_proper_P Ξ“ Β¬ (A `+ B) (Case s t)

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ ↑ A), w_ren_proper_P Ξ“ A (VarL i)

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), w_ren_proper_P Ξ“ A v -> w_ren_proper_P Ξ“ (A `+ B) (Inl v)

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ B), w_ren_proper_P Ξ“ B v -> w_ren_proper_P Ξ“ (A `+ B) (Inr v)

forall Ξ“ : t_ctx, w_ren_proper_P Ξ“ `1 Tt

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)), s_ren_proper_P (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) s -> w_ren_proper_P Ξ“ (A `β†’ B) (Lam s)

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), s_ren_proper_P (Ξ“ β–Άβ‚“ Β¬ A) s -> forall t : state (Ξ“ β–Άβ‚“ Β¬ B), s_ren_proper_P (Ξ“ β–Άβ‚“ Β¬ B) t -> w_ren_proper_P Ξ“ (A `Γ— B) (Pair s t)

forall (Ξ“ : t_ctx) (A : pre_ty) (u : term Ξ“ ↑ A), t_ren_proper_P Ξ“ ↑ A u -> forall v : term Ξ“ Β¬ A, t_ren_proper_P Ξ“ Β¬ A v -> s_ren_proper_P Ξ“ (Cut u v)

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), (forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ A) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> Mu s β‚œβŠ›α΅£ f1 = Mu s β‚œβŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A : pre_ty) (v : whn Ξ“ A), (forall (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> v `α΅₯βŠ›α΅£ f1 = v `α΅₯βŠ›α΅£ f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> Val v β‚œβŠ›α΅£ f1 = Val v β‚œβŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ Β¬ A) (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> VarR i β‚œβŠ›α΅£ f1 = VarR i β‚œβŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), (forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ A) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> MuT s β‚œβŠ›α΅£ f1 = MuT s β‚œβŠ›α΅£ f2

forall (Ξ“ Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> Boom β‚œβŠ›α΅£ f1 = Boom β‚œβŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), (forall (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> v `α΅₯βŠ›α΅£ f1 = v `α΅₯βŠ›α΅£ f2) -> forall k : term Ξ“ Β¬ B, (forall (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> k β‚œβŠ›α΅£ f1 = k β‚œβŠ›α΅£ f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> App v k β‚œβŠ›α΅£ f1 = App v k β‚œβŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ A), (forall (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> k β‚œβŠ›α΅£ f1 = k β‚œβŠ›α΅£ f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> Fst k β‚œβŠ›α΅£ f1 = Fst k β‚œβŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ B), (forall (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> k β‚œβŠ›α΅£ f1 = k β‚œβŠ›α΅£ f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> Snd k β‚œβŠ›α΅£ f1 = Snd k β‚œβŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), (forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ A) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2) -> forall t : state (Ξ“ β–Άβ‚“ ↑ B), (forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ B) βŠ† Ξ”), f1 ≑ₐ f2 -> t β‚›βŠ›α΅£ f1 = t β‚›βŠ›α΅£ f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> Case s t β‚œβŠ›α΅£ f1 = Case s t β‚œβŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ ↑ A) (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> VarL i `α΅₯βŠ›α΅£ f1 = VarL i `α΅₯βŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), (forall (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> v `α΅₯βŠ›α΅£ f1 = v `α΅₯βŠ›α΅£ f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> Inl v `α΅₯βŠ›α΅£ f1 = Inl v `α΅₯βŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ B), (forall (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> v `α΅₯βŠ›α΅£ f1 = v `α΅₯βŠ›α΅£ f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> Inr v `α΅₯βŠ›α΅£ f1 = Inr v `α΅₯βŠ›α΅£ f2

forall (Ξ“ Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> Tt `α΅₯βŠ›α΅£ f1 = Tt `α΅₯βŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)), (forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> Lam s `α΅₯βŠ›α΅£ f1 = Lam s `α΅₯βŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), (forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ A) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2) -> forall t : state (Ξ“ β–Άβ‚“ Β¬ B), (forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ B) βŠ† Ξ”), f1 ≑ₐ f2 -> t β‚›βŠ›α΅£ f1 = t β‚›βŠ›α΅£ f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> Pair s t `α΅₯βŠ›α΅£ f1 = Pair s t `α΅₯βŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A : pre_ty) (u : term Ξ“ ↑ A), (forall (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> u β‚œβŠ›α΅£ f1 = u β‚œβŠ›α΅£ f2) -> forall v : term Ξ“ Β¬ A, (forall (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> v β‚œβŠ›α΅£ f1 = v β‚œβŠ›α΅£ f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ βŠ† Ξ”), f1 ≑ₐ f2 -> Cut u v β‚›βŠ›α΅£ f1 = Cut u v β‚›βŠ›α΅£ f2
Ξ“: t_ctx
A: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ A) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H0: f1 ≑ₐ f2

s β‚›βŠ›α΅£ r_shift1 f1 = s β‚›βŠ›α΅£ r_shift1 f2
Ξ“: t_ctx
A: pre_ty
i: Ξ“ βˆ‹ Β¬ A
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H: f1 ≑ₐ f2
f1 Β¬ A i = f2 Β¬ A i
Ξ“: t_ctx
A: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ A) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H0: f1 ≑ₐ f2
s β‚›βŠ›α΅£ r_shift1 f1 = s β‚›βŠ›α΅£ r_shift1 f2
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ A) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2
t: state (Ξ“ β–Άβ‚“ ↑ B)
H0: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ B) βŠ† Ξ”), f1 ≑ₐ f2 -> t β‚›βŠ›α΅£ f1 = t β‚›βŠ›α΅£ f2
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H1: f1 ≑ₐ f2
s β‚›βŠ›α΅£ r_shift1 f1 = s β‚›βŠ›α΅£ r_shift1 f2
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ A) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2
t: state (Ξ“ β–Άβ‚“ ↑ B)
H0: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ B) βŠ† Ξ”), f1 ≑ₐ f2 -> t β‚›βŠ›α΅£ f1 = t β‚›βŠ›α΅£ f2
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H1: f1 ≑ₐ f2
t β‚›βŠ›α΅£ r_shift1 f1 = t β‚›βŠ›α΅£ r_shift1 f2
Ξ“: t_ctx
A: pre_ty
i: Ξ“ βˆ‹ ↑ A
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H: f1 ≑ₐ f2
f1 ↑ A i = f2 ↑ A i
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H0: f1 ≑ₐ f2
s β‚›βŠ›α΅£ r_shift3 f1 = s β‚›βŠ›α΅£ r_shift3 f2
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ A) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2
t: state (Ξ“ β–Άβ‚“ Β¬ B)
H0: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ B) βŠ† Ξ”), f1 ≑ₐ f2 -> t β‚›βŠ›α΅£ f1 = t β‚›βŠ›α΅£ f2
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H1: f1 ≑ₐ f2
s β‚›βŠ›α΅£ r_shift1 f1 = s β‚›βŠ›α΅£ r_shift1 f2
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ A) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2
t: state (Ξ“ β–Άβ‚“ Β¬ B)
H0: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ B) βŠ† Ξ”), f1 ≑ₐ f2 -> t β‚›βŠ›α΅£ f1 = t β‚›βŠ›α΅£ f2
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H1: f1 ≑ₐ f2
t β‚›βŠ›α΅£ r_shift1 f1 = t β‚›βŠ›α΅£ r_shift1 f2
Ξ“: t_ctx
A: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ A) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H0: f1 ≑ₐ f2

s β‚›βŠ›α΅£ r_shift1 f1 = s β‚›βŠ›α΅£ r_shift1 f2
Ξ“: t_ctx
A: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ A) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H0: f1 ≑ₐ f2
s β‚›βŠ›α΅£ r_shift1 f1 = s β‚›βŠ›α΅£ r_shift1 f2
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ A) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2
t: state (Ξ“ β–Άβ‚“ ↑ B)
H0: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ B) βŠ† Ξ”), f1 ≑ₐ f2 -> t β‚›βŠ›α΅£ f1 = t β‚›βŠ›α΅£ f2
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H1: f1 ≑ₐ f2
s β‚›βŠ›α΅£ r_shift1 f1 = s β‚›βŠ›α΅£ r_shift1 f2
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ A) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2
t: state (Ξ“ β–Άβ‚“ ↑ B)
H0: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ B) βŠ† Ξ”), f1 ≑ₐ f2 -> t β‚›βŠ›α΅£ f1 = t β‚›βŠ›α΅£ f2
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H1: f1 ≑ₐ f2
t β‚›βŠ›α΅£ r_shift1 f1 = t β‚›βŠ›α΅£ r_shift1 f2
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H0: f1 ≑ₐ f2
s β‚›βŠ›α΅£ r_shift3 f1 = s β‚›βŠ›α΅£ r_shift3 f2
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ A) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2
t: state (Ξ“ β–Άβ‚“ Β¬ B)
H0: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ B) βŠ† Ξ”), f1 ≑ₐ f2 -> t β‚›βŠ›α΅£ f1 = t β‚›βŠ›α΅£ f2
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H1: f1 ≑ₐ f2
s β‚›βŠ›α΅£ r_shift1 f1 = s β‚›βŠ›α΅£ r_shift1 f2
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ A) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2
t: state (Ξ“ β–Άβ‚“ Β¬ B)
H0: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ B) βŠ† Ξ”), f1 ≑ₐ f2 -> t β‚›βŠ›α΅£ f1 = t β‚›βŠ›α΅£ f2
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H1: f1 ≑ₐ f2
t β‚›βŠ›α΅£ r_shift1 f1 = t β‚›βŠ›α΅£ r_shift1 f2
Ξ“: t_ctx
A: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ A) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H0: f1 ≑ₐ f2

r_shift1 f1 ≑ₐ r_shift1 f2
Ξ“: t_ctx
A: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ A) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H0: f1 ≑ₐ f2
r_shift1 f1 ≑ₐ r_shift1 f2
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ A) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2
t: state (Ξ“ β–Άβ‚“ ↑ B)
H0: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ B) βŠ† Ξ”), f1 ≑ₐ f2 -> t β‚›βŠ›α΅£ f1 = t β‚›βŠ›α΅£ f2
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H1: f1 ≑ₐ f2
r_shift1 f1 ≑ₐ r_shift1 f2
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ A) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2
t: state (Ξ“ β–Άβ‚“ ↑ B)
H0: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ B) βŠ† Ξ”), f1 ≑ₐ f2 -> t β‚›βŠ›α΅£ f1 = t β‚›βŠ›α΅£ f2
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H1: f1 ≑ₐ f2
r_shift1 f1 ≑ₐ r_shift1 f2
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H0: f1 ≑ₐ f2
r_shift3 f1 ≑ₐ r_shift3 f2
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ A) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2
t: state (Ξ“ β–Άβ‚“ Β¬ B)
H0: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ B) βŠ† Ξ”), f1 ≑ₐ f2 -> t β‚›βŠ›α΅£ f1 = t β‚›βŠ›α΅£ f2
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H1: f1 ≑ₐ f2
r_shift1 f1 ≑ₐ r_shift1 f2
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ A) βŠ† Ξ”), f1 ≑ₐ f2 -> s β‚›βŠ›α΅£ f1 = s β‚›βŠ›α΅£ f2
t: state (Ξ“ β–Άβ‚“ Β¬ B)
H0: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ B) βŠ† Ξ”), f1 ≑ₐ f2 -> t β‚›βŠ›α΅£ f1 = t β‚›βŠ›α΅£ f2
Ξ”: t_ctx
f1, f2: Ξ“ βŠ† Ξ”
H1: f1 ≑ₐ f2
r_shift1 f1 ≑ₐ r_shift1 f2
all: first [ apply r_shift1_eq | apply r_shift3_eq ]; auto. Qed.
Ξ“: t_ctx
a: ty
t: term Ξ“ a
Ξ”: t_ctx

Proper (asgn_eq Ξ“ Ξ” ==> eq) (t_rename Ξ“ a t Ξ”)
intros f1 f2 H1; now apply (term_ind_mut _ _ _ ren_proper_prf). Qed.
Ξ“: t_ctx
a: pre_ty
v: whn Ξ“ a
Ξ”: t_ctx

Proper (asgn_eq Ξ“ Ξ” ==> eq) (w_rename Ξ“ a v Ξ”)
intros f1 f2 H1; now apply (whn_ind_mut _ _ _ ren_proper_prf). Qed.
Ξ“: t_ctx
s: state Ξ“
Ξ”: t_ctx

Proper (asgn_eq Ξ“ Ξ” ==> eq) (s_rename Ξ“ s Ξ”)
intros f1 f2 H1; now apply (state_ind_mut _ _ _ ren_proper_prf). Qed.
Ξ“: t_ctx
a: ty
v: val Ξ“ a
Ξ”: t_ctx

Proper (asgn_eq Ξ“ Ξ” ==> eq) (v_rename Ξ“ a v Ξ”)
Ξ“: t_ctx
p: pre_ty
v: val Ξ“ ↑ p
Ξ”: t_ctx

Proper (asgn_eq Ξ“ Ξ” ==> eq) (v_rename Ξ“ ↑ p v Ξ”)
Ξ“: t_ctx
p: pre_ty
v: val Ξ“ Β¬ p
Ξ”: t_ctx
Proper (asgn_eq Ξ“ Ξ” ==> eq) (v_rename Ξ“ Β¬ p v Ξ”)
Ξ“: t_ctx
p: pre_ty
v: val Ξ“ Β¬ p
Ξ”: t_ctx

Proper (asgn_eq Ξ“ Ξ” ==> eq) (v_rename Ξ“ Β¬ p v Ξ”)
now apply t_ren_eq. Qed.
Ξ“1, Ξ“2, Ξ“3: t_ctx

Proper (asgn_eq Ξ“1 Ξ“2 ==> asgn_eq Ξ“2 Ξ“3 ==> asgn_eq Ξ“1 Ξ“3) a_ren
intros r1 r2 H1 a1 a2 H2 ? i; cbn; now rewrite H1, (v_ren_eq _ _ H2). Qed.
Ξ“, Ξ”: t_ctx
A: ty

Proper (asgn_eq Ξ“ Ξ” ==> asgn_eq (Ξ“ β–Άβ‚“ A) (Ξ” β–Άβ‚“ A)) (a_shift1 (A:=A))
Ξ“, Ξ”: t_ctx
A: ty
x, y: Ξ“ =[ val ]> Ξ”
H: x ≑ₐ y
a: ty
h: Ξ“ β–Άβ‚“ A βˆ‹ a

a_shift1 x a h = a_shift1 y a h
dependent elimination h; auto; cbn; now rewrite H. Qed.
Ξ“, Ξ”: t_ctx
A, B, C: ty

Proper (asgn_eq Ξ“ Ξ” ==> asgn_eq (Ξ“ β–Άβ‚“ A β–Άβ‚“ B β–Άβ‚“ C) (Ξ” β–Άβ‚“ A β–Άβ‚“ B β–Άβ‚“ C)) (a_shift3 (C:=C))
Ξ“, Ξ”: t_ctx
A, B, C: ty
x, y: Ξ“ =[ val ]> Ξ”
H: x ≑ₐ y
a: ty
v: Ξ“ β–Άβ‚“ A β–Άβ‚“ B β–Άβ‚“ C βˆ‹ a

a_shift3 x a v = a_shift3 y a v
Ξ“1: ctx ty
Ξ”: t_ctx
y2, y1, y0: ty
x, y: Ξ“1 =[ val ]> Ξ”
H: x ≑ₐ y
a: ty
v: var a Ξ“1

a_shift3 x a (pop (pop (pop v))) = a_shift3 y a (pop (pop (pop v)))
cbn; now rewrite H. Qed. Definition t_ren_ren_P Ξ“1 A (t : term Ξ“1 A) : Prop := forall Ξ“2 Ξ“3 (f1 : Ξ“1 βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (t β‚œβŠ›α΅£ f1) β‚œβŠ›α΅£ f2 = t β‚œβŠ›α΅£ (f1 α΅£βŠ› f2) . Definition w_ren_ren_P Ξ“1 A (v : whn Ξ“1 A) : Prop := forall Ξ“2 Ξ“3 (f1 : Ξ“1 βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (v `α΅₯βŠ›α΅£ f1) `α΅₯βŠ›α΅£ f2 = v `α΅₯βŠ›α΅£ (f1 α΅£βŠ› f2) . Definition s_ren_ren_P Ξ“1 (s : state Ξ“1) : Prop := forall Ξ“2 Ξ“3 (f1 : Ξ“1 βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚›βŠ›α΅£ f1) β‚›βŠ›α΅£ f2 = s β‚›βŠ›α΅£ (f1 α΅£βŠ› f2) .

syn_ind_args t_ren_ren_P w_ren_ren_P s_ren_ren_P

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), s_ren_ren_P (Ξ“ β–Άβ‚“ Β¬ A) s -> t_ren_ren_P Ξ“ ↑ A (Mu s)

forall (Ξ“ : t_ctx) (A : pre_ty) (v : whn Ξ“ A), w_ren_ren_P Ξ“ A v -> t_ren_ren_P Ξ“ ↑ A (Val v)

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ Β¬ A), t_ren_ren_P Ξ“ Β¬ A (VarR i)

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), s_ren_ren_P (Ξ“ β–Άβ‚“ ↑ A) s -> t_ren_ren_P Ξ“ Β¬ A (MuT s)

forall Ξ“ : t_ctx, t_ren_ren_P Ξ“ Β¬ `0 Boom

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), w_ren_ren_P Ξ“ A v -> forall k : term Ξ“ Β¬ B, t_ren_ren_P Ξ“ Β¬ B k -> t_ren_ren_P Ξ“ Β¬ (A `β†’ B) (App v k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ A), t_ren_ren_P Ξ“ Β¬ A k -> t_ren_ren_P Ξ“ Β¬ (A `Γ— B) (Fst k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ B), t_ren_ren_P Ξ“ Β¬ B k -> t_ren_ren_P Ξ“ Β¬ (A `Γ— B) (Snd k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), s_ren_ren_P (Ξ“ β–Άβ‚“ ↑ A) s -> forall t : state (Ξ“ β–Άβ‚“ ↑ B), s_ren_ren_P (Ξ“ β–Άβ‚“ ↑ B) t -> t_ren_ren_P Ξ“ Β¬ (A `+ B) (Case s t)

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ ↑ A), w_ren_ren_P Ξ“ A (VarL i)

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), w_ren_ren_P Ξ“ A v -> w_ren_ren_P Ξ“ (A `+ B) (Inl v)

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ B), w_ren_ren_P Ξ“ B v -> w_ren_ren_P Ξ“ (A `+ B) (Inr v)

forall Ξ“ : t_ctx, w_ren_ren_P Ξ“ `1 Tt

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)), s_ren_ren_P (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) s -> w_ren_ren_P Ξ“ (A `β†’ B) (Lam s)

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), s_ren_ren_P (Ξ“ β–Άβ‚“ Β¬ A) s -> forall t : state (Ξ“ β–Άβ‚“ Β¬ B), s_ren_ren_P (Ξ“ β–Άβ‚“ Β¬ B) t -> w_ren_ren_P Ξ“ (A `Γ— B) (Pair s t)

forall (Ξ“ : t_ctx) (A : pre_ty) (u : term Ξ“ ↑ A), t_ren_ren_P Ξ“ ↑ A u -> forall v : term Ξ“ Β¬ A, t_ren_ren_P Ξ“ Β¬ A v -> s_ren_ren_P Ξ“ (Cut u v)

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ A) βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚›βŠ›α΅£ f1) β‚›βŠ›α΅£ f2 = s β‚›βŠ›α΅£ (f1 α΅£βŠ› f2)) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Mu s β‚œβŠ›α΅£ f1) β‚œβŠ›α΅£ f2 = Mu s β‚œβŠ›α΅£ (f1 α΅£βŠ› f2)

forall (Ξ“ : t_ctx) (A : pre_ty) (v : whn Ξ“ A), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (v `α΅₯βŠ›α΅£ f1) `α΅₯βŠ›α΅£ f2 = v `α΅₯βŠ›α΅£ (f1 α΅£βŠ› f2)) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Val v β‚œβŠ›α΅£ f1) β‚œβŠ›α΅£ f2 = Val v β‚œβŠ›α΅£ (f1 α΅£βŠ› f2)

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ Β¬ A) (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (VarR i β‚œβŠ›α΅£ f1) β‚œβŠ›α΅£ f2 = VarR i β‚œβŠ›α΅£ (f1 α΅£βŠ› f2)

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ A) βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚›βŠ›α΅£ f1) β‚›βŠ›α΅£ f2 = s β‚›βŠ›α΅£ (f1 α΅£βŠ› f2)) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (MuT s β‚œβŠ›α΅£ f1) β‚œβŠ›α΅£ f2 = MuT s β‚œβŠ›α΅£ (f1 α΅£βŠ› f2)

forall (Ξ“ Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Boom β‚œβŠ›α΅£ f1) β‚œβŠ›α΅£ f2 = Boom β‚œβŠ›α΅£ (f1 α΅£βŠ› f2)

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (v `α΅₯βŠ›α΅£ f1) `α΅₯βŠ›α΅£ f2 = v `α΅₯βŠ›α΅£ (f1 α΅£βŠ› f2)) -> forall k : term Ξ“ Β¬ B, (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (k β‚œβŠ›α΅£ f1) β‚œβŠ›α΅£ f2 = k β‚œβŠ›α΅£ (f1 α΅£βŠ› f2)) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (App v k β‚œβŠ›α΅£ f1) β‚œβŠ›α΅£ f2 = App v k β‚œβŠ›α΅£ (f1 α΅£βŠ› f2)

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ A), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (k β‚œβŠ›α΅£ f1) β‚œβŠ›α΅£ f2 = k β‚œβŠ›α΅£ (f1 α΅£βŠ› f2)) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Fst k β‚œβŠ›α΅£ f1) β‚œβŠ›α΅£ f2 = Fst k β‚œβŠ›α΅£ (f1 α΅£βŠ› f2)

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ B), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (k β‚œβŠ›α΅£ f1) β‚œβŠ›α΅£ f2 = k β‚œβŠ›α΅£ (f1 α΅£βŠ› f2)) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Snd k β‚œβŠ›α΅£ f1) β‚œβŠ›α΅£ f2 = Snd k β‚œβŠ›α΅£ (f1 α΅£βŠ› f2)

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ A) βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚›βŠ›α΅£ f1) β‚›βŠ›α΅£ f2 = s β‚›βŠ›α΅£ (f1 α΅£βŠ› f2)) -> forall t : state (Ξ“ β–Άβ‚“ ↑ B), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ B) βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (t β‚›βŠ›α΅£ f1) β‚›βŠ›α΅£ f2 = t β‚›βŠ›α΅£ (f1 α΅£βŠ› f2)) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Case s t β‚œβŠ›α΅£ f1) β‚œβŠ›α΅£ f2 = Case s t β‚œβŠ›α΅£ (f1 α΅£βŠ› f2)

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ ↑ A) (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (VarL i `α΅₯βŠ›α΅£ f1) `α΅₯βŠ›α΅£ f2 = VarL i `α΅₯βŠ›α΅£ (f1 α΅£βŠ› f2)

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (v `α΅₯βŠ›α΅£ f1) `α΅₯βŠ›α΅£ f2 = v `α΅₯βŠ›α΅£ (f1 α΅£βŠ› f2)) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Inl v `α΅₯βŠ›α΅£ f1) `α΅₯βŠ›α΅£ f2 = Inl v `α΅₯βŠ›α΅£ (f1 α΅£βŠ› f2)

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ B), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (v `α΅₯βŠ›α΅£ f1) `α΅₯βŠ›α΅£ f2 = v `α΅₯βŠ›α΅£ (f1 α΅£βŠ› f2)) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Inr v `α΅₯βŠ›α΅£ f1) `α΅₯βŠ›α΅£ f2 = Inr v `α΅₯βŠ›α΅£ (f1 α΅£βŠ› f2)

forall (Ξ“ Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Tt `α΅₯βŠ›α΅£ f1) `α΅₯βŠ›α΅£ f2 = Tt `α΅₯βŠ›α΅£ (f1 α΅£βŠ› f2)

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚›βŠ›α΅£ f1) β‚›βŠ›α΅£ f2 = s β‚›βŠ›α΅£ (f1 α΅£βŠ› f2)) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Lam s `α΅₯βŠ›α΅£ f1) `α΅₯βŠ›α΅£ f2 = Lam s `α΅₯βŠ›α΅£ (f1 α΅£βŠ› f2)

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ A) βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚›βŠ›α΅£ f1) β‚›βŠ›α΅£ f2 = s β‚›βŠ›α΅£ (f1 α΅£βŠ› f2)) -> forall t : state (Ξ“ β–Άβ‚“ Β¬ B), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ B) βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (t β‚›βŠ›α΅£ f1) β‚›βŠ›α΅£ f2 = t β‚›βŠ›α΅£ (f1 α΅£βŠ› f2)) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Pair s t `α΅₯βŠ›α΅£ f1) `α΅₯βŠ›α΅£ f2 = Pair s t `α΅₯βŠ›α΅£ (f1 α΅£βŠ› f2)

forall (Ξ“ : t_ctx) (A : pre_ty) (u : term Ξ“ ↑ A), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (u β‚œβŠ›α΅£ f1) β‚œβŠ›α΅£ f2 = u β‚œβŠ›α΅£ (f1 α΅£βŠ› f2)) -> forall v : term Ξ“ Β¬ A, (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (v β‚œβŠ›α΅£ f1) β‚œβŠ›α΅£ f2 = v β‚œβŠ›α΅£ (f1 α΅£βŠ› f2)) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Cut u v β‚›βŠ›α΅£ f1) β‚›βŠ›α΅£ f2 = Cut u v β‚›βŠ›α΅£ (f1 α΅£βŠ› f2)
Ξ“: t_ctx
A: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ A) βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚›βŠ›α΅£ f1) β‚›βŠ›α΅£ f2 = s β‚›βŠ›α΅£ (f1 α΅£βŠ› f2)
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ βŠ† Ξ“2
f2: Ξ“2 βŠ† Ξ“3

(s β‚›βŠ›α΅£ r_shift1 f1) β‚›βŠ›α΅£ r_shift1 f2 = s β‚›βŠ›α΅£ r_shift1 (f1 α΅£βŠ› f2)
Ξ“: t_ctx
A: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ A) βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚›βŠ›α΅£ f1) β‚›βŠ›α΅£ f2 = s β‚›βŠ›α΅£ (f1 α΅£βŠ› f2)
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ βŠ† Ξ“2
f2: Ξ“2 βŠ† Ξ“3
(s β‚›βŠ›α΅£ r_shift1 f1) β‚›βŠ›α΅£ r_shift1 f2 = s β‚›βŠ›α΅£ r_shift1 (f1 α΅£βŠ› f2)
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ A) βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚›βŠ›α΅£ f1) β‚›βŠ›α΅£ f2 = s β‚›βŠ›α΅£ (f1 α΅£βŠ› f2)
t: state (Ξ“ β–Άβ‚“ ↑ B)
H0: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ B) βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (t β‚›βŠ›α΅£ f1) β‚›βŠ›α΅£ f2 = t β‚›βŠ›α΅£ (f1 α΅£βŠ› f2)
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ βŠ† Ξ“2
f2: Ξ“2 βŠ† Ξ“3
(s β‚›βŠ›α΅£ r_shift1 f1) β‚›βŠ›α΅£ r_shift1 f2 = s β‚›βŠ›α΅£ r_shift1 (f1 α΅£βŠ› f2)
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ A) βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚›βŠ›α΅£ f1) β‚›βŠ›α΅£ f2 = s β‚›βŠ›α΅£ (f1 α΅£βŠ› f2)
t: state (Ξ“ β–Άβ‚“ ↑ B)
H0: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ B) βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (t β‚›βŠ›α΅£ f1) β‚›βŠ›α΅£ f2 = t β‚›βŠ›α΅£ (f1 α΅£βŠ› f2)
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ βŠ† Ξ“2
f2: Ξ“2 βŠ† Ξ“3
(t β‚›βŠ›α΅£ r_shift1 f1) β‚›βŠ›α΅£ r_shift1 f2 = t β‚›βŠ›α΅£ r_shift1 (f1 α΅£βŠ› f2)
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚›βŠ›α΅£ f1) β‚›βŠ›α΅£ f2 = s β‚›βŠ›α΅£ (f1 α΅£βŠ› f2)
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ βŠ† Ξ“2
f2: Ξ“2 βŠ† Ξ“3
(s β‚›βŠ›α΅£ r_shift3 f1) β‚›βŠ›α΅£ r_shift3 f2 = s β‚›βŠ›α΅£ r_shift3 (f1 α΅£βŠ› f2)
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ A) βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚›βŠ›α΅£ f1) β‚›βŠ›α΅£ f2 = s β‚›βŠ›α΅£ (f1 α΅£βŠ› f2)
t: state (Ξ“ β–Άβ‚“ Β¬ B)
H0: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ B) βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (t β‚›βŠ›α΅£ f1) β‚›βŠ›α΅£ f2 = t β‚›βŠ›α΅£ (f1 α΅£βŠ› f2)
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ βŠ† Ξ“2
f2: Ξ“2 βŠ† Ξ“3
(s β‚›βŠ›α΅£ r_shift1 f1) β‚›βŠ›α΅£ r_shift1 f2 = s β‚›βŠ›α΅£ r_shift1 (f1 α΅£βŠ› f2)
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ A) βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚›βŠ›α΅£ f1) β‚›βŠ›α΅£ f2 = s β‚›βŠ›α΅£ (f1 α΅£βŠ› f2)
t: state (Ξ“ β–Άβ‚“ Β¬ B)
H0: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ B) βŠ† Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (t β‚›βŠ›α΅£ f1) β‚›βŠ›α΅£ f2 = t β‚›βŠ›α΅£ (f1 α΅£βŠ› f2)
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ βŠ† Ξ“2
f2: Ξ“2 βŠ† Ξ“3
(t β‚›βŠ›α΅£ r_shift1 f1) β‚›βŠ›α΅£ r_shift1 f2 = t β‚›βŠ›α΅£ r_shift1 (f1 α΅£βŠ› f2)
all: first [ rewrite r_shift1_comp | rewrite r_shift3_comp ]; eauto. Qed.
Ξ“1, Ξ“2, Ξ“3: ctx ty
f1: Ξ“1 βŠ† Ξ“2
f2: Ξ“2 βŠ† Ξ“3
A: ty
t: term Ξ“1 A

(t β‚œβŠ›α΅£ f1) β‚œβŠ›α΅£ f2 = t β‚œβŠ›α΅£ (f1 α΅£βŠ› f2)
now apply (term_ind_mut _ _ _ ren_ren_prf). Qed.
Ξ“1, Ξ“2, Ξ“3: ctx ty
f1: Ξ“1 βŠ† Ξ“2
f2: Ξ“2 βŠ† Ξ“3
A: pre_ty
v: whn Ξ“1 A

(v `α΅₯βŠ›α΅£ f1) `α΅₯βŠ›α΅£ f2 = v `α΅₯βŠ›α΅£ (f1 α΅£βŠ› f2)
now apply (whn_ind_mut _ _ _ ren_ren_prf). Qed.
Ξ“1, Ξ“2, Ξ“3: ctx ty
f1: Ξ“1 βŠ† Ξ“2
f2: Ξ“2 βŠ† Ξ“3
s: state Ξ“1

(s β‚›βŠ›α΅£ f1) β‚›βŠ›α΅£ f2 = s β‚›βŠ›α΅£ (f1 α΅£βŠ› f2)
now apply (state_ind_mut _ _ _ ren_ren_prf). Qed.
Ξ“1, Ξ“2, Ξ“3: ctx ty
f1: Ξ“1 βŠ† Ξ“2
f2: Ξ“2 βŠ† Ξ“3
A: ty
v: val Ξ“1 A

(v α΅₯βŠ›α΅£ f1) α΅₯βŠ›α΅£ f2 = v α΅₯βŠ›α΅£ (f1 α΅£βŠ› f2)
Ξ“1, Ξ“2, Ξ“3: ctx ty
f1: Ξ“1 βŠ† Ξ“2
f2: Ξ“2 βŠ† Ξ“3
p: pre_ty
v: val Ξ“1 ↑ p

(v α΅₯βŠ›α΅£ f1) α΅₯βŠ›α΅£ f2 = v α΅₯βŠ›α΅£ (f1 α΅£βŠ› f2)
Ξ“1, Ξ“2, Ξ“3: ctx ty
f1: Ξ“1 βŠ† Ξ“2
f2: Ξ“2 βŠ† Ξ“3
p: pre_ty
v: val Ξ“1 Β¬ p
(v α΅₯βŠ›α΅£ f1) α΅₯βŠ›α΅£ f2 = v α΅₯βŠ›α΅£ (f1 α΅£βŠ› f2)
Ξ“1, Ξ“2, Ξ“3: ctx ty
f1: Ξ“1 βŠ† Ξ“2
f2: Ξ“2 βŠ† Ξ“3
p: pre_ty
v: val Ξ“1 Β¬ p

(v α΅₯βŠ›α΅£ f1) α΅₯βŠ›α΅£ f2 = v α΅₯βŠ›α΅£ (f1 α΅£βŠ› f2)
now apply t_ren_ren. Qed. Definition t_ren_id_l_P Ξ“ A (t : term Ξ“ A) : Prop := t β‚œβŠ›α΅£ r_id = t. Definition w_ren_id_l_P Ξ“ A (v : whn Ξ“ A) : Prop := v `α΅₯βŠ›α΅£ r_id = v. Definition s_ren_id_l_P Ξ“ (s : state Ξ“) : Prop := s β‚›βŠ›α΅£ r_id = s.

syn_ind_args t_ren_id_l_P w_ren_id_l_P s_ren_id_l_P

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), s_ren_id_l_P (Ξ“ β–Άβ‚“ Β¬ A) s -> t_ren_id_l_P Ξ“ ↑ A (Mu s)

forall (Ξ“ : t_ctx) (A : pre_ty) (v : whn Ξ“ A), w_ren_id_l_P Ξ“ A v -> t_ren_id_l_P Ξ“ ↑ A (Val v)

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ Β¬ A), t_ren_id_l_P Ξ“ Β¬ A (VarR i)

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), s_ren_id_l_P (Ξ“ β–Άβ‚“ ↑ A) s -> t_ren_id_l_P Ξ“ Β¬ A (MuT s)

forall Ξ“ : t_ctx, t_ren_id_l_P Ξ“ Β¬ `0 Boom

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), w_ren_id_l_P Ξ“ A v -> forall k : term Ξ“ Β¬ B, t_ren_id_l_P Ξ“ Β¬ B k -> t_ren_id_l_P Ξ“ Β¬ (A `β†’ B) (App v k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ A), t_ren_id_l_P Ξ“ Β¬ A k -> t_ren_id_l_P Ξ“ Β¬ (A `Γ— B) (Fst k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ B), t_ren_id_l_P Ξ“ Β¬ B k -> t_ren_id_l_P Ξ“ Β¬ (A `Γ— B) (Snd k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), s_ren_id_l_P (Ξ“ β–Άβ‚“ ↑ A) s -> forall t : state (Ξ“ β–Άβ‚“ ↑ B), s_ren_id_l_P (Ξ“ β–Άβ‚“ ↑ B) t -> t_ren_id_l_P Ξ“ Β¬ (A `+ B) (Case s t)

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ ↑ A), w_ren_id_l_P Ξ“ A (VarL i)

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), w_ren_id_l_P Ξ“ A v -> w_ren_id_l_P Ξ“ (A `+ B) (Inl v)

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ B), w_ren_id_l_P Ξ“ B v -> w_ren_id_l_P Ξ“ (A `+ B) (Inr v)

forall Ξ“ : t_ctx, w_ren_id_l_P Ξ“ `1 Tt

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)), s_ren_id_l_P (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) s -> w_ren_id_l_P Ξ“ (A `β†’ B) (Lam s)

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), s_ren_id_l_P (Ξ“ β–Άβ‚“ Β¬ A) s -> forall t : state (Ξ“ β–Άβ‚“ Β¬ B), s_ren_id_l_P (Ξ“ β–Άβ‚“ Β¬ B) t -> w_ren_id_l_P Ξ“ (A `Γ— B) (Pair s t)

forall (Ξ“ : t_ctx) (A : pre_ty) (u : term Ξ“ ↑ A), t_ren_id_l_P Ξ“ ↑ A u -> forall v : term Ξ“ Β¬ A, t_ren_id_l_P Ξ“ Β¬ A v -> s_ren_id_l_P Ξ“ (Cut u v)

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), s β‚›βŠ›α΅£ r_id = s -> Mu s β‚œβŠ›α΅£ r_id = Mu s

forall (Ξ“ : t_ctx) (A : pre_ty) (v : whn Ξ“ A), v `α΅₯βŠ›α΅£ r_id = v -> Val v β‚œβŠ›α΅£ r_id = Val v

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ Β¬ A), VarR i β‚œβŠ›α΅£ r_id = VarR i

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), s β‚›βŠ›α΅£ r_id = s -> MuT s β‚œβŠ›α΅£ r_id = MuT s

forall Ξ“ : t_ctx, Boom β‚œβŠ›α΅£ r_id = Boom

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), v `α΅₯βŠ›α΅£ r_id = v -> forall k : term Ξ“ Β¬ B, k β‚œβŠ›α΅£ r_id = k -> App v k β‚œβŠ›α΅£ r_id = App v k

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ A), k β‚œβŠ›α΅£ r_id = k -> Fst k β‚œβŠ›α΅£ r_id = Fst k

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ B), k β‚œβŠ›α΅£ r_id = k -> Snd k β‚œβŠ›α΅£ r_id = Snd k

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), s β‚›βŠ›α΅£ r_id = s -> forall t : state (Ξ“ β–Άβ‚“ ↑ B), t β‚›βŠ›α΅£ r_id = t -> Case s t β‚œβŠ›α΅£ r_id = Case s t

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ ↑ A), VarL i `α΅₯βŠ›α΅£ r_id = VarL i

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), v `α΅₯βŠ›α΅£ r_id = v -> Inl v `α΅₯βŠ›α΅£ r_id = Inl v

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ B), v `α΅₯βŠ›α΅£ r_id = v -> Inr v `α΅₯βŠ›α΅£ r_id = Inr v

forall Ξ“ : t_ctx, Tt `α΅₯βŠ›α΅£ r_id = Tt

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)), s β‚›βŠ›α΅£ r_id = s -> Lam s `α΅₯βŠ›α΅£ r_id = Lam s

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), s β‚›βŠ›α΅£ r_id = s -> forall t : state (Ξ“ β–Άβ‚“ Β¬ B), t β‚›βŠ›α΅£ r_id = t -> Pair s t `α΅₯βŠ›α΅£ r_id = Pair s t

forall (Ξ“ : t_ctx) (A : pre_ty) (u : term Ξ“ ↑ A), u β‚œβŠ›α΅£ r_id = u -> forall v : term Ξ“ Β¬ A, v β‚œβŠ›α΅£ r_id = v -> Cut u v β‚›βŠ›α΅£ r_id = Cut u v
Ξ“: t_ctx
A: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: s β‚›βŠ›α΅£ r_id = s

s β‚›βŠ›α΅£ r_shift1 r_id = s
Ξ“: t_ctx
A: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: s β‚›βŠ›α΅£ r_id = s
s β‚›βŠ›α΅£ r_shift1 r_id = s
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: s β‚›βŠ›α΅£ r_id = s
t: state (Ξ“ β–Άβ‚“ ↑ B)
H0: t β‚›βŠ›α΅£ r_id = t
s β‚›βŠ›α΅£ r_shift1 r_id = s
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: s β‚›βŠ›α΅£ r_id = s
t: state (Ξ“ β–Άβ‚“ ↑ B)
H0: t β‚›βŠ›α΅£ r_id = t
t β‚›βŠ›α΅£ r_shift1 r_id = t
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)
H: s β‚›βŠ›α΅£ r_id = s
s β‚›βŠ›α΅£ r_shift3 r_id = s
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: s β‚›βŠ›α΅£ r_id = s
t: state (Ξ“ β–Άβ‚“ Β¬ B)
H0: t β‚›βŠ›α΅£ r_id = t
s β‚›βŠ›α΅£ r_shift1 r_id = s
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: s β‚›βŠ›α΅£ r_id = s
t: state (Ξ“ β–Άβ‚“ Β¬ B)
H0: t β‚›βŠ›α΅£ r_id = t
t β‚›βŠ›α΅£ r_shift1 r_id = t
all: first [ rewrite r_shift1_id | rewrite r_shift3_id ]; eauto. Qed.
Ξ“: t_ctx
A: ty
t: term Ξ“ A

t β‚œβŠ›α΅£ r_id = t
now apply (term_ind_mut _ _ _ ren_id_l_prf). Qed.
Ξ“: t_ctx
A: pre_ty
v: whn Ξ“ A

v `α΅₯βŠ›α΅£ r_id = v
now apply (whn_ind_mut _ _ _ ren_id_l_prf). Qed.
Ξ“: t_ctx
s: state Ξ“

s β‚›βŠ›α΅£ r_id = s
now apply (state_ind_mut _ _ _ ren_id_l_prf). Qed.
Ξ“: t_ctx
A: ty
v: val Ξ“ A

v α΅₯βŠ›α΅£ r_id = v
Ξ“: t_ctx
p: pre_ty
v: val Ξ“ ↑ p

v α΅₯βŠ›α΅£ r_id = v
Ξ“: t_ctx
p: pre_ty
v: val Ξ“ Β¬ p
v α΅₯βŠ›α΅£ r_id = v
Ξ“: t_ctx
p: pre_ty
v: val Ξ“ Β¬ p

v α΅₯βŠ›α΅£ r_id = v
now apply t_ren_id_l. Qed.
Ξ“, Ξ”: ctx ty
f: Ξ“ βŠ† Ξ”
A: ty
i: Ξ“ βˆ‹ A

Var i α΅₯βŠ›α΅£ f = Var (f A i)
now destruct A. Qed.
Ξ“: t_ctx
A: ty

a_shift1 Var ≑ₐ Var
intros [ [] | [] ] i; dependent elimination i; auto. Qed.
Ξ“: t_ctx
A, B, C: ty

a_shift3 Var ≑ₐ Var
Ξ“: t_ctx
A, B, C, a: ty
v: Ξ“ β–Άβ‚“ A β–Άβ‚“ B β–Άβ‚“ C βˆ‹ a

a_shift3 Var a v = Var v
Ξ“1: ctx ty
y1, y0, y, a: ty
v: var a Ξ“1

v_shift3 a (Var v) = Var (pop (pop (pop v)))
now destruct a. Qed. Arguments Var : simpl never.
Ξ“1, Ξ“2, Ξ“3: t_ctx
A: ty
f1: Ξ“1 =[ val ]> Ξ“2
f2: Ξ“2 βŠ† Ξ“3

a_shift1 (f1 βŠ›α΅£ f2) ≑ₐ a_shift1 f1 βŠ›α΅£ r_shift1 f2
Ξ“: ctx ty
Ξ“2, Ξ“3: t_ctx
a: ty
f1: Ξ“ =[ val ]> Ξ“2
f2: Ξ“2 βŠ† Ξ“3

Var top = Var top α΅₯βŠ›α΅£ r_shift1 f2
Ξ“0: ctx ty
Ξ“2, Ξ“3: t_ctx
y: ty
f1: Ξ“0 =[ val ]> Ξ“2
f2: Ξ“2 βŠ† Ξ“3
a: ty
v: var a Ξ“0
v_shift1 a (f1 a v α΅₯βŠ›α΅£ f2) = v_shift1 a (f1 a v) α΅₯βŠ›α΅£ r_shift1 f2
Ξ“: ctx ty
Ξ“2, Ξ“3: t_ctx
a: ty
f1: Ξ“ =[ val ]> Ξ“2
f2: Ξ“2 βŠ† Ξ“3

Var top = Var top α΅₯βŠ›α΅£ r_shift1 f2
now rewrite v_ren_id_r.
Ξ“0: ctx ty
Ξ“2, Ξ“3: t_ctx
y: ty
f1: Ξ“0 =[ val ]> Ξ“2
f2: Ξ“2 βŠ† Ξ“3
a: ty
v: var a Ξ“0

v_shift1 a (f1 a v α΅₯βŠ›α΅£ f2) = v_shift1 a (f1 a v) α΅₯βŠ›α΅£ r_shift1 f2
now unfold v_shift1; rewrite 2 v_ren_ren. Qed.
Ξ“1, Ξ“2, Ξ“3: t_ctx
A, B, C: ty
f1: Ξ“1 =[ val ]> Ξ“2
f2: Ξ“2 βŠ† Ξ“3

a_shift3 (f1 βŠ›α΅£ f2) ≑ₐ a_shift3 f1 βŠ›α΅£ r_shift3 f2
Ξ“0: ctx ty
Ξ“2, Ξ“3: t_ctx
y1, y0, y: ty
f1: Ξ“0 =[ val ]> Ξ“2
f2: Ξ“2 βŠ† Ξ“3
a: ty
v: var a Ξ“0

v_shift3 a (f1 a v α΅₯βŠ›α΅£ f2) = v_shift3 a (f1 a v) α΅₯βŠ›α΅£ r_shift3 f2
unfold v_shift3; now rewrite 2 v_ren_ren. Qed.
Ξ“1, Ξ“2: ctx ty
Ξ“3: t_ctx
A: ty
f1: Ξ“1 βŠ† Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3

a_shift1 (f1 α΅£βŠ› f2) ≑ₐ r_shift1 f1 α΅£βŠ› a_shift1 f2
intros ? i; dependent elimination i; auto. Qed.
Ξ“1, Ξ“2: ctx ty
Ξ“3: t_ctx
A, B, C: ty
f1: Ξ“1 βŠ† Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3

a_shift3 (f1 α΅£βŠ› f2) ≑ₐ r_shift3 f1 α΅£βŠ› a_shift3 f2
intros ? v; do 3 (dependent elimination v; auto). Qed. Definition t_sub_proper_P Ξ“ A (t : term Ξ“ A) : Prop := forall Ξ” (f1 f2 : Ξ“ =[val]> Ξ”), f1 ≑ₐ f2 -> t `β‚œβŠ› f1 = t `β‚œβŠ› f2 . Definition w_sub_proper_P Ξ“ A (v : whn Ξ“ A) : Prop := forall Ξ” (f1 f2 : Ξ“ =[val]> Ξ”), f1 ≑ₐ f2 -> v `α΅₯βŠ› f1 = v `α΅₯βŠ› f2 . Definition s_sub_proper_P Ξ“ (s : state Ξ“) : Prop := forall Ξ” (f1 f2 : Ξ“ =[val]> Ξ”), f1 ≑ₐ f2 -> s β‚œβŠ› f1 = s β‚œβŠ› f2 .

syn_ind_args t_sub_proper_P w_sub_proper_P s_sub_proper_P

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), s_sub_proper_P (Ξ“ β–Άβ‚“ Β¬ A) s -> t_sub_proper_P Ξ“ ↑ A (Mu s)

forall (Ξ“ : t_ctx) (A : pre_ty) (v : whn Ξ“ A), w_sub_proper_P Ξ“ A v -> t_sub_proper_P Ξ“ ↑ A (Val v)

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ Β¬ A), t_sub_proper_P Ξ“ Β¬ A (VarR i)

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), s_sub_proper_P (Ξ“ β–Άβ‚“ ↑ A) s -> t_sub_proper_P Ξ“ Β¬ A (MuT s)

forall Ξ“ : t_ctx, t_sub_proper_P Ξ“ Β¬ `0 Boom

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), w_sub_proper_P Ξ“ A v -> forall k : term Ξ“ Β¬ B, t_sub_proper_P Ξ“ Β¬ B k -> t_sub_proper_P Ξ“ Β¬ (A `β†’ B) (App v k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ A), t_sub_proper_P Ξ“ Β¬ A k -> t_sub_proper_P Ξ“ Β¬ (A `Γ— B) (Fst k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ B), t_sub_proper_P Ξ“ Β¬ B k -> t_sub_proper_P Ξ“ Β¬ (A `Γ— B) (Snd k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), s_sub_proper_P (Ξ“ β–Άβ‚“ ↑ A) s -> forall t : state (Ξ“ β–Άβ‚“ ↑ B), s_sub_proper_P (Ξ“ β–Άβ‚“ ↑ B) t -> t_sub_proper_P Ξ“ Β¬ (A `+ B) (Case s t)

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ ↑ A), w_sub_proper_P Ξ“ A (VarL i)

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), w_sub_proper_P Ξ“ A v -> w_sub_proper_P Ξ“ (A `+ B) (Inl v)

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ B), w_sub_proper_P Ξ“ B v -> w_sub_proper_P Ξ“ (A `+ B) (Inr v)

forall Ξ“ : t_ctx, w_sub_proper_P Ξ“ `1 Tt

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)), s_sub_proper_P (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) s -> w_sub_proper_P Ξ“ (A `β†’ B) (Lam s)

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), s_sub_proper_P (Ξ“ β–Άβ‚“ Β¬ A) s -> forall t : state (Ξ“ β–Άβ‚“ Β¬ B), s_sub_proper_P (Ξ“ β–Άβ‚“ Β¬ B) t -> w_sub_proper_P Ξ“ (A `Γ— B) (Pair s t)

forall (Ξ“ : t_ctx) (A : pre_ty) (u : term Ξ“ ↑ A), t_sub_proper_P Ξ“ ↑ A u -> forall v : term Ξ“ Β¬ A, t_sub_proper_P Ξ“ Β¬ A v -> s_sub_proper_P Ξ“ (Cut u v)

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), (forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ A) =[ val ]> Ξ”), f1 ≑ₐ f2 -> s β‚œβŠ› f1 = s β‚œβŠ› f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> Mu s `β‚œβŠ› f1 = Mu s `β‚œβŠ› f2

forall (Ξ“ : t_ctx) (A : pre_ty) (v : whn Ξ“ A), (forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> v `α΅₯βŠ› f1 = v `α΅₯βŠ› f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> Val v `β‚œβŠ› f1 = Val v `β‚œβŠ› f2

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ Β¬ A) (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> VarR i `β‚œβŠ› f1 = VarR i `β‚œβŠ› f2

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), (forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ A) =[ val ]> Ξ”), f1 ≑ₐ f2 -> s β‚œβŠ› f1 = s β‚œβŠ› f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> MuT s `β‚œβŠ› f1 = MuT s `β‚œβŠ› f2

forall (Ξ“ Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> Boom `β‚œβŠ› f1 = Boom `β‚œβŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), (forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> v `α΅₯βŠ› f1 = v `α΅₯βŠ› f2) -> forall k : term Ξ“ Β¬ B, (forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> k `β‚œβŠ› f1 = k `β‚œβŠ› f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> App v k `β‚œβŠ› f1 = App v k `β‚œβŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ A), (forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> k `β‚œβŠ› f1 = k `β‚œβŠ› f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> Fst k `β‚œβŠ› f1 = Fst k `β‚œβŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ B), (forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> k `β‚œβŠ› f1 = k `β‚œβŠ› f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> Snd k `β‚œβŠ› f1 = Snd k `β‚œβŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), (forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ A) =[ val ]> Ξ”), f1 ≑ₐ f2 -> s β‚œβŠ› f1 = s β‚œβŠ› f2) -> forall t : state (Ξ“ β–Άβ‚“ ↑ B), (forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ B) =[ val ]> Ξ”), f1 ≑ₐ f2 -> t β‚œβŠ› f1 = t β‚œβŠ› f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> Case s t `β‚œβŠ› f1 = Case s t `β‚œβŠ› f2

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ ↑ A) (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> VarL i `α΅₯βŠ› f1 = VarL i `α΅₯βŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), (forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> v `α΅₯βŠ› f1 = v `α΅₯βŠ› f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> Inl v `α΅₯βŠ› f1 = Inl v `α΅₯βŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ B), (forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> v `α΅₯βŠ› f1 = v `α΅₯βŠ› f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> Inr v `α΅₯βŠ› f1 = Inr v `α΅₯βŠ› f2

forall (Ξ“ Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> Tt `α΅₯βŠ› f1 = Tt `α΅₯βŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)), (forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) =[ val ]> Ξ”), f1 ≑ₐ f2 -> s β‚œβŠ› f1 = s β‚œβŠ› f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> Lam s `α΅₯βŠ› f1 = Lam s `α΅₯βŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), (forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ A) =[ val ]> Ξ”), f1 ≑ₐ f2 -> s β‚œβŠ› f1 = s β‚œβŠ› f2) -> forall t : state (Ξ“ β–Άβ‚“ Β¬ B), (forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ B) =[ val ]> Ξ”), f1 ≑ₐ f2 -> t β‚œβŠ› f1 = t β‚œβŠ› f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> Pair s t `α΅₯βŠ› f1 = Pair s t `α΅₯βŠ› f2

forall (Ξ“ : t_ctx) (A : pre_ty) (u : term Ξ“ ↑ A), (forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> u `β‚œβŠ› f1 = u `β‚œβŠ› f2) -> forall v : term Ξ“ Β¬ A, (forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> v `β‚œβŠ› f1 = v `β‚œβŠ› f2) -> forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> Cut u v β‚œβŠ› f1 = Cut u v β‚œβŠ› f2
Ξ“: t_ctx
A: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ A) =[ val ]> Ξ”), f1 ≑ₐ f2 -> s β‚œβŠ› f1 = s β‚œβŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H0: f1 ≑ₐ f2

s_subst (Ξ“ β–Άβ‚“ Β¬ A) s (Ξ” β–Άβ‚“ Β¬ A) (a_shift1 f1) = s_subst (Ξ“ β–Άβ‚“ Β¬ A) s (Ξ” β–Άβ‚“ Β¬ A) (a_shift1 f2)
Ξ“: t_ctx
A: pre_ty
v: whn Ξ“ A
H: forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> v `α΅₯βŠ› f1 = v `α΅₯βŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H0: f1 ≑ₐ f2
v `α΅₯βŠ› f1 = v `α΅₯βŠ› f2
Ξ“: t_ctx
A: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ A) =[ val ]> Ξ”), f1 ≑ₐ f2 -> s β‚œβŠ› f1 = s β‚œβŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H0: f1 ≑ₐ f2
s_subst (Ξ“ β–Άβ‚“ ↑ A) s (Ξ” β–Άβ‚“ ↑ A) (a_shift1 f1) = s_subst (Ξ“ β–Άβ‚“ ↑ A) s (Ξ” β–Άβ‚“ ↑ A) (a_shift1 f2)
Ξ“: t_ctx
A, B: pre_ty
v: whn Ξ“ A
H: forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> v `α΅₯βŠ› f1 = v `α΅₯βŠ› f2
k: term Ξ“ Β¬ B
H0: forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> k `β‚œβŠ› f1 = k `β‚œβŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H1: f1 ≑ₐ f2
v `α΅₯βŠ› f1 = v `α΅₯βŠ› f2
Ξ“: t_ctx
A, B: pre_ty
v: whn Ξ“ A
H: forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> v `α΅₯βŠ› f1 = v `α΅₯βŠ› f2
k: term Ξ“ Β¬ B
H0: forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> k `β‚œβŠ› f1 = k `β‚œβŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H1: f1 ≑ₐ f2
k `β‚œβŠ› f1 = k `β‚œβŠ› f2
Ξ“: t_ctx
A, B: pre_ty
k: term Ξ“ Β¬ A
H: forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> k `β‚œβŠ› f1 = k `β‚œβŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H0: f1 ≑ₐ f2
k `β‚œβŠ› f1 = k `β‚œβŠ› f2
Ξ“: t_ctx
A, B: pre_ty
k: term Ξ“ Β¬ B
H: forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> k `β‚œβŠ› f1 = k `β‚œβŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H0: f1 ≑ₐ f2
k `β‚œβŠ› f1 = k `β‚œβŠ› f2
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ A) =[ val ]> Ξ”), f1 ≑ₐ f2 -> s β‚œβŠ› f1 = s β‚œβŠ› f2
t: state (Ξ“ β–Άβ‚“ ↑ B)
H0: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ B) =[ val ]> Ξ”), f1 ≑ₐ f2 -> t β‚œβŠ› f1 = t β‚œβŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H1: f1 ≑ₐ f2
s_subst (Ξ“ β–Άβ‚“ ↑ A) s (Ξ” β–Άβ‚“ ↑ A) (a_shift1 f1) = s_subst (Ξ“ β–Άβ‚“ ↑ A) s (Ξ” β–Άβ‚“ ↑ A) (a_shift1 f2)
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ A) =[ val ]> Ξ”), f1 ≑ₐ f2 -> s β‚œβŠ› f1 = s β‚œβŠ› f2
t: state (Ξ“ β–Άβ‚“ ↑ B)
H0: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ B) =[ val ]> Ξ”), f1 ≑ₐ f2 -> t β‚œβŠ› f1 = t β‚œβŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H1: f1 ≑ₐ f2
s_subst (Ξ“ β–Άβ‚“ ↑ B) t (Ξ” β–Άβ‚“ ↑ B) (a_shift1 f1) = s_subst (Ξ“ β–Άβ‚“ ↑ B) t (Ξ” β–Άβ‚“ ↑ B) (a_shift1 f2)
Ξ“: t_ctx
A, B: pre_ty
v: whn Ξ“ A
H: forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> v `α΅₯βŠ› f1 = v `α΅₯βŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H0: f1 ≑ₐ f2
v `α΅₯βŠ› f1 = v `α΅₯βŠ› f2
Ξ“: t_ctx
A, B: pre_ty
v: whn Ξ“ B
H: forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> v `α΅₯βŠ› f1 = v `α΅₯βŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H0: f1 ≑ₐ f2
v `α΅₯βŠ› f1 = v `α΅₯βŠ› f2
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) =[ val ]> Ξ”), f1 ≑ₐ f2 -> s β‚œβŠ› f1 = s β‚œβŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H0: f1 ≑ₐ f2
s_subst (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) s (Ξ” β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) (a_shift3 f1) = s_subst (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) s (Ξ” β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) (a_shift3 f2)
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ A) =[ val ]> Ξ”), f1 ≑ₐ f2 -> s β‚œβŠ› f1 = s β‚œβŠ› f2
t: state (Ξ“ β–Άβ‚“ Β¬ B)
H0: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ B) =[ val ]> Ξ”), f1 ≑ₐ f2 -> t β‚œβŠ› f1 = t β‚œβŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H1: f1 ≑ₐ f2
s_subst (Ξ“ β–Άβ‚“ Β¬ A) s (Ξ” β–Άβ‚“ Β¬ A) (a_shift1 f1) = s_subst (Ξ“ β–Άβ‚“ Β¬ A) s (Ξ” β–Άβ‚“ Β¬ A) (a_shift1 f2)
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ A) =[ val ]> Ξ”), f1 ≑ₐ f2 -> s β‚œβŠ› f1 = s β‚œβŠ› f2
t: state (Ξ“ β–Άβ‚“ Β¬ B)
H0: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ B) =[ val ]> Ξ”), f1 ≑ₐ f2 -> t β‚œβŠ› f1 = t β‚œβŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H1: f1 ≑ₐ f2
s_subst (Ξ“ β–Άβ‚“ Β¬ B) t (Ξ” β–Άβ‚“ Β¬ B) (a_shift1 f1) = s_subst (Ξ“ β–Άβ‚“ Β¬ B) t (Ξ” β–Άβ‚“ Β¬ B) (a_shift1 f2)
Ξ“: t_ctx
A: pre_ty
u: term Ξ“ ↑ A
H: forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> u `β‚œβŠ› f1 = u `β‚œβŠ› f2
v: term Ξ“ Β¬ A
H0: forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> v `β‚œβŠ› f1 = v `β‚œβŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H1: f1 ≑ₐ f2
u `β‚œβŠ› f1 = u `β‚œβŠ› f2
Ξ“: t_ctx
A: pre_ty
u: term Ξ“ ↑ A
H: forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> u `β‚œβŠ› f1 = u `β‚œβŠ› f2
v: term Ξ“ Β¬ A
H0: forall (Ξ” : t_ctx) (f1 f2 : Ξ“ =[ val ]> Ξ”), f1 ≑ₐ f2 -> v `β‚œβŠ› f1 = v `β‚œβŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H1: f1 ≑ₐ f2
v `β‚œβŠ› f1 = v `β‚œβŠ› f2
Ξ“: t_ctx
A: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ A) =[ val ]> Ξ”), f1 ≑ₐ f2 -> s β‚œβŠ› f1 = s β‚œβŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H0: f1 ≑ₐ f2

a_shift1 f1 ≑ₐ a_shift1 f2
Ξ“: t_ctx
A: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ A) =[ val ]> Ξ”), f1 ≑ₐ f2 -> s β‚œβŠ› f1 = s β‚œβŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H0: f1 ≑ₐ f2
a_shift1 f1 ≑ₐ a_shift1 f2
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ A) =[ val ]> Ξ”), f1 ≑ₐ f2 -> s β‚œβŠ› f1 = s β‚œβŠ› f2
t: state (Ξ“ β–Άβ‚“ ↑ B)
H0: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ B) =[ val ]> Ξ”), f1 ≑ₐ f2 -> t β‚œβŠ› f1 = t β‚œβŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H1: f1 ≑ₐ f2
a_shift1 f1 ≑ₐ a_shift1 f2
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ A) =[ val ]> Ξ”), f1 ≑ₐ f2 -> s β‚œβŠ› f1 = s β‚œβŠ› f2
t: state (Ξ“ β–Άβ‚“ ↑ B)
H0: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ B) =[ val ]> Ξ”), f1 ≑ₐ f2 -> t β‚œβŠ› f1 = t β‚œβŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H1: f1 ≑ₐ f2
a_shift1 f1 ≑ₐ a_shift1 f2
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) =[ val ]> Ξ”), f1 ≑ₐ f2 -> s β‚œβŠ› f1 = s β‚œβŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H0: f1 ≑ₐ f2
a_shift3 f1 ≑ₐ a_shift3 f2
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ A) =[ val ]> Ξ”), f1 ≑ₐ f2 -> s β‚œβŠ› f1 = s β‚œβŠ› f2
t: state (Ξ“ β–Άβ‚“ Β¬ B)
H0: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ B) =[ val ]> Ξ”), f1 ≑ₐ f2 -> t β‚œβŠ› f1 = t β‚œβŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H1: f1 ≑ₐ f2
a_shift1 f1 ≑ₐ a_shift1 f2
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ A) =[ val ]> Ξ”), f1 ≑ₐ f2 -> s β‚œβŠ› f1 = s β‚œβŠ› f2
t: state (Ξ“ β–Άβ‚“ Β¬ B)
H0: forall (Ξ” : t_ctx) (f1 f2 : (Ξ“ β–Άβ‚“ Β¬ B) =[ val ]> Ξ”), f1 ≑ₐ f2 -> t β‚œβŠ› f1 = t β‚œβŠ› f2
Ξ”: t_ctx
f1, f2: Ξ“ =[ val ]> Ξ”
H1: f1 ≑ₐ f2
a_shift1 f1 ≑ₐ a_shift1 f2
all: first [ apply a_shift1_eq | apply a_shift3_eq ]; auto. Qed.
Ξ“: t_ctx
a: ty
t: term Ξ“ a
Ξ”: t_ctx

Proper (asgn_eq Ξ“ Ξ” ==> eq) (t_subst Ξ“ a t Ξ”)
intros f1 f2 H1; now apply (term_ind_mut _ _ _ sub_proper_prf). Qed.
Ξ“: t_ctx
a: pre_ty
v: whn Ξ“ a
Ξ”: t_ctx

Proper (asgn_eq Ξ“ Ξ” ==> eq) (w_subst Ξ“ a v Ξ”)
intros f1 f2 H1; now apply (whn_ind_mut _ _ _ sub_proper_prf). Qed.
Ξ“: t_ctx
s: state Ξ“
Ξ”: t_ctx

Proper (asgn_eq Ξ“ Ξ” ==> eq) (s_subst Ξ“ s Ξ”)
intros f1 f2 H1; now apply (state_ind_mut _ _ _ sub_proper_prf). Qed.
Ξ“: t_ctx
a: ty
v: val Ξ“ a
Ξ”: t_ctx

Proper (asgn_eq Ξ“ Ξ” ==> eq) (v_subst Ξ“ a v Ξ”)
Ξ“: t_ctx
p: pre_ty
v: val Ξ“ ↑ p
Ξ”: t_ctx

Proper (asgn_eq Ξ“ Ξ” ==> eq) (v_subst Ξ“ ↑ p v Ξ”)
Ξ“: t_ctx
p: pre_ty
v: val Ξ“ Β¬ p
Ξ”: t_ctx
Proper (asgn_eq Ξ“ Ξ” ==> eq) (v_subst Ξ“ Β¬ p v Ξ”)
Ξ“: t_ctx
p: pre_ty
v: val Ξ“ ↑ p
Ξ”: t_ctx

Proper (asgn_eq Ξ“ Ξ” ==> eq) (v_subst Ξ“ ↑ p v Ξ”)
now apply w_sub_eq.
Ξ“: t_ctx
p: pre_ty
v: val Ξ“ Β¬ p
Ξ”: t_ctx

Proper (asgn_eq Ξ“ Ξ” ==> eq) (v_subst Ξ“ Β¬ p v Ξ”)
now apply t_sub_eq. Qed.
Ξ“1, Ξ“2, Ξ“3: ctx ty

Proper (asgn_eq Ξ“1 Ξ“2 ==> asgn_eq Ξ“2 Ξ“3 ==> asgn_eq Ξ“1 Ξ“3) a_comp
intros ? ? H1 ? ? H2 ? ?; cbn; rewrite H1; now eapply v_sub_eq. Qed. Definition t_ren_sub_P Ξ“1 A (t : term Ξ“1 A) : Prop := forall Ξ“2 Ξ“3 (f1 : Ξ“1 =[val]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (t `β‚œβŠ› f1) β‚œβŠ›α΅£ f2 = t `β‚œβŠ› (f1 βŠ›α΅£ f2) . Definition w_ren_sub_P Ξ“1 A (v : whn Ξ“1 A) : Prop := forall Ξ“2 Ξ“3 (f1 : Ξ“1 =[val]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (v `α΅₯βŠ› f1) `α΅₯βŠ›α΅£ f2 = v `α΅₯βŠ› (f1 βŠ›α΅£ f2) . Definition s_ren_sub_P Ξ“1 (s : state Ξ“1) : Prop := forall Ξ“2 Ξ“3 (f1 : Ξ“1 =[val]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚œβŠ› f1) β‚›βŠ›α΅£ f2 = s β‚œβŠ› (f1 βŠ›α΅£ f2) .

syn_ind_args t_ren_sub_P w_ren_sub_P s_ren_sub_P

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), s_ren_sub_P (Ξ“ β–Άβ‚“ Β¬ A) s -> t_ren_sub_P Ξ“ ↑ A (Mu s)

forall (Ξ“ : t_ctx) (A : pre_ty) (v : whn Ξ“ A), w_ren_sub_P Ξ“ A v -> t_ren_sub_P Ξ“ ↑ A (Val v)

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ Β¬ A), t_ren_sub_P Ξ“ Β¬ A (VarR i)

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), s_ren_sub_P (Ξ“ β–Άβ‚“ ↑ A) s -> t_ren_sub_P Ξ“ Β¬ A (MuT s)

forall Ξ“ : t_ctx, t_ren_sub_P Ξ“ Β¬ `0 Boom

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), w_ren_sub_P Ξ“ A v -> forall k : term Ξ“ Β¬ B, t_ren_sub_P Ξ“ Β¬ B k -> t_ren_sub_P Ξ“ Β¬ (A `β†’ B) (App v k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ A), t_ren_sub_P Ξ“ Β¬ A k -> t_ren_sub_P Ξ“ Β¬ (A `Γ— B) (Fst k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ B), t_ren_sub_P Ξ“ Β¬ B k -> t_ren_sub_P Ξ“ Β¬ (A `Γ— B) (Snd k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), s_ren_sub_P (Ξ“ β–Άβ‚“ ↑ A) s -> forall t : state (Ξ“ β–Άβ‚“ ↑ B), s_ren_sub_P (Ξ“ β–Άβ‚“ ↑ B) t -> t_ren_sub_P Ξ“ Β¬ (A `+ B) (Case s t)

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ ↑ A), w_ren_sub_P Ξ“ A (VarL i)

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), w_ren_sub_P Ξ“ A v -> w_ren_sub_P Ξ“ (A `+ B) (Inl v)

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ B), w_ren_sub_P Ξ“ B v -> w_ren_sub_P Ξ“ (A `+ B) (Inr v)

forall Ξ“ : t_ctx, w_ren_sub_P Ξ“ `1 Tt

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)), s_ren_sub_P (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) s -> w_ren_sub_P Ξ“ (A `β†’ B) (Lam s)

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), s_ren_sub_P (Ξ“ β–Άβ‚“ Β¬ A) s -> forall t : state (Ξ“ β–Άβ‚“ Β¬ B), s_ren_sub_P (Ξ“ β–Άβ‚“ Β¬ B) t -> w_ren_sub_P Ξ“ (A `Γ— B) (Pair s t)

forall (Ξ“ : t_ctx) (A : pre_ty) (u : term Ξ“ ↑ A), t_ren_sub_P Ξ“ ↑ A u -> forall v : term Ξ“ Β¬ A, t_ren_sub_P Ξ“ Β¬ A v -> s_ren_sub_P Ξ“ (Cut u v)

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ A) =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚œβŠ› f1) β‚›βŠ›α΅£ f2 = s β‚œβŠ› f1 βŠ›α΅£ f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Mu s `β‚œβŠ› f1) β‚œβŠ›α΅£ f2 = Mu s `β‚œβŠ› f1 βŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A : pre_ty) (v : whn Ξ“ A), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (v `α΅₯βŠ› f1) `α΅₯βŠ›α΅£ f2 = v `α΅₯βŠ› f1 βŠ›α΅£ f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Val v `β‚œβŠ› f1) β‚œβŠ›α΅£ f2 = Val v `β‚œβŠ› f1 βŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ Β¬ A) (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (VarR i `β‚œβŠ› f1) β‚œβŠ›α΅£ f2 = VarR i `β‚œβŠ› f1 βŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ A) =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚œβŠ› f1) β‚›βŠ›α΅£ f2 = s β‚œβŠ› f1 βŠ›α΅£ f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (MuT s `β‚œβŠ› f1) β‚œβŠ›α΅£ f2 = MuT s `β‚œβŠ› f1 βŠ›α΅£ f2

forall (Ξ“ Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Boom `β‚œβŠ› f1) β‚œβŠ›α΅£ f2 = Boom `β‚œβŠ› f1 βŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (v `α΅₯βŠ› f1) `α΅₯βŠ›α΅£ f2 = v `α΅₯βŠ› f1 βŠ›α΅£ f2) -> forall k : term Ξ“ Β¬ B, (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (k `β‚œβŠ› f1) β‚œβŠ›α΅£ f2 = k `β‚œβŠ› f1 βŠ›α΅£ f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (App v k `β‚œβŠ› f1) β‚œβŠ›α΅£ f2 = App v k `β‚œβŠ› f1 βŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ A), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (k `β‚œβŠ› f1) β‚œβŠ›α΅£ f2 = k `β‚œβŠ› f1 βŠ›α΅£ f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Fst k `β‚œβŠ› f1) β‚œβŠ›α΅£ f2 = Fst k `β‚œβŠ› f1 βŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ B), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (k `β‚œβŠ› f1) β‚œβŠ›α΅£ f2 = k `β‚œβŠ› f1 βŠ›α΅£ f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Snd k `β‚œβŠ› f1) β‚œβŠ›α΅£ f2 = Snd k `β‚œβŠ› f1 βŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ A) =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚œβŠ› f1) β‚›βŠ›α΅£ f2 = s β‚œβŠ› f1 βŠ›α΅£ f2) -> forall t : state (Ξ“ β–Άβ‚“ ↑ B), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ B) =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (t β‚œβŠ› f1) β‚›βŠ›α΅£ f2 = t β‚œβŠ› f1 βŠ›α΅£ f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Case s t `β‚œβŠ› f1) β‚œβŠ›α΅£ f2 = Case s t `β‚œβŠ› f1 βŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ ↑ A) (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (VarL i `α΅₯βŠ› f1) `α΅₯βŠ›α΅£ f2 = VarL i `α΅₯βŠ› f1 βŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (v `α΅₯βŠ› f1) `α΅₯βŠ›α΅£ f2 = v `α΅₯βŠ› f1 βŠ›α΅£ f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Inl v `α΅₯βŠ› f1) `α΅₯βŠ›α΅£ f2 = Inl v `α΅₯βŠ› f1 βŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ B), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (v `α΅₯βŠ› f1) `α΅₯βŠ›α΅£ f2 = v `α΅₯βŠ› f1 βŠ›α΅£ f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Inr v `α΅₯βŠ› f1) `α΅₯βŠ›α΅£ f2 = Inr v `α΅₯βŠ› f1 βŠ›α΅£ f2

forall (Ξ“ Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Tt `α΅₯βŠ› f1) `α΅₯βŠ›α΅£ f2 = Tt `α΅₯βŠ› f1 βŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚œβŠ› f1) β‚›βŠ›α΅£ f2 = s β‚œβŠ› f1 βŠ›α΅£ f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Lam s `α΅₯βŠ› f1) `α΅₯βŠ›α΅£ f2 = Lam s `α΅₯βŠ› f1 βŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ A) =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚œβŠ› f1) β‚›βŠ›α΅£ f2 = s β‚œβŠ› f1 βŠ›α΅£ f2) -> forall t : state (Ξ“ β–Άβ‚“ Β¬ B), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ B) =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (t β‚œβŠ› f1) β‚›βŠ›α΅£ f2 = t β‚œβŠ› f1 βŠ›α΅£ f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Pair s t `α΅₯βŠ› f1) `α΅₯βŠ›α΅£ f2 = Pair s t `α΅₯βŠ› f1 βŠ›α΅£ f2

forall (Ξ“ : t_ctx) (A : pre_ty) (u : term Ξ“ ↑ A), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (u `β‚œβŠ› f1) β‚œβŠ›α΅£ f2 = u `β‚œβŠ› f1 βŠ›α΅£ f2) -> forall v : term Ξ“ Β¬ A, (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (v `β‚œβŠ› f1) β‚œβŠ›α΅£ f2 = v `β‚œβŠ› f1 βŠ›α΅£ f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (Cut u v β‚œβŠ› f1) β‚›βŠ›α΅£ f2 = Cut u v β‚œβŠ› f1 βŠ›α΅£ f2
Ξ“: t_ctx
A: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ A) =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚œβŠ› f1) β‚›βŠ›α΅£ f2 = s β‚œβŠ› f1 βŠ›α΅£ f2
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ =[ val ]> Ξ“2
f2: Ξ“2 βŠ† Ξ“3

s_subst (Ξ“ β–Άβ‚“ Β¬ A) s (Ξ“2 β–Άβ‚“ Β¬ A) (a_shift1 f1) β‚›βŠ›α΅£ r_shift1 f2 = s_subst (Ξ“ β–Άβ‚“ Β¬ A) s (Ξ“3 β–Άβ‚“ Β¬ A) (a_shift1 (f1 βŠ›α΅£ f2))
Ξ“: t_ctx
A: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ A) =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚œβŠ› f1) β‚›βŠ›α΅£ f2 = s β‚œβŠ› f1 βŠ›α΅£ f2
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ =[ val ]> Ξ“2
f2: Ξ“2 βŠ† Ξ“3
s_subst (Ξ“ β–Άβ‚“ ↑ A) s (Ξ“2 β–Άβ‚“ ↑ A) (a_shift1 f1) β‚›βŠ›α΅£ r_shift1 f2 = s_subst (Ξ“ β–Άβ‚“ ↑ A) s (Ξ“3 β–Άβ‚“ ↑ A) (a_shift1 (f1 βŠ›α΅£ f2))
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ A) =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚œβŠ› f1) β‚›βŠ›α΅£ f2 = s β‚œβŠ› f1 βŠ›α΅£ f2
t: state (Ξ“ β–Άβ‚“ ↑ B)
H0: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ B) =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (t β‚œβŠ› f1) β‚›βŠ›α΅£ f2 = t β‚œβŠ› f1 βŠ›α΅£ f2
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ =[ val ]> Ξ“2
f2: Ξ“2 βŠ† Ξ“3
s_subst (Ξ“ β–Άβ‚“ ↑ A) s (Ξ“2 β–Άβ‚“ ↑ A) (a_shift1 f1) β‚›βŠ›α΅£ r_shift1 f2 = s_subst (Ξ“ β–Άβ‚“ ↑ A) s (Ξ“3 β–Άβ‚“ ↑ A) (a_shift1 (f1 βŠ›α΅£ f2))
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ A) =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚œβŠ› f1) β‚›βŠ›α΅£ f2 = s β‚œβŠ› f1 βŠ›α΅£ f2
t: state (Ξ“ β–Άβ‚“ ↑ B)
H0: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ B) =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (t β‚œβŠ› f1) β‚›βŠ›α΅£ f2 = t β‚œβŠ› f1 βŠ›α΅£ f2
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ =[ val ]> Ξ“2
f2: Ξ“2 βŠ† Ξ“3
s_subst (Ξ“ β–Άβ‚“ ↑ B) t (Ξ“2 β–Άβ‚“ ↑ B) (a_shift1 f1) β‚›βŠ›α΅£ r_shift1 f2 = s_subst (Ξ“ β–Άβ‚“ ↑ B) t (Ξ“3 β–Άβ‚“ ↑ B) (a_shift1 (f1 βŠ›α΅£ f2))
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚œβŠ› f1) β‚›βŠ›α΅£ f2 = s β‚œβŠ› f1 βŠ›α΅£ f2
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ =[ val ]> Ξ“2
f2: Ξ“2 βŠ† Ξ“3
s_subst (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) s (Ξ“2 β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) (a_shift3 f1) β‚›βŠ›α΅£ r_shift3 f2 = s_subst (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) s (Ξ“3 β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) (a_shift3 (f1 βŠ›α΅£ f2))
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ A) =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚œβŠ› f1) β‚›βŠ›α΅£ f2 = s β‚œβŠ› f1 βŠ›α΅£ f2
t: state (Ξ“ β–Άβ‚“ Β¬ B)
H0: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ B) =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (t β‚œβŠ› f1) β‚›βŠ›α΅£ f2 = t β‚œβŠ› f1 βŠ›α΅£ f2
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ =[ val ]> Ξ“2
f2: Ξ“2 βŠ† Ξ“3
s_subst (Ξ“ β–Άβ‚“ Β¬ A) s (Ξ“2 β–Άβ‚“ Β¬ A) (a_shift1 f1) β‚›βŠ›α΅£ r_shift1 f2 = s_subst (Ξ“ β–Άβ‚“ Β¬ A) s (Ξ“3 β–Άβ‚“ Β¬ A) (a_shift1 (f1 βŠ›α΅£ f2))
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ A) =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (s β‚œβŠ› f1) β‚›βŠ›α΅£ f2 = s β‚œβŠ› f1 βŠ›α΅£ f2
t: state (Ξ“ β–Άβ‚“ Β¬ B)
H0: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ B) =[ val ]> Ξ“2) (f2 : Ξ“2 βŠ† Ξ“3), (t β‚œβŠ› f1) β‚›βŠ›α΅£ f2 = t β‚œβŠ› f1 βŠ›α΅£ f2
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ =[ val ]> Ξ“2
f2: Ξ“2 βŠ† Ξ“3
s_subst (Ξ“ β–Άβ‚“ Β¬ B) t (Ξ“2 β–Άβ‚“ Β¬ B) (a_shift1 f1) β‚›βŠ›α΅£ r_shift1 f2 = s_subst (Ξ“ β–Άβ‚“ Β¬ B) t (Ξ“3 β–Άβ‚“ Β¬ B) (a_shift1 (f1 βŠ›α΅£ f2))
all: first [ rewrite a_shift1_ren_r | rewrite a_shift3_ren_r ]; auto. Qed.
Ξ“1, Ξ“2, Ξ“3: t_ctx
f1: Ξ“1 =[ val ]> Ξ“2
f2: Ξ“2 βŠ† Ξ“3
A: ty
t: term Ξ“1 A

(t `β‚œβŠ› f1) β‚œβŠ›α΅£ f2 = t `β‚œβŠ› f1 βŠ›α΅£ f2
now apply (term_ind_mut _ _ _ ren_sub_prf). Qed.
Ξ“1, Ξ“2, Ξ“3: t_ctx
f1: Ξ“1 =[ val ]> Ξ“2
f2: Ξ“2 βŠ† Ξ“3
A: pre_ty
v: whn Ξ“1 A

(v `α΅₯βŠ› f1) `α΅₯βŠ›α΅£ f2 = v `α΅₯βŠ› f1 βŠ›α΅£ f2
now apply (whn_ind_mut _ _ _ ren_sub_prf). Qed.
Ξ“1, Ξ“2, Ξ“3: t_ctx
f1: Ξ“1 =[ val ]> Ξ“2
f2: Ξ“2 βŠ† Ξ“3
s: state Ξ“1

(s β‚œβŠ› f1) β‚›βŠ›α΅£ f2 = s β‚œβŠ› f1 βŠ›α΅£ f2
now apply (state_ind_mut _ _ _ ren_sub_prf). Qed.
Ξ“1, Ξ“2, Ξ“3: t_ctx
f1: Ξ“1 =[ val ]> Ξ“2
f2: Ξ“2 βŠ† Ξ“3
A: ty
v: val Ξ“1 A

(v α΅₯βŠ› f1) α΅₯βŠ›α΅£ f2 = v α΅₯βŠ› f1 βŠ›α΅£ f2
Ξ“1, Ξ“2, Ξ“3: t_ctx
f1: Ξ“1 =[ val ]> Ξ“2
f2: Ξ“2 βŠ† Ξ“3
p: pre_ty
v: val Ξ“1 ↑ p

(v α΅₯βŠ› f1) α΅₯βŠ›α΅£ f2 = v α΅₯βŠ› f1 βŠ›α΅£ f2
Ξ“1, Ξ“2, Ξ“3: t_ctx
f1: Ξ“1 =[ val ]> Ξ“2
f2: Ξ“2 βŠ† Ξ“3
p: pre_ty
v: val Ξ“1 Β¬ p
(v α΅₯βŠ› f1) α΅₯βŠ›α΅£ f2 = v α΅₯βŠ› f1 βŠ›α΅£ f2
Ξ“1, Ξ“2, Ξ“3: t_ctx
f1: Ξ“1 =[ val ]> Ξ“2
f2: Ξ“2 βŠ† Ξ“3
p: pre_ty
v: val Ξ“1 ↑ p

(v α΅₯βŠ› f1) α΅₯βŠ›α΅£ f2 = v α΅₯βŠ› f1 βŠ›α΅£ f2
now apply w_ren_sub.
Ξ“1, Ξ“2, Ξ“3: t_ctx
f1: Ξ“1 =[ val ]> Ξ“2
f2: Ξ“2 βŠ† Ξ“3
p: pre_ty
v: val Ξ“1 Β¬ p

(v α΅₯βŠ› f1) α΅₯βŠ›α΅£ f2 = v α΅₯βŠ› f1 βŠ›α΅£ f2
now apply t_ren_sub. Qed. Definition t_sub_ren_P Ξ“1 A (t : term Ξ“1 A) : Prop := forall Ξ“2 Ξ“3 (f1 : Ξ“1 βŠ† Ξ“2) (f2 : Ξ“2 =[val]> Ξ“3), (t β‚œβŠ›α΅£ f1) `β‚œβŠ› f2 = t `β‚œβŠ› (f1 α΅£βŠ› f2). Definition w_sub_ren_P Ξ“1 A (v : whn Ξ“1 A) : Prop := forall Ξ“2 Ξ“3 (f1 : Ξ“1 βŠ† Ξ“2) (f2 : Ξ“2 =[val]> Ξ“3), (v `α΅₯βŠ›α΅£ f1) `α΅₯βŠ› f2 = v `α΅₯βŠ› (f1 α΅£βŠ› f2). Definition s_sub_ren_P Ξ“1 (s : state Ξ“1) : Prop := forall Ξ“2 Ξ“3 (f1 : Ξ“1 βŠ† Ξ“2) (f2 : Ξ“2 =[val]> Ξ“3), (s β‚›βŠ›α΅£ f1) β‚œβŠ› f2 = s β‚œβŠ› (f1 α΅£βŠ› f2).

syn_ind_args t_sub_ren_P w_sub_ren_P s_sub_ren_P

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), s_sub_ren_P (Ξ“ β–Άβ‚“ Β¬ A) s -> t_sub_ren_P Ξ“ ↑ A (Mu s)

forall (Ξ“ : t_ctx) (A : pre_ty) (v : whn Ξ“ A), w_sub_ren_P Ξ“ A v -> t_sub_ren_P Ξ“ ↑ A (Val v)

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ Β¬ A), t_sub_ren_P Ξ“ Β¬ A (VarR i)

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), s_sub_ren_P (Ξ“ β–Άβ‚“ ↑ A) s -> t_sub_ren_P Ξ“ Β¬ A (MuT s)

forall Ξ“ : t_ctx, t_sub_ren_P Ξ“ Β¬ `0 Boom

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), w_sub_ren_P Ξ“ A v -> forall k : term Ξ“ Β¬ B, t_sub_ren_P Ξ“ Β¬ B k -> t_sub_ren_P Ξ“ Β¬ (A `β†’ B) (App v k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ A), t_sub_ren_P Ξ“ Β¬ A k -> t_sub_ren_P Ξ“ Β¬ (A `Γ— B) (Fst k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ B), t_sub_ren_P Ξ“ Β¬ B k -> t_sub_ren_P Ξ“ Β¬ (A `Γ— B) (Snd k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), s_sub_ren_P (Ξ“ β–Άβ‚“ ↑ A) s -> forall t : state (Ξ“ β–Άβ‚“ ↑ B), s_sub_ren_P (Ξ“ β–Άβ‚“ ↑ B) t -> t_sub_ren_P Ξ“ Β¬ (A `+ B) (Case s t)

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ ↑ A), w_sub_ren_P Ξ“ A (VarL i)

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), w_sub_ren_P Ξ“ A v -> w_sub_ren_P Ξ“ (A `+ B) (Inl v)

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ B), w_sub_ren_P Ξ“ B v -> w_sub_ren_P Ξ“ (A `+ B) (Inr v)

forall Ξ“ : t_ctx, w_sub_ren_P Ξ“ `1 Tt

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)), s_sub_ren_P (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) s -> w_sub_ren_P Ξ“ (A `β†’ B) (Lam s)

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), s_sub_ren_P (Ξ“ β–Άβ‚“ Β¬ A) s -> forall t : state (Ξ“ β–Άβ‚“ Β¬ B), s_sub_ren_P (Ξ“ β–Άβ‚“ Β¬ B) t -> w_sub_ren_P Ξ“ (A `Γ— B) (Pair s t)

forall (Ξ“ : t_ctx) (A : pre_ty) (u : term Ξ“ ↑ A), t_sub_ren_P Ξ“ ↑ A u -> forall v : term Ξ“ Β¬ A, t_sub_ren_P Ξ“ Β¬ A v -> s_sub_ren_P Ξ“ (Cut u v)

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ A) βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), s β‚›βŠ›α΅£ f1 β‚œβŠ› f2 = s β‚œβŠ› f1 α΅£βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), Mu s β‚œβŠ›α΅£ f1 `β‚œβŠ› f2 = Mu s `β‚œβŠ› f1 α΅£βŠ› f2

forall (Ξ“ : t_ctx) (A : pre_ty) (v : whn Ξ“ A), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), v `α΅₯βŠ›α΅£ f1 `α΅₯βŠ› f2 = v `α΅₯βŠ› f1 α΅£βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), Val v β‚œβŠ›α΅£ f1 `β‚œβŠ› f2 = Val v `β‚œβŠ› f1 α΅£βŠ› f2

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ Β¬ A) (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), VarR i β‚œβŠ›α΅£ f1 `β‚œβŠ› f2 = VarR i `β‚œβŠ› f1 α΅£βŠ› f2

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ A) βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), s β‚›βŠ›α΅£ f1 β‚œβŠ› f2 = s β‚œβŠ› f1 α΅£βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), MuT s β‚œβŠ›α΅£ f1 `β‚œβŠ› f2 = MuT s `β‚œβŠ› f1 α΅£βŠ› f2

forall (Ξ“ Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), Boom β‚œβŠ›α΅£ f1 `β‚œβŠ› f2 = Boom `β‚œβŠ› f1 α΅£βŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), v `α΅₯βŠ›α΅£ f1 `α΅₯βŠ› f2 = v `α΅₯βŠ› f1 α΅£βŠ› f2) -> forall k : term Ξ“ Β¬ B, (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), k β‚œβŠ›α΅£ f1 `β‚œβŠ› f2 = k `β‚œβŠ› f1 α΅£βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), App v k β‚œβŠ›α΅£ f1 `β‚œβŠ› f2 = App v k `β‚œβŠ› f1 α΅£βŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ A), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), k β‚œβŠ›α΅£ f1 `β‚œβŠ› f2 = k `β‚œβŠ› f1 α΅£βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), Fst k β‚œβŠ›α΅£ f1 `β‚œβŠ› f2 = Fst k `β‚œβŠ› f1 α΅£βŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ B), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), k β‚œβŠ›α΅£ f1 `β‚œβŠ› f2 = k `β‚œβŠ› f1 α΅£βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), Snd k β‚œβŠ›α΅£ f1 `β‚œβŠ› f2 = Snd k `β‚œβŠ› f1 α΅£βŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ A) βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), s β‚›βŠ›α΅£ f1 β‚œβŠ› f2 = s β‚œβŠ› f1 α΅£βŠ› f2) -> forall t : state (Ξ“ β–Άβ‚“ ↑ B), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ B) βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), t β‚›βŠ›α΅£ f1 β‚œβŠ› f2 = t β‚œβŠ› f1 α΅£βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), Case s t β‚œβŠ›α΅£ f1 `β‚œβŠ› f2 = Case s t `β‚œβŠ› f1 α΅£βŠ› f2

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ ↑ A) (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), VarL i `α΅₯βŠ›α΅£ f1 `α΅₯βŠ› f2 = VarL i `α΅₯βŠ› f1 α΅£βŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), v `α΅₯βŠ›α΅£ f1 `α΅₯βŠ› f2 = v `α΅₯βŠ› f1 α΅£βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), Inl v `α΅₯βŠ›α΅£ f1 `α΅₯βŠ› f2 = Inl v `α΅₯βŠ› f1 α΅£βŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ B), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), v `α΅₯βŠ›α΅£ f1 `α΅₯βŠ› f2 = v `α΅₯βŠ› f1 α΅£βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), Inr v `α΅₯βŠ›α΅£ f1 `α΅₯βŠ› f2 = Inr v `α΅₯βŠ› f1 α΅£βŠ› f2

forall (Ξ“ Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), Tt `α΅₯βŠ›α΅£ f1 `α΅₯βŠ› f2 = Tt `α΅₯βŠ› f1 α΅£βŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), s β‚›βŠ›α΅£ f1 β‚œβŠ› f2 = s β‚œβŠ› f1 α΅£βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), Lam s `α΅₯βŠ›α΅£ f1 `α΅₯βŠ› f2 = Lam s `α΅₯βŠ› f1 α΅£βŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ A) βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), s β‚›βŠ›α΅£ f1 β‚œβŠ› f2 = s β‚œβŠ› f1 α΅£βŠ› f2) -> forall t : state (Ξ“ β–Άβ‚“ Β¬ B), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ B) βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), t β‚›βŠ›α΅£ f1 β‚œβŠ› f2 = t β‚œβŠ› f1 α΅£βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), Pair s t `α΅₯βŠ›α΅£ f1 `α΅₯βŠ› f2 = Pair s t `α΅₯βŠ› f1 α΅£βŠ› f2

forall (Ξ“ : t_ctx) (A : pre_ty) (u : term Ξ“ ↑ A), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), u β‚œβŠ›α΅£ f1 `β‚œβŠ› f2 = u `β‚œβŠ› f1 α΅£βŠ› f2) -> forall v : term Ξ“ Β¬ A, (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), v β‚œβŠ›α΅£ f1 `β‚œβŠ› f2 = v `β‚œβŠ› f1 α΅£βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), Cut u v β‚›βŠ›α΅£ f1 β‚œβŠ› f2 = Cut u v β‚œβŠ› f1 α΅£βŠ› f2
Ξ“: t_ctx
A: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ A) βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), s β‚›βŠ›α΅£ f1 β‚œβŠ› f2 = s β‚œβŠ› f1 α΅£βŠ› f2
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ βŠ† Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3

s_subst (Ξ“2 β–Άβ‚“ Β¬ A) (s β‚›βŠ›α΅£ r_shift1 f1) (Ξ“3 β–Άβ‚“ Β¬ A) (a_shift1 f2) = s_subst (Ξ“ β–Άβ‚“ Β¬ A) s (Ξ“3 β–Άβ‚“ Β¬ A) (a_shift1 (f1 α΅£βŠ› f2))
Ξ“: t_ctx
A: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ A) βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), s β‚›βŠ›α΅£ f1 β‚œβŠ› f2 = s β‚œβŠ› f1 α΅£βŠ› f2
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ βŠ† Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
s_subst (Ξ“2 β–Άβ‚“ ↑ A) (s β‚›βŠ›α΅£ r_shift1 f1) (Ξ“3 β–Άβ‚“ ↑ A) (a_shift1 f2) = s_subst (Ξ“ β–Άβ‚“ ↑ A) s (Ξ“3 β–Άβ‚“ ↑ A) (a_shift1 (f1 α΅£βŠ› f2))
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ A) βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), s β‚›βŠ›α΅£ f1 β‚œβŠ› f2 = s β‚œβŠ› f1 α΅£βŠ› f2
t: state (Ξ“ β–Άβ‚“ ↑ B)
H0: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ B) βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), t β‚›βŠ›α΅£ f1 β‚œβŠ› f2 = t β‚œβŠ› f1 α΅£βŠ› f2
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ βŠ† Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
s_subst (Ξ“2 β–Άβ‚“ ↑ A) (s β‚›βŠ›α΅£ r_shift1 f1) (Ξ“3 β–Άβ‚“ ↑ A) (a_shift1 f2) = s_subst (Ξ“ β–Άβ‚“ ↑ A) s (Ξ“3 β–Άβ‚“ ↑ A) (a_shift1 (f1 α΅£βŠ› f2))
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ A) βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), s β‚›βŠ›α΅£ f1 β‚œβŠ› f2 = s β‚œβŠ› f1 α΅£βŠ› f2
t: state (Ξ“ β–Άβ‚“ ↑ B)
H0: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ B) βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), t β‚›βŠ›α΅£ f1 β‚œβŠ› f2 = t β‚œβŠ› f1 α΅£βŠ› f2
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ βŠ† Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
s_subst (Ξ“2 β–Άβ‚“ ↑ B) (t β‚›βŠ›α΅£ r_shift1 f1) (Ξ“3 β–Άβ‚“ ↑ B) (a_shift1 f2) = s_subst (Ξ“ β–Άβ‚“ ↑ B) t (Ξ“3 β–Άβ‚“ ↑ B) (a_shift1 (f1 α΅£βŠ› f2))
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), s β‚›βŠ›α΅£ f1 β‚œβŠ› f2 = s β‚œβŠ› f1 α΅£βŠ› f2
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ βŠ† Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
s_subst (Ξ“2 β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) (s β‚›βŠ›α΅£ r_shift3 f1) (Ξ“3 β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) (a_shift3 f2) = s_subst (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) s (Ξ“3 β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) (a_shift3 (f1 α΅£βŠ› f2))
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ A) βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), s β‚›βŠ›α΅£ f1 β‚œβŠ› f2 = s β‚œβŠ› f1 α΅£βŠ› f2
t: state (Ξ“ β–Άβ‚“ Β¬ B)
H0: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ B) βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), t β‚›βŠ›α΅£ f1 β‚œβŠ› f2 = t β‚œβŠ› f1 α΅£βŠ› f2
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ βŠ† Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
s_subst (Ξ“2 β–Άβ‚“ Β¬ A) (s β‚›βŠ›α΅£ r_shift1 f1) (Ξ“3 β–Άβ‚“ Β¬ A) (a_shift1 f2) = s_subst (Ξ“ β–Άβ‚“ Β¬ A) s (Ξ“3 β–Άβ‚“ Β¬ A) (a_shift1 (f1 α΅£βŠ› f2))
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ A) βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), s β‚›βŠ›α΅£ f1 β‚œβŠ› f2 = s β‚œβŠ› f1 α΅£βŠ› f2
t: state (Ξ“ β–Άβ‚“ Β¬ B)
H0: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ B) βŠ† Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), t β‚›βŠ›α΅£ f1 β‚œβŠ› f2 = t β‚œβŠ› f1 α΅£βŠ› f2
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ βŠ† Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
s_subst (Ξ“2 β–Άβ‚“ Β¬ B) (t β‚›βŠ›α΅£ r_shift1 f1) (Ξ“3 β–Άβ‚“ Β¬ B) (a_shift1 f2) = s_subst (Ξ“ β–Άβ‚“ Β¬ B) t (Ξ“3 β–Άβ‚“ Β¬ B) (a_shift1 (f1 α΅£βŠ› f2))
all: first [ rewrite a_shift1_ren_l | rewrite a_shift3_ren_l ]; auto. Qed.
Ξ“1, Ξ“2: ctx ty
Ξ“3: t_ctx
f1: Ξ“1 βŠ† Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
A: ty
t: term Ξ“1 A

t β‚œβŠ›α΅£ f1 `β‚œβŠ› f2 = t `β‚œβŠ› f1 α΅£βŠ› f2
now apply (term_ind_mut _ _ _ sub_ren_prf). Qed.
Ξ“1, Ξ“2: ctx ty
Ξ“3: t_ctx
f1: Ξ“1 βŠ† Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
A: pre_ty
v: whn Ξ“1 A

v `α΅₯βŠ›α΅£ f1 `α΅₯βŠ› f2 = v `α΅₯βŠ› f1 α΅£βŠ› f2
now apply (whn_ind_mut _ _ _ sub_ren_prf). Qed.
Ξ“1, Ξ“2: ctx ty
Ξ“3: t_ctx
f1: Ξ“1 βŠ† Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
s: state Ξ“1

s β‚›βŠ›α΅£ f1 β‚œβŠ› f2 = s β‚œβŠ› f1 α΅£βŠ› f2
now apply (state_ind_mut _ _ _ sub_ren_prf). Qed.
Ξ“1, Ξ“2: ctx ty
Ξ“3: t_ctx
f1: Ξ“1 βŠ† Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
A: ty
v: val Ξ“1 A

v α΅₯βŠ›α΅£ f1 α΅₯βŠ› f2 = v α΅₯βŠ› f1 α΅£βŠ› f2
Ξ“1, Ξ“2: ctx ty
Ξ“3: t_ctx
f1: Ξ“1 βŠ† Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
p: pre_ty
v: val Ξ“1 ↑ p

v α΅₯βŠ›α΅£ f1 α΅₯βŠ› f2 = v α΅₯βŠ› f1 α΅£βŠ› f2
Ξ“1, Ξ“2: ctx ty
Ξ“3: t_ctx
f1: Ξ“1 βŠ† Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
p: pre_ty
v: val Ξ“1 Β¬ p
v α΅₯βŠ›α΅£ f1 α΅₯βŠ› f2 = v α΅₯βŠ› f1 α΅£βŠ› f2
Ξ“1, Ξ“2: ctx ty
Ξ“3: t_ctx
f1: Ξ“1 βŠ† Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
p: pre_ty
v: val Ξ“1 ↑ p

v α΅₯βŠ›α΅£ f1 α΅₯βŠ› f2 = v α΅₯βŠ› f1 α΅£βŠ› f2
now apply w_sub_ren.
Ξ“1, Ξ“2: ctx ty
Ξ“3: t_ctx
f1: Ξ“1 βŠ† Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
p: pre_ty
v: val Ξ“1 Β¬ p

v α΅₯βŠ›α΅£ f1 α΅₯βŠ› f2 = v α΅₯βŠ› f1 α΅£βŠ› f2
now apply t_sub_ren. Qed.
Ξ“, Ξ”: t_ctx
f: Ξ“ =[ val ]> Ξ”
A: ty
i: Ξ“ βˆ‹ A

Var i α΅₯βŠ› f = f A i
now destruct A. Qed.
Ξ“1, Ξ“2, Ξ“3: t_ctx
A: ty
f1: Ξ“1 =[ val ]> Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3

a_shift1 (f1 βŠ› f2) ≑ₐ a_shift1 f1 βŠ› a_shift1 f2
Ξ“: ctx ty
Ξ“2, Ξ“3: t_ctx
x: ty
f1: Ξ“ =[ val ]> Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3

Var top = v_subst (Ξ“2 β–Άβ‚“ x) x (Var top) (Ξ“3 β–Άβ‚“ x) (a_shift1 f2)
Ξ“0: ctx ty
Ξ“2, Ξ“3: t_ctx
y: ty
f1: Ξ“0 =[ val ]> Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
x: ty
v: var x Ξ“0
v_shift1 x (v_subst Ξ“2 x (f1 x v) Ξ“3 f2) = v_subst (Ξ“2 β–Άβ‚“ y) x (v_shift1 x (f1 x v)) (Ξ“3 β–Άβ‚“ y) (a_shift1 f2)
Ξ“: ctx ty
Ξ“2, Ξ“3: t_ctx
x: ty
f1: Ξ“ =[ val ]> Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3

Var top = v_subst (Ξ“2 β–Άβ‚“ x) x (Var top) (Ξ“3 β–Άβ‚“ x) (a_shift1 f2)
now rewrite v_sub_id_r.
Ξ“0: ctx ty
Ξ“2, Ξ“3: t_ctx
y: ty
f1: Ξ“0 =[ val ]> Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
x: ty
v: var x Ξ“0

v_shift1 x (v_subst Ξ“2 x (f1 x v) Ξ“3 f2) = v_subst (Ξ“2 β–Άβ‚“ y) x (v_shift1 x (f1 x v)) (Ξ“3 β–Άβ‚“ y) (a_shift1 f2)
now unfold v_shift1; rewrite v_ren_sub, v_sub_ren. Qed.
Ξ“1, Ξ“2, Ξ“3: t_ctx
A, B, C: ty
f1: Ξ“1 =[ val ]> Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3

a_shift3 (f1 βŠ› f2) ≑ₐ a_shift3 f1 βŠ› a_shift3 f2
Ξ“0: ctx ty
Ξ“2, Ξ“3: t_ctx
y1, y0, y: ty
f1: Ξ“0 =[ val ]> Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
a: ty
v: var a Ξ“0

v_shift3 a (v_subst Ξ“2 a (f1 a v) Ξ“3 f2) = v_subst (Ξ“2 β–Άβ‚“ y1 β–Άβ‚“ y0 β–Άβ‚“ y) a (v_shift3 a (f1 a v)) (Ξ“3 β–Άβ‚“ y1 β–Άβ‚“ y0 β–Άβ‚“ y) (a_shift3 f2)
now unfold v_shift3; rewrite v_ren_sub, v_sub_ren. Qed. Definition t_sub_sub_P Ξ“1 A (t : term Ξ“1 A) : Prop := forall Ξ“2 Ξ“3 (f1 : Ξ“1 =[val]> Ξ“2) (f2 : Ξ“2 =[val]> Ξ“3), (t `β‚œβŠ› f1) `β‚œβŠ› f2 = t `β‚œβŠ› (f1 βŠ› f2) . Definition w_sub_sub_P Ξ“1 A (v : whn Ξ“1 A) : Prop := forall Ξ“2 Ξ“3 (f1 : Ξ“1 =[val]> Ξ“2) (f2 : Ξ“2 =[val]> Ξ“3), (v `α΅₯βŠ› f1) `α΅₯βŠ› f2 = v `α΅₯βŠ› (f1 βŠ› f2) . Definition s_sub_sub_P Ξ“1 (s : state Ξ“1) : Prop := forall Ξ“2 Ξ“3 (f1 : Ξ“1 =[val]> Ξ“2) (f2 : Ξ“2 =[val]> Ξ“3), (s β‚œβŠ› f1) β‚œβŠ› f2 = s β‚œβŠ› (f1 βŠ› f2) .

syn_ind_args t_sub_sub_P w_sub_sub_P s_sub_sub_P

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), s_sub_sub_P (Ξ“ β–Άβ‚“ Β¬ A) s -> t_sub_sub_P Ξ“ ↑ A (Mu s)

forall (Ξ“ : t_ctx) (A : pre_ty) (v : whn Ξ“ A), w_sub_sub_P Ξ“ A v -> t_sub_sub_P Ξ“ ↑ A (Val v)

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ Β¬ A), t_sub_sub_P Ξ“ Β¬ A (VarR i)

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), s_sub_sub_P (Ξ“ β–Άβ‚“ ↑ A) s -> t_sub_sub_P Ξ“ Β¬ A (MuT s)

forall Ξ“ : t_ctx, t_sub_sub_P Ξ“ Β¬ `0 Boom

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), w_sub_sub_P Ξ“ A v -> forall k : term Ξ“ Β¬ B, t_sub_sub_P Ξ“ Β¬ B k -> t_sub_sub_P Ξ“ Β¬ (A `β†’ B) (App v k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ A), t_sub_sub_P Ξ“ Β¬ A k -> t_sub_sub_P Ξ“ Β¬ (A `Γ— B) (Fst k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ B), t_sub_sub_P Ξ“ Β¬ B k -> t_sub_sub_P Ξ“ Β¬ (A `Γ— B) (Snd k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), s_sub_sub_P (Ξ“ β–Άβ‚“ ↑ A) s -> forall t : state (Ξ“ β–Άβ‚“ ↑ B), s_sub_sub_P (Ξ“ β–Άβ‚“ ↑ B) t -> t_sub_sub_P Ξ“ Β¬ (A `+ B) (Case s t)

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ ↑ A), w_sub_sub_P Ξ“ A (VarL i)

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), w_sub_sub_P Ξ“ A v -> w_sub_sub_P Ξ“ (A `+ B) (Inl v)

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ B), w_sub_sub_P Ξ“ B v -> w_sub_sub_P Ξ“ (A `+ B) (Inr v)

forall Ξ“ : t_ctx, w_sub_sub_P Ξ“ `1 Tt

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)), s_sub_sub_P (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) s -> w_sub_sub_P Ξ“ (A `β†’ B) (Lam s)

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), s_sub_sub_P (Ξ“ β–Άβ‚“ Β¬ A) s -> forall t : state (Ξ“ β–Άβ‚“ Β¬ B), s_sub_sub_P (Ξ“ β–Άβ‚“ Β¬ B) t -> w_sub_sub_P Ξ“ (A `Γ— B) (Pair s t)

forall (Ξ“ : t_ctx) (A : pre_ty) (u : term Ξ“ ↑ A), t_sub_sub_P Ξ“ ↑ A u -> forall v : term Ξ“ Β¬ A, t_sub_sub_P Ξ“ Β¬ A v -> s_sub_sub_P Ξ“ (Cut u v)

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ A) =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (s β‚œβŠ› f1) β‚œβŠ› f2 = s β‚œβŠ› f1 βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (Mu s `β‚œβŠ› f1) `β‚œβŠ› f2 = Mu s `β‚œβŠ› f1 βŠ› f2

forall (Ξ“ : t_ctx) (A : pre_ty) (v : whn Ξ“ A), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (v `α΅₯βŠ› f1) `α΅₯βŠ› f2 = v `α΅₯βŠ› f1 βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (Val v `β‚œβŠ› f1) `β‚œβŠ› f2 = Val v `β‚œβŠ› f1 βŠ› f2

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ Β¬ A) (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (VarR i `β‚œβŠ› f1) `β‚œβŠ› f2 = VarR i `β‚œβŠ› f1 βŠ› f2

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ A) =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (s β‚œβŠ› f1) β‚œβŠ› f2 = s β‚œβŠ› f1 βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (MuT s `β‚œβŠ› f1) `β‚œβŠ› f2 = MuT s `β‚œβŠ› f1 βŠ› f2

forall (Ξ“ Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (Boom `β‚œβŠ› f1) `β‚œβŠ› f2 = Boom `β‚œβŠ› f1 βŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (v `α΅₯βŠ› f1) `α΅₯βŠ› f2 = v `α΅₯βŠ› f1 βŠ› f2) -> forall k : term Ξ“ Β¬ B, (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (k `β‚œβŠ› f1) `β‚œβŠ› f2 = k `β‚œβŠ› f1 βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (App v k `β‚œβŠ› f1) `β‚œβŠ› f2 = App v k `β‚œβŠ› f1 βŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ A), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (k `β‚œβŠ› f1) `β‚œβŠ› f2 = k `β‚œβŠ› f1 βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (Fst k `β‚œβŠ› f1) `β‚œβŠ› f2 = Fst k `β‚œβŠ› f1 βŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ B), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (k `β‚œβŠ› f1) `β‚œβŠ› f2 = k `β‚œβŠ› f1 βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (Snd k `β‚œβŠ› f1) `β‚œβŠ› f2 = Snd k `β‚œβŠ› f1 βŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ A) =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (s β‚œβŠ› f1) β‚œβŠ› f2 = s β‚œβŠ› f1 βŠ› f2) -> forall t : state (Ξ“ β–Άβ‚“ ↑ B), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ B) =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (t β‚œβŠ› f1) β‚œβŠ› f2 = t β‚œβŠ› f1 βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (Case s t `β‚œβŠ› f1) `β‚œβŠ› f2 = Case s t `β‚œβŠ› f1 βŠ› f2

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ ↑ A) (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (VarL i `α΅₯βŠ› f1) `α΅₯βŠ› f2 = VarL i `α΅₯βŠ› f1 βŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (v `α΅₯βŠ› f1) `α΅₯βŠ› f2 = v `α΅₯βŠ› f1 βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (Inl v `α΅₯βŠ› f1) `α΅₯βŠ› f2 = Inl v `α΅₯βŠ› f1 βŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ B), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (v `α΅₯βŠ› f1) `α΅₯βŠ› f2 = v `α΅₯βŠ› f1 βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (Inr v `α΅₯βŠ› f1) `α΅₯βŠ› f2 = Inr v `α΅₯βŠ› f1 βŠ› f2

forall (Ξ“ Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (Tt `α΅₯βŠ› f1) `α΅₯βŠ› f2 = Tt `α΅₯βŠ› f1 βŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (s β‚œβŠ› f1) β‚œβŠ› f2 = s β‚œβŠ› f1 βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (Lam s `α΅₯βŠ› f1) `α΅₯βŠ› f2 = Lam s `α΅₯βŠ› f1 βŠ› f2

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ A) =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (s β‚œβŠ› f1) β‚œβŠ› f2 = s β‚œβŠ› f1 βŠ› f2) -> forall t : state (Ξ“ β–Άβ‚“ Β¬ B), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ B) =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (t β‚œβŠ› f1) β‚œβŠ› f2 = t β‚œβŠ› f1 βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (Pair s t `α΅₯βŠ› f1) `α΅₯βŠ› f2 = Pair s t `α΅₯βŠ› f1 βŠ› f2

forall (Ξ“ : t_ctx) (A : pre_ty) (u : term Ξ“ ↑ A), (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (u `β‚œβŠ› f1) `β‚œβŠ› f2 = u `β‚œβŠ› f1 βŠ› f2) -> forall v : term Ξ“ Β¬ A, (forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (v `β‚œβŠ› f1) `β‚œβŠ› f2 = v `β‚œβŠ› f1 βŠ› f2) -> forall (Ξ“2 Ξ“3 : t_ctx) (f1 : Ξ“ =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (Cut u v β‚œβŠ› f1) β‚œβŠ› f2 = Cut u v β‚œβŠ› f1 βŠ› f2
Ξ“: t_ctx
A: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ A) =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (s β‚œβŠ› f1) β‚œβŠ› f2 = s β‚œβŠ› f1 βŠ› f2
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ =[ val ]> Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3

s_subst (Ξ“2 β–Άβ‚“ Β¬ A) (s_subst (Ξ“ β–Άβ‚“ Β¬ A) s (Ξ“2 β–Άβ‚“ Β¬ A) (a_shift1 f1)) (Ξ“3 β–Άβ‚“ Β¬ A) (a_shift1 f2) = s_subst (Ξ“ β–Άβ‚“ Β¬ A) s (Ξ“3 β–Άβ‚“ Β¬ A) (a_shift1 (f1 βŠ› f2))
Ξ“: t_ctx
A: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ A) =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (s β‚œβŠ› f1) β‚œβŠ› f2 = s β‚œβŠ› f1 βŠ› f2
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ =[ val ]> Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
s_subst (Ξ“2 β–Άβ‚“ ↑ A) (s_subst (Ξ“ β–Άβ‚“ ↑ A) s (Ξ“2 β–Άβ‚“ ↑ A) (a_shift1 f1)) (Ξ“3 β–Άβ‚“ ↑ A) (a_shift1 f2) = s_subst (Ξ“ β–Άβ‚“ ↑ A) s (Ξ“3 β–Άβ‚“ ↑ A) (a_shift1 (f1 βŠ› f2))
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ A) =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (s β‚œβŠ› f1) β‚œβŠ› f2 = s β‚œβŠ› f1 βŠ› f2
t: state (Ξ“ β–Άβ‚“ ↑ B)
H0: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ B) =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (t β‚œβŠ› f1) β‚œβŠ› f2 = t β‚œβŠ› f1 βŠ› f2
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ =[ val ]> Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
s_subst (Ξ“2 β–Άβ‚“ ↑ A) (s_subst (Ξ“ β–Άβ‚“ ↑ A) s (Ξ“2 β–Άβ‚“ ↑ A) (a_shift1 f1)) (Ξ“3 β–Άβ‚“ ↑ A) (a_shift1 f2) = s_subst (Ξ“ β–Άβ‚“ ↑ A) s (Ξ“3 β–Άβ‚“ ↑ A) (a_shift1 (f1 βŠ› f2))
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ A) =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (s β‚œβŠ› f1) β‚œβŠ› f2 = s β‚œβŠ› f1 βŠ› f2
t: state (Ξ“ β–Άβ‚“ ↑ B)
H0: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ B) =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (t β‚œβŠ› f1) β‚œβŠ› f2 = t β‚œβŠ› f1 βŠ› f2
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ =[ val ]> Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
s_subst (Ξ“2 β–Άβ‚“ ↑ B) (s_subst (Ξ“ β–Άβ‚“ ↑ B) t (Ξ“2 β–Άβ‚“ ↑ B) (a_shift1 f1)) (Ξ“3 β–Άβ‚“ ↑ B) (a_shift1 f2) = s_subst (Ξ“ β–Άβ‚“ ↑ B) t (Ξ“3 β–Άβ‚“ ↑ B) (a_shift1 (f1 βŠ› f2))
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (s β‚œβŠ› f1) β‚œβŠ› f2 = s β‚œβŠ› f1 βŠ› f2
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ =[ val ]> Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
s_subst (Ξ“2 β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) (s_subst (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) s (Ξ“2 β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) (a_shift3 f1)) (Ξ“3 β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) (a_shift3 f2) = s_subst (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) s (Ξ“3 β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) (a_shift3 (f1 βŠ› f2))
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ A) =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (s β‚œβŠ› f1) β‚œβŠ› f2 = s β‚œβŠ› f1 βŠ› f2
t: state (Ξ“ β–Άβ‚“ Β¬ B)
H0: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ B) =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (t β‚œβŠ› f1) β‚œβŠ› f2 = t β‚œβŠ› f1 βŠ› f2
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ =[ val ]> Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
s_subst (Ξ“2 β–Άβ‚“ Β¬ A) (s_subst (Ξ“ β–Άβ‚“ Β¬ A) s (Ξ“2 β–Άβ‚“ Β¬ A) (a_shift1 f1)) (Ξ“3 β–Άβ‚“ Β¬ A) (a_shift1 f2) = s_subst (Ξ“ β–Άβ‚“ Β¬ A) s (Ξ“3 β–Άβ‚“ Β¬ A) (a_shift1 (f1 βŠ› f2))
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ A) =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (s β‚œβŠ› f1) β‚œβŠ› f2 = s β‚œβŠ› f1 βŠ› f2
t: state (Ξ“ β–Άβ‚“ Β¬ B)
H0: forall (Ξ“2 Ξ“3 : t_ctx) (f1 : (Ξ“ β–Άβ‚“ Β¬ B) =[ val ]> Ξ“2) (f2 : Ξ“2 =[ val ]> Ξ“3), (t β‚œβŠ› f1) β‚œβŠ› f2 = t β‚œβŠ› f1 βŠ› f2
Ξ“2, Ξ“3: t_ctx
f1: Ξ“ =[ val ]> Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
s_subst (Ξ“2 β–Άβ‚“ Β¬ B) (s_subst (Ξ“ β–Άβ‚“ Β¬ B) t (Ξ“2 β–Άβ‚“ Β¬ B) (a_shift1 f1)) (Ξ“3 β–Άβ‚“ Β¬ B) (a_shift1 f2) = s_subst (Ξ“ β–Άβ‚“ Β¬ B) t (Ξ“3 β–Άβ‚“ Β¬ B) (a_shift1 (f1 βŠ› f2))
all: first [ rewrite a_shift1_comp | rewrite a_shift3_comp ]; auto. Qed.
Ξ“1, Ξ“2, Ξ“3: t_ctx
f1: Ξ“1 =[ val ]> Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
A: ty
t: term Ξ“1 A

(t `β‚œβŠ› f1) `β‚œβŠ› f2 = t `β‚œβŠ› f1 βŠ› f2
now apply (term_ind_mut _ _ _ sub_sub_prf). Qed.
Ξ“1, Ξ“2, Ξ“3: t_ctx
f1: Ξ“1 =[ val ]> Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
A: pre_ty
v: whn Ξ“1 A

(v `α΅₯βŠ› f1) `α΅₯βŠ› f2 = v `α΅₯βŠ› f1 βŠ› f2
now apply (whn_ind_mut _ _ _ sub_sub_prf). Qed.
Ξ“1, Ξ“2, Ξ“3: t_ctx
f1: Ξ“1 =[ val ]> Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
s: state Ξ“1

(s β‚œβŠ› f1) β‚œβŠ› f2 = s β‚œβŠ› f1 βŠ› f2
now apply (state_ind_mut _ _ _ sub_sub_prf). Qed.
Ξ“1, Ξ“2, Ξ“3: t_ctx
f1: Ξ“1 =[ val ]> Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
A: ty
v: val Ξ“1 A

(v α΅₯βŠ› f1) α΅₯βŠ› f2 = v α΅₯βŠ› f1 βŠ› f2
Ξ“1, Ξ“2, Ξ“3: t_ctx
f1: Ξ“1 =[ val ]> Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
p: pre_ty
v: val Ξ“1 ↑ p

(v α΅₯βŠ› f1) α΅₯βŠ› f2 = v α΅₯βŠ› f1 βŠ› f2
Ξ“1, Ξ“2, Ξ“3: t_ctx
f1: Ξ“1 =[ val ]> Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
p: pre_ty
v: val Ξ“1 Β¬ p
(v α΅₯βŠ› f1) α΅₯βŠ› f2 = v α΅₯βŠ› f1 βŠ› f2
Ξ“1, Ξ“2, Ξ“3: t_ctx
f1: Ξ“1 =[ val ]> Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
p: pre_ty
v: val Ξ“1 ↑ p

(v α΅₯βŠ› f1) α΅₯βŠ› f2 = v α΅₯βŠ› f1 βŠ› f2
now apply w_sub_sub.
Ξ“1, Ξ“2, Ξ“3: t_ctx
f1: Ξ“1 =[ val ]> Ξ“2
f2: Ξ“2 =[ val ]> Ξ“3
p: pre_ty
v: val Ξ“1 Β¬ p

(v α΅₯βŠ› f1) α΅₯βŠ› f2 = v α΅₯βŠ› f1 βŠ› f2
now apply t_sub_sub. Qed.
Ξ“1, Ξ“2, Ξ“3, Ξ“4: t_ctx
u: Ξ“1 =[ val ]> Ξ“2
v: Ξ“2 =[ val ]> Ξ“3
w: Ξ“3 =[ val ]> Ξ“4

(u βŠ› v) βŠ› w ≑ₐ u βŠ› (v βŠ› w)
intros ? i; unfold a_comp; now apply v_sub_sub. Qed. Definition t_sub_id_l_P Ξ“ A (t : term Ξ“ A) : Prop := t `β‚œβŠ› Var = t. Definition w_sub_id_l_P Ξ“ A (v : whn Ξ“ A) : Prop := v `α΅₯βŠ› Var = v. Definition s_sub_id_l_P Ξ“ (s : state Ξ“) : Prop := s β‚œβŠ› Var = s.

syn_ind_args t_sub_id_l_P w_sub_id_l_P s_sub_id_l_P

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), s_sub_id_l_P (Ξ“ β–Άβ‚“ Β¬ A) s -> t_sub_id_l_P Ξ“ ↑ A (Mu s)

forall (Ξ“ : t_ctx) (A : pre_ty) (v : whn Ξ“ A), w_sub_id_l_P Ξ“ A v -> t_sub_id_l_P Ξ“ ↑ A (Val v)

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ Β¬ A), t_sub_id_l_P Ξ“ Β¬ A (VarR i)

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), s_sub_id_l_P (Ξ“ β–Άβ‚“ ↑ A) s -> t_sub_id_l_P Ξ“ Β¬ A (MuT s)

forall Ξ“ : t_ctx, t_sub_id_l_P Ξ“ Β¬ `0 Boom

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), w_sub_id_l_P Ξ“ A v -> forall k : term Ξ“ Β¬ B, t_sub_id_l_P Ξ“ Β¬ B k -> t_sub_id_l_P Ξ“ Β¬ (A `β†’ B) (App v k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ A), t_sub_id_l_P Ξ“ Β¬ A k -> t_sub_id_l_P Ξ“ Β¬ (A `Γ— B) (Fst k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ B), t_sub_id_l_P Ξ“ Β¬ B k -> t_sub_id_l_P Ξ“ Β¬ (A `Γ— B) (Snd k)

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), s_sub_id_l_P (Ξ“ β–Άβ‚“ ↑ A) s -> forall t : state (Ξ“ β–Άβ‚“ ↑ B), s_sub_id_l_P (Ξ“ β–Άβ‚“ ↑ B) t -> t_sub_id_l_P Ξ“ Β¬ (A `+ B) (Case s t)

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ ↑ A), w_sub_id_l_P Ξ“ A (VarL i)

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), w_sub_id_l_P Ξ“ A v -> w_sub_id_l_P Ξ“ (A `+ B) (Inl v)

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ B), w_sub_id_l_P Ξ“ B v -> w_sub_id_l_P Ξ“ (A `+ B) (Inr v)

forall Ξ“ : t_ctx, w_sub_id_l_P Ξ“ `1 Tt

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)), s_sub_id_l_P (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) s -> w_sub_id_l_P Ξ“ (A `β†’ B) (Lam s)

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), s_sub_id_l_P (Ξ“ β–Άβ‚“ Β¬ A) s -> forall t : state (Ξ“ β–Άβ‚“ Β¬ B), s_sub_id_l_P (Ξ“ β–Άβ‚“ Β¬ B) t -> w_sub_id_l_P Ξ“ (A `Γ— B) (Pair s t)

forall (Ξ“ : t_ctx) (A : pre_ty) (u : term Ξ“ ↑ A), t_sub_id_l_P Ξ“ ↑ A u -> forall v : term Ξ“ Β¬ A, t_sub_id_l_P Ξ“ Β¬ A v -> s_sub_id_l_P Ξ“ (Cut u v)

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), s β‚œβŠ› Var = s -> Mu s `β‚œβŠ› Var = Mu s

forall (Ξ“ : t_ctx) (A : pre_ty) (v : whn Ξ“ A), v `α΅₯βŠ› Var = v -> Val v `β‚œβŠ› Var = Val v

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ Β¬ A), VarR i `β‚œβŠ› Var = VarR i

forall (Ξ“ : t_ctx) (A : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), s β‚œβŠ› Var = s -> MuT s `β‚œβŠ› Var = MuT s

forall Ξ“ : t_ctx, Boom `β‚œβŠ› Var = Boom

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), v `α΅₯βŠ› Var = v -> forall k : term Ξ“ Β¬ B, k `β‚œβŠ› Var = k -> App v k `β‚œβŠ› Var = App v k

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ A), k `β‚œβŠ› Var = k -> Fst k `β‚œβŠ› Var = Fst k

forall (Ξ“ : t_ctx) (A B : pre_ty) (k : term Ξ“ Β¬ B), k `β‚œβŠ› Var = k -> Snd k `β‚œβŠ› Var = Snd k

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ A)), s β‚œβŠ› Var = s -> forall t : state (Ξ“ β–Άβ‚“ ↑ B), t β‚œβŠ› Var = t -> Case s t `β‚œβŠ› Var = Case s t

forall (Ξ“ : t_ctx) (A : pre_ty) (i : Ξ“ βˆ‹ ↑ A), VarL i `α΅₯βŠ› Var = VarL i

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ A), v `α΅₯βŠ› Var = v -> Inl v `α΅₯βŠ› Var = Inl v

forall (Ξ“ : t_ctx) (A B : pre_ty) (v : whn Ξ“ B), v `α΅₯βŠ› Var = v -> Inr v `α΅₯βŠ› Var = Inr v

forall Ξ“ : t_ctx, Tt `α΅₯βŠ› Var = Tt

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)), s β‚œβŠ› Var = s -> Lam s `α΅₯βŠ› Var = Lam s

forall (Ξ“ : t_ctx) (A B : pre_ty) (s : state (Ξ“ β–Άβ‚“ Β¬ A)), s β‚œβŠ› Var = s -> forall t : state (Ξ“ β–Άβ‚“ Β¬ B), t β‚œβŠ› Var = t -> Pair s t `α΅₯βŠ› Var = Pair s t

forall (Ξ“ : t_ctx) (A : pre_ty) (u : term Ξ“ ↑ A), u `β‚œβŠ› Var = u -> forall v : term Ξ“ Β¬ A, v `β‚œβŠ› Var = v -> Cut u v β‚œβŠ› Var = Cut u v
Ξ“: t_ctx
A: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: s β‚œβŠ› Var = s

s_subst (Ξ“ β–Άβ‚“ Β¬ A) s (Ξ“ β–Άβ‚“ Β¬ A) (a_shift1 Var) = s
Ξ“: t_ctx
A: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: s β‚œβŠ› Var = s
s_subst (Ξ“ β–Άβ‚“ ↑ A) s (Ξ“ β–Άβ‚“ ↑ A) (a_shift1 Var) = s
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: s β‚œβŠ› Var = s
t: state (Ξ“ β–Άβ‚“ ↑ B)
H0: t β‚œβŠ› Var = t
s_subst (Ξ“ β–Άβ‚“ ↑ A) s (Ξ“ β–Άβ‚“ ↑ A) (a_shift1 Var) = s
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ A)
H: s β‚œβŠ› Var = s
t: state (Ξ“ β–Άβ‚“ ↑ B)
H0: t β‚œβŠ› Var = t
s_subst (Ξ“ β–Άβ‚“ ↑ B) t (Ξ“ β–Άβ‚“ ↑ B) (a_shift1 Var) = t
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)
H: s β‚œβŠ› Var = s
s_subst (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) s (Ξ“ β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B) (a_shift3 Var) = s
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: s β‚œβŠ› Var = s
t: state (Ξ“ β–Άβ‚“ Β¬ B)
H0: t β‚œβŠ› Var = t
s_subst (Ξ“ β–Άβ‚“ Β¬ A) s (Ξ“ β–Άβ‚“ Β¬ A) (a_shift1 Var) = s
Ξ“: t_ctx
A, B: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A)
H: s β‚œβŠ› Var = s
t: state (Ξ“ β–Άβ‚“ Β¬ B)
H0: t β‚œβŠ› Var = t
s_subst (Ξ“ β–Άβ‚“ Β¬ B) t (Ξ“ β–Άβ‚“ Β¬ B) (a_shift1 Var) = t
all: first [ rewrite a_shift1_id | rewrite a_shift3_id ]; auto. Qed.
Ξ“: t_ctx
A: ty
t: term Ξ“ A

t `β‚œβŠ› Var = t
now apply (term_ind_mut _ _ _ sub_id_l_prf). Qed.
Ξ“: t_ctx
A: pre_ty
v: whn Ξ“ A

v `α΅₯βŠ› Var = v
now apply (whn_ind_mut _ _ _ sub_id_l_prf). Qed.
Ξ“: t_ctx
s: state Ξ“

s β‚œβŠ› Var = s
now apply (state_ind_mut _ _ _ sub_id_l_prf). Qed.
Ξ“: t_ctx
A: ty
v: val Ξ“ A

v α΅₯βŠ› Var = v
Ξ“: t_ctx
p: pre_ty
v: val Ξ“ ↑ p

v α΅₯βŠ› Var = v
Ξ“: t_ctx
p: pre_ty
v: val Ξ“ Β¬ p
v α΅₯βŠ› Var = v
Ξ“: t_ctx
p: pre_ty
v: val Ξ“ ↑ p

v α΅₯βŠ› Var = v
now apply w_sub_id_l.
Ξ“: t_ctx
p: pre_ty
v: val Ξ“ Β¬ p

v α΅₯βŠ› Var = v
now apply t_sub_id_l. Qed.
Ξ“, Ξ”: t_ctx
A: ty
f: Ξ“ =[ val ]> Ξ”
v: val Ξ“ A

a_shift1 f βŠ› ₁[ v α΅₯βŠ› f] ≑ₐ ₁[ v] βŠ› f
Ξ“0: ctx ty
Ξ”: t_ctx
a: ty
f: Ξ“0 =[ val ]> Ξ”
v: val Ξ“0 a

v_subst (Ξ” β–Άβ‚“ a) a (Var top) Ξ” ₁[ v_subst Ξ“0 a v Ξ” f] = v_subst Ξ“0 a v Ξ” f
Ξ“1: ctx ty
Ξ”: t_ctx
y: ty
f: Ξ“1 =[ val ]> Ξ”
v: val Ξ“1 y
a: ty
v0: var a Ξ“1
v_subst (Ξ” β–Άβ‚“ y) a (v_shift1 a (f a v0)) Ξ” ₁[ v_subst Ξ“1 y v Ξ” f] = v_subst Ξ“1 a (Var v0) Ξ” f
Ξ“0: ctx ty
Ξ”: t_ctx
a: ty
f: Ξ“0 =[ val ]> Ξ”
v: val Ξ“0 a

v_subst (Ξ” β–Άβ‚“ a) a (Var top) Ξ” ₁[ v_subst Ξ“0 a v Ξ” f] = v_subst Ξ“0 a v Ξ” f
now rewrite v_sub_id_r.
Ξ“1: ctx ty
Ξ”: t_ctx
y: ty
f: Ξ“1 =[ val ]> Ξ”
v: val Ξ“1 y
a: ty
v0: var a Ξ“1

v_subst (Ξ” β–Άβ‚“ y) a (v_shift1 a (f a v0)) Ξ” ₁[ v_subst Ξ“1 y v Ξ” f] = v_subst Ξ“1 a (Var v0) Ξ” f
Ξ“1: ctx ty
Ξ”: t_ctx
y: ty
f: Ξ“1 =[ val ]> Ξ”
v: val Ξ“1 y
a: ty
v0: var a Ξ“1

f a v0 α΅₯βŠ› r_pop α΅£βŠ› ₁[ v_subst Ξ“1 y v Ξ” f] = f a v0
now apply v_sub_id_l. Qed.
Ξ“, Ξ”: ctx ty
A: ty
f: Ξ“ βŠ† Ξ”
v: val Ξ“ A

r_shift1 f α΅£βŠ› ₁[ v α΅₯βŠ›α΅£ f] ≑ₐ ₁[ v] βŠ›α΅£ f
Ξ“1, Ξ”: ctx ty
y: ty
f: Ξ“1 βŠ† Ξ”
v: val Ξ“1 y
a: ty
v0: var a Ξ“1

(r_shift1 f α΅£βŠ› ₁[ v α΅₯βŠ›α΅£ f])%asgn a (pop v0) = (₁[ v] βŠ›α΅£ f)%asgn a (pop v0)
cbn; now rewrite v_ren_id_r. Qed.
Ξ“, Ξ”: t_ctx
A, B: ty
f: Ξ“ =[ val ]> Ξ”
v: val Ξ“ A
w: val (Ξ“ β–Άβ‚“ A) B

(w α΅₯βŠ› a_shift1 f) α΅₯βŠ› ₁[ v α΅₯βŠ› f] = (w α΅₯βŠ› ₁[ v]) α΅₯βŠ› f
Ξ“, Ξ”: t_ctx
A, B: ty
f: Ξ“ =[ val ]> Ξ”
v: val Ξ“ A
w: val (Ξ“ β–Άβ‚“ A) B

w α΅₯βŠ› a_shift1 f βŠ› ₁[ v_subst Ξ“ A v Ξ” f] = w α΅₯βŠ› ₁[ v] βŠ› f
apply v_sub_eq; now rewrite sub1_sub. Qed.
Ξ“, Ξ”: ctx ty
A, B: ty
f: Ξ“ βŠ† Ξ”
v: val Ξ“ A
w: val (Ξ“ β–Άβ‚“ A) B

w α΅₯βŠ›α΅£ r_shift1 f α΅₯βŠ› ₁[ v α΅₯βŠ›α΅£ f] = (w α΅₯βŠ› ₁[ v]) α΅₯βŠ›α΅£ f
Ξ“, Ξ”: ctx ty
A, B: ty
f: Ξ“ βŠ† Ξ”
v: val Ξ“ A
w: val (Ξ“ β–Άβ‚“ A) B

w α΅₯βŠ› r_shift1 f α΅£βŠ› ₁[ v α΅₯βŠ›α΅£ f] = w α΅₯βŠ› ₁[ v] βŠ›α΅£ f
apply v_sub_eq; now rewrite sub1_ren. Qed.
Ξ“, Ξ”: t_ctx
A: ty
f: Ξ“ =[ val ]> Ξ”
v: val Ξ“ A
s: state (Ξ“ β–Άβ‚“ A)

(s β‚œβŠ› a_shift1 f) β‚œβŠ› ₁[ v α΅₯βŠ› f] = (s β‚œβŠ› ₁[ v]) β‚œβŠ› f
cbn; now rewrite 2 s_sub_sub, sub1_sub. Qed.
Ξ“, Ξ”: t_ctx
A, B, C: ty
f: Ξ“ =[ val ]> Ξ”
s: state (Ξ“ β–Άβ‚“ A β–Άβ‚“ B β–Άβ‚“ C)
u: val Ξ“ A
v: val Ξ“ B
w: val Ξ“ C

(s β‚œβŠ› a_shift3 f) β‚œβŠ› ₃[ u α΅₯βŠ› f, v α΅₯βŠ› f, w α΅₯βŠ› f] = (s β‚œβŠ› ₃[ u, v, w]) β‚œβŠ› f
Ξ“, Ξ”: t_ctx
A, B, C: ty
f: Ξ“ =[ val ]> Ξ”
s: state (Ξ“ β–Άβ‚“ A β–Άβ‚“ B β–Άβ‚“ C)
u: val Ξ“ A
v: val Ξ“ B
w: val Ξ“ C

a_shift3 f βŠ› ₃[ v_subst Ξ“ A u Ξ” f, v_subst Ξ“ B v Ξ” f, v_subst Ξ“ C w Ξ” f] ≑ₐ ₃[ u, v, w] βŠ› f
Ξ“, Ξ”: t_ctx
A, B, C: ty
f: Ξ“ =[ val ]> Ξ”
s: state (Ξ“ β–Άβ‚“ A β–Άβ‚“ B β–Άβ‚“ C)
u: val Ξ“ A
v: val Ξ“ B
w: val Ξ“ C
a: ty
v0: Ξ“ β–Άβ‚“ A β–Άβ‚“ B β–Άβ‚“ C βˆ‹ a

v_subst (Ξ” β–Άβ‚“ A β–Άβ‚“ B β–Άβ‚“ C) a (a_shift3 f a v0) Ξ” ₃[ v_subst Ξ“ A u Ξ” f, v_subst Ξ“ B v Ξ” f, v_subst Ξ“ C w Ξ” f] = v_subst Ξ“ a (₃[ u, v, w] a v0) Ξ” f
Ξ“1: ctx ty
Ξ”: t_ctx
y1, y0, y: ty
f: Ξ“1 =[ val ]> Ξ”
s: state (Ξ“1 β–Άβ‚“ y1 β–Άβ‚“ y0 β–Άβ‚“ y)
u: val Ξ“1 y1
v: val Ξ“1 y0
w: val Ξ“1 y
a: ty
v0: var a Ξ“1

v_subst (Ξ” β–Άβ‚“ y1 β–Άβ‚“ y0 β–Άβ‚“ y) a (v_shift3 a (f a v0)) Ξ” ₃[ v_subst Ξ“1 y1 u Ξ” f, v_subst Ξ“1 y0 v Ξ” f, v_subst Ξ“1 y w Ξ” f] = v_subst Ξ“1 a (Var v0) Ξ” f
Ξ“1: ctx ty
Ξ”: t_ctx
y1, y0, y: ty
f: Ξ“1 =[ val ]> Ξ”
s: state (Ξ“1 β–Άβ‚“ y1 β–Άβ‚“ y0 β–Άβ‚“ y)
u: val Ξ“1 y1
v: val Ξ“1 y0
w: val Ξ“1 y
a: ty
v0: var a Ξ“1

f a v0 α΅₯βŠ› ((r_pop α΅£βŠ› r_pop) α΅£βŠ› r_pop) α΅£βŠ› ₃[ v_subst Ξ“1 y1 u Ξ” f, v_subst Ξ“1 y0 v Ξ” f, v_subst Ξ“1 y w Ξ” f] = f a v0 α΅₯βŠ› Var
now apply v_sub_eq. Qed.
Ξ“, Ξ”: ctx ty
A: ty
f: Ξ“ βŠ† Ξ”
v: val Ξ“ A
s: state (Ξ“ β–Άβ‚“ A)

s β‚›βŠ›α΅£ r_shift1 f β‚œβŠ› ₁[ v α΅₯βŠ›α΅£ f] = (s β‚œβŠ› ₁[ v]) β‚›βŠ›α΅£ f
cbn; now rewrite s_sub_ren, s_ren_sub, sub1_ren. Qed.
Ξ“, Ξ”: t_ctx
A, B: ty
f: Ξ“ =[ val ]> Ξ”
v: val Ξ“ A
t: term (Ξ“ β–Άβ‚“ A) B

(t `β‚œβŠ› a_shift1 f) `β‚œβŠ› ₁[ v α΅₯βŠ› f] = (t `β‚œβŠ› ₁[ v]) `β‚œβŠ› f
Ξ“, Ξ”: t_ctx
A, B: ty
f: Ξ“ =[ val ]> Ξ”
v: val Ξ“ A
t: term (Ξ“ β–Άβ‚“ A) B

t `β‚œβŠ› a_shift1 f βŠ› ₁[ v_subst Ξ“ A v Ξ” f] = t `β‚œβŠ› ₁[ v] βŠ› f
apply t_sub_eq; now rewrite sub1_sub. Qed.
Ξ“, Ξ”: ctx ty
A, B: ty
f: Ξ“ βŠ† Ξ”
v: val Ξ“ A
t: term (Ξ“ β–Άβ‚“ A) B

t β‚œβŠ›α΅£ r_shift1 f `β‚œβŠ› ₁[ v α΅₯βŠ›α΅£ f] = (t `β‚œβŠ› ₁[ v]) β‚œβŠ›α΅£ f
Ξ“, Ξ”: ctx ty
A, B: ty
f: Ξ“ βŠ† Ξ”
v: val Ξ“ A
t: term (Ξ“ β–Άβ‚“ A) B

t `β‚œβŠ› r_shift1 f α΅£βŠ› ₁[ v α΅₯βŠ›α΅£ f] = t `β‚œβŠ› ₁[ v] βŠ›α΅£ f
apply t_sub_eq; now rewrite sub1_ren. Qed.
Ξ“: t_ctx
A: ty
v: val Ξ“ A
m: pat A †

Proper (asgn_eq (pat_dom m) Ξ“ ==> eq) (p_app v m)
Ξ“: t_ctx
p: pre_ty
v: val Ξ“ ↑ p
m: pat (↑ p) †
u1, u2: pat_dom m =[ val ]> Ξ“
H: u1 ≑ₐ u2

Cut (Val v) (m `β‚œβŠ› u1) = Cut (Val v) (m `β‚œβŠ› u2)
Ξ“: t_ctx
p: pre_ty
v: val Ξ“ Β¬ p
m: pat (Β¬ p) †
u1, u2: pat_dom m =[ val ]> Ξ“
H: u1 ≑ₐ u2
Cut (Val (m `α΅₯βŠ› u1)) v = Cut (Val (m `α΅₯βŠ› u2)) v
Ξ“: t_ctx
p: pre_ty
v: val Ξ“ Β¬ p
m: pat (Β¬ p) †
u1, u2: pat_dom m =[ val ]> Ξ“
H: u1 ≑ₐ u2

Cut (Val (m `α΅₯βŠ› u1)) v = Cut (Val (m `α΅₯βŠ› u2)) v
now rewrite (w_sub_eq u1 u2 H). Qed.
Ξ“: neg_ctx
A: pre_ty
v: whn Ξ“ A

(p_of_w A v : val (pat_dom (p_of_w A v)) ↑ A) `α΅₯βŠ› p_dom_of_w A v = v
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ `0

p_of_w `0 (VarL i) `α΅₯βŠ› p_dom_of_w `0 (VarL i) = VarL i
Ξ“: neg_ctx
a, b: pre_ty
i: Ξ“ βˆ‹ ↑ (a `+ b)
p_of_w (a `+ b) (VarL i) `α΅₯βŠ› p_dom_of_w (a `+ b) (VarL i) = VarL i
Ξ“: neg_ctx
a, b: pre_ty
v: whn Ξ“ a
H: p_of_w a v `α΅₯βŠ› p_dom_of_w a v = v
Heqcall: PInl (p_of_w a v) = p_of_w (a `+ b) (Inl v)
p_of_w (a `+ b) (Inl v) `α΅₯βŠ› p_dom_of_w (a `+ b) (Inl v) = Inl v
Ξ“: neg_ctx
a, b: pre_ty
v: whn Ξ“ b
H: p_of_w b v `α΅₯βŠ› p_dom_of_w b v = v
Heqcall: PInr (p_of_w b v) = p_of_w (a `+ b) (Inr v)
p_of_w (a `+ b) (Inr v) `α΅₯βŠ› p_dom_of_w (a `+ b) (Inr v) = Inr v
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ `0

p_of_w `0 (VarL i) `α΅₯βŠ› p_dom_of_w `0 (VarL i) = VarL i
destruct (s_prf i).
Ξ“: neg_ctx
a, b: pre_ty
i: Ξ“ βˆ‹ ↑ (a `+ b)

p_of_w (a `+ b) (VarL i) `α΅₯βŠ› p_dom_of_w (a `+ b) (VarL i) = VarL i
destruct (s_prf i).
Ξ“: neg_ctx
a, b: pre_ty
v: whn Ξ“ a
H: p_of_w a v `α΅₯βŠ› p_dom_of_w a v = v
Heqcall: PInl (p_of_w a v) = p_of_w (a `+ b) (Inl v)

p_of_w (a `+ b) (Inl v) `α΅₯βŠ› p_dom_of_w (a `+ b) (Inl v) = Inl v
now cbn; f_equal.
Ξ“: neg_ctx
a, b: pre_ty
v: whn Ξ“ b
H: p_of_w b v `α΅₯βŠ› p_dom_of_w b v = v
Heqcall: PInr (p_of_w b v) = p_of_w (a `+ b) (Inr v)

p_of_w (a `+ b) (Inr v) `α΅₯βŠ› p_dom_of_w (a `+ b) (Inr v) = Inr v
now cbn; f_equal. Qed. Equations p_of_w_eq {Ξ“ : neg_ctx} A (p : pat ↑A) (e : pat_dom p =[val]> Ξ“) : p_of_w A ((p : val _ _) `α΅₯βŠ› e) = p := p_of_w_eq (a `+ b) (PInl v) e := f_equal PInl (p_of_w_eq _ v e) ; p_of_w_eq (a `+ b) (PInr v) e := f_equal PInr (p_of_w_eq _ v e) ; p_of_w_eq (`1) PTt e := eq_refl ; p_of_w_eq (a `Γ— b) PPair e := eq_refl ; p_of_w_eq (a `β†’ b) PLam e := eq_refl .
Ξ“: neg_ctx
A: pre_ty
p: pat ↑ A
e: pat_dom p =[ val ]> Ξ“

rew [fun p : pat ↑ A => pat_dom p =[ val ]> Ξ“] p_of_w_eq A p e in p_dom_of_w A ((p : val (pat_dom p) ↑ A) `α΅₯βŠ› e) ≑ₐ e
Ξ“: neg_ctx
e: pat_dom PTt =[ val ]> Ξ“
Heqcall: eq_refl = p_of_w_eq `1 PTt e

! ▢ₐ e ↑ `1 top ≑ₐ e
Ξ“: neg_ctx
a, b: pre_ty
e: pat_dom PPair =[ val ]> Ξ“
Heqcall: eq_refl = p_of_w_eq (a `Γ— b) PPair e
! ▢ₐ e ↑ (a `Γ— b) top ≑ₐ e
Ξ“: neg_ctx
a, b: pre_ty
v: pat ↑ a
e: pat_dom (PInl v) =[ val ]> Ξ“
H: rew [fun p : pat ↑ a => pat_dom p =[ val ]> Ξ“] p_of_w_eq a v e in p_dom_of_w a (v `α΅₯βŠ› e) ≑ₐ e
rew [fun p : pat ↑ (a `+ b) => pat_dom p =[ val ]> Ξ“] f_equal PInl (p_of_w_eq a v e) in p_dom_of_w a (v `α΅₯βŠ› e) ≑ₐ e
Ξ“: neg_ctx
a, b: pre_ty
v: pat ↑ b
e: pat_dom (PInr v) =[ val ]> Ξ“
H: rew [fun p : pat ↑ b => pat_dom p =[ val ]> Ξ“] p_of_w_eq b v e in p_dom_of_w b (v `α΅₯βŠ› e) ≑ₐ e
rew [fun p : pat ↑ (a `+ b) => pat_dom p =[ val ]> Ξ“] f_equal PInr (p_of_w_eq b v e) in p_dom_of_w b (v `α΅₯βŠ› e) ≑ₐ e
Ξ“: neg_ctx
a, b: pre_ty
e: pat_dom PLam =[ val ]> Ξ“
Heqcall: eq_refl = p_of_w_eq (a `β†’ b) PLam e
! ▢ₐ e ↑ (a `β†’ b) top ≑ₐ e
Ξ“: neg_ctx
e: pat_dom PTt =[ val ]> Ξ“
Heqcall: eq_refl = p_of_w_eq `1 PTt e

! ▢ₐ e ↑ `1 top ≑ₐ e
intros ? v; repeat (dependent elimination v; auto).
Ξ“: neg_ctx
a, b: pre_ty
e: pat_dom PPair =[ val ]> Ξ“
Heqcall: eq_refl = p_of_w_eq (a `Γ— b) PPair e

! ▢ₐ e ↑ (a `Γ— b) top ≑ₐ e
intros ? v; repeat (dependent elimination v; auto).
Ξ“: neg_ctx
a, b: pre_ty
v: pat ↑ a
e: pat_dom (PInl v) =[ val ]> Ξ“
H: rew [fun p : pat ↑ a => pat_dom p =[ val ]> Ξ“] p_of_w_eq a v e in p_dom_of_w a (v `α΅₯βŠ› e) ≑ₐ e

rew [fun p : pat ↑ (a `+ b) => pat_dom p =[ val ]> Ξ“] f_equal PInl (p_of_w_eq a v e) in p_dom_of_w a (v `α΅₯βŠ› e) ≑ₐ e
Ξ“: neg_ctx
a, b: pre_ty
v: pat ↑ a
e: pat_dom (PInl v) =[ val ]> Ξ“
H: rew [fun p : pat ↑ a => pat_dom p =[ val ]> Ξ“] p_of_w_eq a v e in p_dom_of_w a (v `α΅₯βŠ› e) ≑ₐ e
xx:= rew [fun p : pat ↑ (a `+ b) => pat_dom p =[ val ]> Ξ“] f_equal PInl (p_of_w_eq a v e) in p_dom_of_w a (v `α΅₯βŠ› e): (fun p : pat ↑ (a `+ b) => pat_dom p =[ val ]> Ξ“) (PInl v)

xx ≑ₐ e
Ξ“: neg_ctx
a, b: pre_ty
v: pat ↑ a
e: pat_dom (PInl v) =[ val ]> Ξ“
H: rew [fun p : pat ↑ a => pat_dom p =[ val ]> Ξ“] p_of_w_eq a v e in p_dom_of_w a (v `α΅₯βŠ› e) ≑ₐ e
xx': (fun p : pat ↑ (a `+ b) => pat_dom p =[ val ]> Ξ“) (PInl v)
Heqxx': xx' = rew [fun p : pat ↑ (a `+ b) => pat_dom p =[ val ]> Ξ“] f_equal PInl (p_of_w_eq a v e) in p_dom_of_w a (v `α΅₯βŠ› e)

xx' ≑ₐ e
now rewrite (eq_trans Heqxx' (eq_sym (rew_map _ PInl _ _))).
Ξ“: neg_ctx
a, b: pre_ty
v: pat ↑ b
e: pat_dom (PInr v) =[ val ]> Ξ“
H: rew [fun p : pat ↑ b => pat_dom p =[ val ]> Ξ“] p_of_w_eq b v e in p_dom_of_w b (v `α΅₯βŠ› e) ≑ₐ e

rew [fun p : pat ↑ (a `+ b) => pat_dom p =[ val ]> Ξ“] f_equal PInr (p_of_w_eq b v e) in p_dom_of_w b (v `α΅₯βŠ› e) ≑ₐ e
Ξ“: neg_ctx
a, b: pre_ty
v: pat ↑ b
e: pat_dom (PInr v) =[ val ]> Ξ“
H: rew [fun p : pat ↑ b => pat_dom p =[ val ]> Ξ“] p_of_w_eq b v e in p_dom_of_w b (v `α΅₯βŠ› e) ≑ₐ e
xx:= rew [fun p : pat ↑ (a `+ b) => pat_dom p =[ val ]> Ξ“] f_equal PInr (p_of_w_eq b v e) in p_dom_of_w b (v `α΅₯βŠ› e): (fun p : pat ↑ (a `+ b) => pat_dom p =[ val ]> Ξ“) (PInr v)

xx ≑ₐ e
Ξ“: neg_ctx
a, b: pre_ty
v: pat ↑ b
e: pat_dom (PInr v) =[ val ]> Ξ“
H: rew [fun p : pat ↑ b => pat_dom p =[ val ]> Ξ“] p_of_w_eq b v e in p_dom_of_w b (v `α΅₯βŠ› e) ≑ₐ e
xx': (fun p : pat ↑ (a `+ b) => pat_dom p =[ val ]> Ξ“) (PInr v)
Heqxx': xx' = rew [fun p : pat ↑ (a `+ b) => pat_dom p =[ val ]> Ξ“] f_equal PInr (p_of_w_eq b v e) in p_dom_of_w b (v `α΅₯βŠ› e)

xx' ≑ₐ e
now rewrite (eq_trans Heqxx' (eq_sym (rew_map _ PInr _ _))).
Ξ“: neg_ctx
a, b: pre_ty
e: pat_dom PLam =[ val ]> Ξ“
Heqcall: eq_refl = p_of_w_eq (a `β†’ b) PLam e

! ▢ₐ e ↑ (a `β†’ b) top ≑ₐ e
intros ? v; repeat (dependent elimination v; auto). Qed. Notation val_n := (val ∘ neg_c_coe). Notation state_n := (state ∘ neg_c_coe).

subst_monoid val_n

c_var ⇒₁ val_n

val_n ⇒₁ (⟦ val_n, val_n βŸ§β‚)

c_var ⇒₁ val_n
intros Ξ“ x i; exact (Var i).

val_n ⇒₁ (⟦ val_n, val_n βŸ§β‚)
intros Ξ“ x v Ξ” f; exact (v α΅₯βŠ› f). Defined.

subst_module val_n state_n
esplit; intros Ξ“ s Ξ” f; exact (s β‚œβŠ› (f : Ξ“ =[val]> Ξ”)). Defined.

subst_monoid_laws val_n

Proper (βˆ€β‚• Ξ“, (βˆ€β‚• a, eq ==> (βˆ€β‚• Ξ”, asgn_eq Ξ“ Ξ” ==> eq))) v_sub

forall (Ξ“1 Ξ“2 : neg_ctx) (x : ty) (i : Ξ“1 βˆ‹ x) (p : Ξ“1 =[ val_n ]> Ξ“2), a_id i α΅₯βŠ› p = p x i

forall (Ξ“ : neg_ctx) (x : ty) (v : val Ξ“ x), v α΅₯βŠ› a_id = v

forall (Ξ“1 Ξ“2 Ξ“3 : neg_ctx) (x : ty) (v : val Ξ“1 x) (a : Ξ“1 =[ val_n ]> Ξ“2) (b : Ξ“2 =[ val_n ]> Ξ“3), v α΅₯βŠ› a βŠ› b = (v α΅₯βŠ› a) α΅₯βŠ› b

Proper (βˆ€β‚• Ξ“, (βˆ€β‚• a, eq ==> (βˆ€β‚• Ξ”, asgn_eq Ξ“ Ξ” ==> eq))) v_sub
intros ???? <- ????; now apply v_sub_eq.

forall (Ξ“1 Ξ“2 : neg_ctx) (x : ty) (i : Ξ“1 βˆ‹ x) (p : Ξ“1 =[ val_n ]> Ξ“2), a_id i α΅₯βŠ› p = p x i
intros ?????; now apply v_sub_id_r.

forall (Ξ“ : neg_ctx) (x : ty) (v : val Ξ“ x), v α΅₯βŠ› a_id = v
intros ???; now apply v_sub_id_l.

forall (Ξ“1 Ξ“2 Ξ“3 : neg_ctx) (x : ty) (v : val Ξ“1 x) (a : Ξ“1 =[ val_n ]> Ξ“2) (b : Ξ“2 =[ val_n ]> Ξ“3), v α΅₯βŠ› a βŠ› b = (v α΅₯βŠ› a) α΅₯βŠ› b
intros ???????; symmetry; now apply v_sub_sub. Qed.

subst_module_laws val_n state_n

Proper (βˆ€β‚• Ξ“, eq ==> (βˆ€β‚• Ξ”, asgn_eq Ξ“ Ξ” ==> eq)) c_sub

forall (Ξ“ : neg_ctx) (c : state Ξ“), c β‚œβŠ› a_id = c

forall (Ξ“1 Ξ“2 Ξ“3 : neg_ctx) (c : state Ξ“1) (a : Ξ“1 =[ val_n ]> Ξ“2) (b : Ξ“2 =[ val_n ]> Ξ“3), c β‚œβŠ› a βŠ› b = (c β‚œβŠ› a) β‚œβŠ› b

Proper (βˆ€β‚• Ξ“, eq ==> (βˆ€β‚• Ξ”, asgn_eq Ξ“ Ξ” ==> eq)) c_sub
intros ??? <- ????; now apply s_sub_eq.

forall (Ξ“ : neg_ctx) (c : state Ξ“), c β‚œβŠ› a_id = c
intros ??; now apply s_sub_id_l.

forall (Ξ“1 Ξ“2 Ξ“3 : neg_ctx) (c : state Ξ“1) (a : Ξ“1 =[ val_n ]> Ξ“2) (b : Ξ“2 =[ val_n ]> Ξ“3), c β‚œβŠ› a βŠ› b = (c β‚œβŠ› a) β‚œβŠ› b
intros ??????; symmetry; now apply s_sub_sub. Qed.

var_assumptions val_n

forall (Ξ“ : neg_ctx) (x : ty), injective (a_id (x:=x))

forall (Ξ“ : neg_ctx) (x : ty) (v : val Ξ“ x), decidable (is_var v)

forall (Ξ“1 Ξ“2 : neg_ctx) (x : ty) (v : val Ξ“1 x) (r : Ξ“1 βŠ† Ξ“2), is_var (v_ren v r) -> is_var v

forall (Ξ“ : neg_ctx) (x : ty), injective (a_id (x:=x))
intros ? [] ?? H; now dependent destruction H.

forall (Ξ“ : neg_ctx) (x : ty) (v : val Ξ“ x), decidable (is_var v)
Ξ“: neg_ctx
A: pre_ty
c: Ξ“ βˆ‹ ↑ A

decidable (is_var (VarL c))
Ξ“: neg_ctx
A0, B: pre_ty
w: whn Ξ“ A0
decidable (is_var (Inl w))
Ξ“: neg_ctx
A1, B0: pre_ty
w0: whn Ξ“ B0
decidable (is_var (Inr w0))
Ξ“: neg_ctx
decidable (is_var Tt)
Ξ“: neg_ctx
A2, B1: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A2)
s0: state (Ξ“ β–Άβ‚“ Β¬ B1)
decidable (is_var (Pair s s0))
Ξ“: neg_ctx
A3, B2: pre_ty
s1: state (Ξ“ β–Άβ‚“ ↑ (A3 `β†’ B2) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B2)
decidable (is_var (Lam s1))
Ξ“: neg_ctx
A1: pre_ty
c: Ξ“ βˆ‹ Β¬ A1
decidable (is_var (VarR c))
Ξ“: neg_ctx
A2: pre_ty
s0: state (Ξ“ β–Άβ‚“ ↑ A2)
decidable (is_var (MuT s0))
Ξ“: neg_ctx
decidable (is_var Boom)
Ξ“: neg_ctx
A3, B: pre_ty
s1: state (Ξ“ β–Άβ‚“ ↑ A3)
s2: state (Ξ“ β–Άβ‚“ ↑ B)
decidable (is_var (Case s1 s2))
Ξ“: neg_ctx
A4, B0: pre_ty
t: term Ξ“ Β¬ A4
decidable (is_var (Fst t))
Ξ“: neg_ctx
A5, B1: pre_ty
t0: term Ξ“ Β¬ B1
decidable (is_var (Snd t0))
Ξ“: neg_ctx
A6, B2: pre_ty
w0: whn Ξ“ A6
t1: term Ξ“ Β¬ B2
decidable (is_var (App w0 t1))
Ξ“: neg_ctx
A0, B: pre_ty
w: whn Ξ“ A0

decidable (is_var (Inl w))
Ξ“: neg_ctx
A1, B0: pre_ty
w0: whn Ξ“ B0
decidable (is_var (Inr w0))
Ξ“: neg_ctx
decidable (is_var Tt)
Ξ“: neg_ctx
A2, B1: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A2)
s0: state (Ξ“ β–Άβ‚“ Β¬ B1)
decidable (is_var (Pair s s0))
Ξ“: neg_ctx
A3, B2: pre_ty
s1: state (Ξ“ β–Άβ‚“ ↑ (A3 `β†’ B2) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B2)
decidable (is_var (Lam s1))
Ξ“: neg_ctx
A2: pre_ty
s0: state (Ξ“ β–Άβ‚“ ↑ A2)
decidable (is_var (MuT s0))
Ξ“: neg_ctx
decidable (is_var Boom)
Ξ“: neg_ctx
A3, B: pre_ty
s1: state (Ξ“ β–Άβ‚“ ↑ A3)
s2: state (Ξ“ β–Άβ‚“ ↑ B)
decidable (is_var (Case s1 s2))
Ξ“: neg_ctx
A4, B0: pre_ty
t: term Ξ“ Β¬ A4
decidable (is_var (Fst t))
Ξ“: neg_ctx
A5, B1: pre_ty
t0: term Ξ“ Β¬ B1
decidable (is_var (Snd t0))
Ξ“: neg_ctx
A6, B2: pre_ty
w0: whn Ξ“ A6
t1: term Ξ“ Β¬ B2
decidable (is_var (App w0 t1))
all: apply No; intro H; dependent destruction H.

forall (Ξ“1 Ξ“2 : neg_ctx) (x : ty) (v : val Ξ“1 x) (r : Ξ“1 βŠ† Ξ“2), is_var (v_ren v r) -> is_var v
Ξ“2, Ξ“1: neg_ctx
A: pre_ty
c: Ξ“1 βˆ‹ ↑ A
r: Ξ“1 βŠ† Ξ“2
X: is_var (v_ren (VarL c) r)

is_var (VarL c)
Ξ“2, Ξ“1: neg_ctx
A, B: pre_ty
v: whn Ξ“1 A
IHv: forall (Ξ“3 : neg_ctx) (v0 : whn Ξ“3 A), Ξ“1 ~= Ξ“3 -> v ~= v0 -> forall r : Ξ“3 βŠ† Ξ“2, is_var (v_ren v0 r) -> is_var v0
r: Ξ“1 βŠ† Ξ“2
X: is_var (v_ren (Inl v) r)
is_var (Inl v)
Ξ“2, Ξ“1: neg_ctx
A, B: pre_ty
v: whn Ξ“1 B
IHv: forall (Ξ“3 : neg_ctx) (v0 : whn Ξ“3 B), Ξ“1 ~= Ξ“3 -> v ~= v0 -> forall r : Ξ“3 βŠ† Ξ“2, is_var (v_ren v0 r) -> is_var v0
r: Ξ“1 βŠ† Ξ“2
X: is_var (v_ren (Inr v) r)
is_var (Inr v)
Ξ“2, Ξ“1: neg_ctx
r: Ξ“1 βŠ† Ξ“2
X: is_var (v_ren Tt r)
is_var Tt
Ξ“2, Ξ“1: neg_ctx
A, B: pre_ty
s: state (Ξ“1 β–Άβ‚“ Β¬ A)
s0: state (Ξ“1 β–Άβ‚“ Β¬ B)
r: Ξ“1 βŠ† Ξ“2
X: is_var (v_ren (Pair s s0) r)
is_var (Pair s s0)
Ξ“2, Ξ“1: neg_ctx
A, B: pre_ty
s: state (Ξ“1 β–Άβ‚“ ↑ (A `β†’ B) β–Άβ‚“ ↑ A β–Άβ‚“ Β¬ B)
r: Ξ“1 βŠ† Ξ“2
X: is_var (v_ren (Lam s) r)
is_var (Lam s)
Ξ“2, Ξ“1: neg_ctx
p: pre_ty
c: Ξ“1 βˆ‹ Β¬ p
r: Ξ“1 βŠ† Ξ“2
X: is_var (v_ren (VarR c) r)
is_var (VarR c)
Ξ“2, Ξ“1: neg_ctx
p: pre_ty
s: state (Ξ“1 β–Άβ‚“ ↑ p)
r: Ξ“1 βŠ† Ξ“2
X: is_var (v_ren (MuT s) r)
is_var (MuT s)
Ξ“2, Ξ“1: neg_ctx
r: Ξ“1 βŠ† Ξ“2
X: is_var (v_ren Boom r)
is_var Boom
Ξ“2, Ξ“1: neg_ctx
A, B: pre_ty
s: state (Ξ“1 β–Άβ‚“ ↑ A)
s0: state (Ξ“1 β–Άβ‚“ ↑ B)
r: Ξ“1 βŠ† Ξ“2
X: is_var (v_ren (Case s s0) r)
is_var (Case s s0)
Ξ“2, Ξ“1: neg_ctx
A, B: pre_ty
v: term Ξ“1 Β¬ A
IHv: forall (Ξ“3 : neg_ctx) (p : pre_ty) (v0 : term Ξ“3 Β¬ p), Ξ“1 ~= Ξ“3 -> Β¬ A = Β¬ p -> v ~= v0 -> forall r : Ξ“3 βŠ† Ξ“2, is_var (v_ren v0 r) -> is_var v0
r: Ξ“1 βŠ† Ξ“2
X: is_var (v_ren (Fst v) r)
is_var (Fst v)
Ξ“2, Ξ“1: neg_ctx
A, B: pre_ty
v: term Ξ“1 Β¬ B
IHv: forall (Ξ“3 : neg_ctx) (p : pre_ty) (v0 : term Ξ“3 Β¬ p), Ξ“1 ~= Ξ“3 -> Β¬ B = Β¬ p -> v ~= v0 -> forall r : Ξ“3 βŠ† Ξ“2, is_var (v_ren v0 r) -> is_var v0
r: Ξ“1 βŠ† Ξ“2
X: is_var (v_ren (Snd v) r)
is_var (Snd v)
Ξ“2, Ξ“1: neg_ctx
A, B: pre_ty
w: whn Ξ“1 A
v: term Ξ“1 Β¬ B
IHv: forall (Ξ“3 : neg_ctx) (p : pre_ty) (v0 : term Ξ“3 Β¬ p), Ξ“1 ~= Ξ“3 -> Β¬ B = Β¬ p -> v ~= v0 -> forall r : Ξ“3 βŠ† Ξ“2, is_var (v_ren v0 r) -> is_var v0
r: Ξ“1 βŠ† Ξ“2
X: is_var (v_ren (App w v) r)
is_var (App w v)
all: try now dependent destruction X; exact (Vvar _). all: dependent induction w; dependent destruction X; exact (Vvar _). Qed. #[global] Instance sysl_machine : machine val_n state_n op_copat := {| Machine.eval := @eval ; oapp := @p_app |} . From Coinduction Require Import coinduction lattice rel tactics. Ltac refold_eval := change (Structure.iter _ _ ?a) with (eval a); change (Structure.subst (fun pat : T1 => let 'T1_0 := pat in ?f) T1_0 ?u) with (bind_delay' u f). Definition upg_v {Ξ“} {A : pre_ty} : whn Ξ“ A -> val Ξ“ ↑A := fun v => v. Definition upg_k {Ξ“} {A : pre_ty} : term Ξ“ Β¬A -> val Ξ“ Β¬A := fun v => v. Definition dwn_v {Ξ“} {A : pre_ty} : val Ξ“ ↑A -> whn Ξ“ A := fun v => v. Definition dwn_k {Ξ“} {A : pre_ty} : val Ξ“ Β¬A -> term Ξ“ Β¬A := fun v => v.
Ξ“: neg_ctx
A: pre_ty
i: Ξ“ βˆ‹ Β¬ A
p: pat ↑ A
Ξ³: pat_dom p =[ val ]> Ξ“

nf_eq (i β‹… w_split A (dwn_v ((p : val (pat_dom p) ↑ A) `α΅₯βŠ› Ξ³))) (i β‹… (p : op_copat Β¬ A) ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
A: pre_ty
i: Ξ“ βˆ‹ Β¬ A
p: pat ↑ A
Ξ³: pat_dom p =[ val ]> Ξ“

nf_eq (i β‹… p_of_w A (p `α΅₯βŠ› Ξ³) ⦇ p_dom_of_w A (p `α΅₯βŠ› Ξ³) ⦈) (i β‹… p ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
A: pre_ty
i: Ξ“ βˆ‹ Β¬ A
p: pat ↑ A
Ξ³: pat_dom p =[ val ]> Ξ“
H: rew [fun p : pat ↑ A => pat_dom p =[ val ]> Ξ“] p_of_w_eq A p Ξ³ in p_dom_of_w A ((p : val (pat_dom p) ↑ A) `α΅₯βŠ› Ξ³) ≑ₐ Ξ³

nf_eq (i β‹… p_of_w A (p `α΅₯βŠ› Ξ³) ⦇ p_dom_of_w A (p `α΅₯βŠ› Ξ³) ⦈) (i β‹… p ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
A: pre_ty
i: Ξ“ βˆ‹ Β¬ A
p: pat ↑ A
Ξ³: pat_dom p =[ val ]> Ξ“
H':= p_of_w_eq A p Ξ³: p_of_w A ((p : val (pat_dom p) ↑ A) `α΅₯βŠ› Ξ³) = p
H: rew [fun p : pat ↑ A => pat_dom p =[ val ]> Ξ“] H' in p_dom_of_w A ((p : val (pat_dom p) ↑ A) `α΅₯βŠ› Ξ³) ≑ₐ Ξ³

nf_eq (i β‹… p_of_w A (p `α΅₯βŠ› Ξ³) ⦇ p_dom_of_w A (p `α΅₯βŠ› Ξ³) ⦈) (i β‹… p ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
A: pre_ty
i: Ξ“ βˆ‹ Β¬ A
p: pat ↑ A
Ξ³: pat_dom p =[ val ]> Ξ“
H':= p_of_w_eq A p Ξ³: p_of_w A ((p : val (pat_dom p) ↑ A) `α΅₯βŠ› Ξ³) = p
a:= p_dom_of_w A (p `α΅₯βŠ› Ξ³): pat_dom (p_of_w A (p `α΅₯βŠ› Ξ³)) =[ val ]> Ξ“
H: rew [fun p : pat ↑ A => pat_dom p =[ val ]> Ξ“] H' in a ≑ₐ Ξ³

nf_eq (i β‹… p_of_w A (p `α΅₯βŠ› Ξ³) ⦇ a ⦈) (i β‹… p ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
A: pre_ty
i: Ξ“ βˆ‹ Β¬ A
p: pat ↑ A
Ξ³: pat_dom p =[ val ]> Ξ“
H':= p_of_w_eq A p Ξ³: p_of_w A ((p : val (pat_dom p) ↑ A) `α΅₯βŠ› Ξ³) = p
a': pat_dom (p_of_w A (p `α΅₯βŠ› Ξ³)) =[ val ]> Ξ“
H: rew [fun p : pat ↑ A => pat_dom p =[ val ]> Ξ“] H' in a' ≑ₐ Ξ³

nf_eq (i β‹… p_of_w A (p `α΅₯βŠ› Ξ³) ⦇ a' ⦈) (i β‹… p ⦇ Ξ³ ⦈)
revert a' H; rewrite H'; intros; now econstructor. Qed.

machine_laws val_n state_n op_copat

forall (Ξ“ : neg_ctx) (x : ty) (v : val Ξ“ x) (o : op_copat x), Proper (asgn_eq (dom o) Ξ“ ==> eq) (oapp v o)

forall (Ξ“1 Ξ“2 : neg_ctx) (x : ty) (v : val Ξ“1 x) (o : op_copat x) (a : dom o =[ val_n ]> Ξ“1) (b : Ξ“1 =[ val_n ]> Ξ“2), v βŠ™ o β¦— a ⦘ β‚œβŠ› b = (v α΅₯βŠ› b) βŠ™ o β¦— a βŠ› b ⦘

forall (Ξ“ Ξ” : neg_ctx) (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), Machine.eval (c β‚œβŠ› a) ≋ bind_delay' (Machine.eval c) (fun n : nf op_copat val_n Ξ“ => Machine.eval (emb n β‚œβŠ› a))

forall (Ξ“ : neg_ctx) (u : nf op_copat val_n Ξ“), Machine.eval (emb u) ≋ ret_delay u

well_founded head_inst_nostep

forall (Ξ“ : neg_ctx) (x : ty) (v : val Ξ“ x) (o : op_copat x), Proper (asgn_eq (dom o) Ξ“ ==> eq) (oapp v o)
intros; apply p_app_eq.

forall (Ξ“1 Ξ“2 : neg_ctx) (x : ty) (v : val Ξ“1 x) (o : op_copat x) (a : dom o =[ val_n ]> Ξ“1) (b : Ξ“1 =[ val_n ]> Ξ“2), v βŠ™ o β¦— a ⦘ β‚œβŠ› b = (v α΅₯βŠ› b) βŠ™ o β¦— a βŠ› b ⦘
Ξ“1, Ξ“2: neg_ctx
p: pre_ty
v: val Ξ“1 ↑ p
o: op_copat ↑ p
a: dom o =[ val_n ]> Ξ“1
b: Ξ“1 =[ val_n ]> Ξ“2

Cut (Val (v `α΅₯βŠ› b)) ((o `β‚œβŠ› a) `β‚œβŠ› b) = Cut (Val (v `α΅₯βŠ› b)) (o `β‚œβŠ› a βŠ› b)
Ξ“1, Ξ“2: neg_ctx
p: pre_ty
v: val Ξ“1 Β¬ p
o: op_copat Β¬ p
a: dom o =[ val_n ]> Ξ“1
b: Ξ“1 =[ val_n ]> Ξ“2
Cut (Val ((o `α΅₯βŠ› a) `α΅₯βŠ› b)) (v `β‚œβŠ› b) = Cut (Val (o `α΅₯βŠ› a βŠ› b)) (v `β‚œβŠ› b)
Ξ“1, Ξ“2: neg_ctx
p: pre_ty
v: val Ξ“1 Β¬ p
o: op_copat Β¬ p
a: dom o =[ val_n ]> Ξ“1
b: Ξ“1 =[ val_n ]> Ξ“2

Cut (Val ((o `α΅₯βŠ› a) `α΅₯βŠ› b)) (v `β‚œβŠ› b) = Cut (Val (o `α΅₯βŠ› a βŠ› b)) (v `β‚œβŠ› b)
now rewrite (w_sub_sub _ _ _ _).

forall (Ξ“ Ξ” : neg_ctx) (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), Machine.eval (c β‚œβŠ› a) ≋ bind_delay' (Machine.eval c) (fun n : nf op_copat val_n Ξ“ => Machine.eval (emb n β‚œβŠ› a))
Ξ“, Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
c: state Ξ“
a: Ξ“ =[ val_n ]> Ξ”

it_eq_bt βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
Ξ“: neg_ctx
A2: pre_ty
v: whn Ξ“ A2
i: Ξ“ βˆ‹ Β¬ A2
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Val v) (VarR i)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match match eval_aux (Cut (Val v) (VarR i)) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ“ -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ“) +α΅’ (fun _ : T1 => L_nf Ξ“)) x0) in fun c : state Ξ“ => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end with | RetF r => match eval_aux (s_subst Ξ“ (p_app (Var (nf_var r)) (nf_obs r) (nf_args r)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end | TauF t => TauF ((fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< t) | VisF e k => VisF e (fun r : ex_falso e => (fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< k r) end
Ξ“: neg_ctx
A3: pre_ty
v: whn Ξ“ A3
s: state (Ξ“ β–Άβ‚“ ↑ A3)
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”
it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Val v) (MuT s)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match match eval_aux (Cut (Val v) (MuT s)) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ“ -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ“) +α΅’ (fun _ : T1 => L_nf Ξ“)) x0) in fun c : state Ξ“ => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end with | RetF r => match eval_aux (s_subst Ξ“ (p_app (Var (nf_var r)) (nf_obs r) (nf_args r)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end | TauF t => TauF ((fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< t) | VisF e k => VisF e (fun r : ex_falso e => (fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< k r) end
Ξ“: neg_ctx
A0, B0: pre_ty
u: whn Ξ“ A0
s: state (Ξ“ β–Άβ‚“ ↑ A0)
t: state (Ξ“ β–Άβ‚“ ↑ B0)
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”
it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Val (Inl u)) (Case s t)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match match eval_aux (Cut (Val (Inl u)) (Case s t)) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ“ -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ“) +α΅’ (fun _ : T1 => L_nf Ξ“)) x0) in fun c : state Ξ“ => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end with | RetF r => match eval_aux (s_subst Ξ“ (p_app (Var (nf_var r)) (nf_obs r) (nf_args r)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end | TauF t => TauF ((fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< t) | VisF e k => VisF e (fun r : ex_falso e => (fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< k r) end
Ξ“: neg_ctx
A1, B1: pre_ty
u: whn Ξ“ B1
s: state (Ξ“ β–Άβ‚“ ↑ A1)
t: state (Ξ“ β–Άβ‚“ ↑ B1)
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”
it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Val (Inr u)) (Case s t)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match match eval_aux (Cut (Val (Inr u)) (Case s t)) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ“ -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ“) +α΅’ (fun _ : T1 => L_nf Ξ“)) x0) in fun c : state Ξ“ => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end with | RetF r => match eval_aux (s_subst Ξ“ (p_app (Var (nf_var r)) (nf_obs r) (nf_args r)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end | TauF t => TauF ((fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< t) | VisF e k => VisF e (fun r : ex_falso e => (fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< k r) end
Ξ“: neg_ctx
A5, B0: pre_ty
i: Ξ“ βˆ‹ ↑ (A5 `Γ— B0)
k: term Ξ“ Β¬ A5
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”
it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Val (VarL i)) (Fst k)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match match eval_aux (Cut (Val (VarL i)) (Fst k)) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ“ -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ“) +α΅’ (fun _ : T1 => L_nf Ξ“)) x0) in fun c : state Ξ“ => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end with | RetF r => match eval_aux (s_subst Ξ“ (p_app (Var (nf_var r)) (nf_obs r) (nf_args r)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end | TauF t => TauF ((fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< t) | VisF e k => VisF e (fun r : ex_falso e => (fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< k r) end
Ξ“: neg_ctx
A2, B2: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A2)
t: state (Ξ“ β–Άβ‚“ Β¬ B2)
k: term Ξ“ Β¬ A2
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”
it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Val (Pair s t)) (Fst k)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match match eval_aux (Cut (Val (Pair s t)) (Fst k)) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ“ -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ“) +α΅’ (fun _ : T1 => L_nf Ξ“)) x0) in fun c : state Ξ“ => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end with | RetF r => match eval_aux (s_subst Ξ“ (p_app (Var (nf_var r)) (nf_obs r) (nf_args r)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end | TauF t => TauF ((fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< t) | VisF e k => VisF e (fun r : ex_falso e => (fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< k r) end
Ξ“: neg_ctx
A6, B1: pre_ty
i: Ξ“ βˆ‹ ↑ (A6 `Γ— B1)
k: term Ξ“ Β¬ B1
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”
it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Val (VarL i)) (Snd k)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match match eval_aux (Cut (Val (VarL i)) (Snd k)) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ“ -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ“) +α΅’ (fun _ : T1 => L_nf Ξ“)) x0) in fun c : state Ξ“ => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end with | RetF r => match eval_aux (s_subst Ξ“ (p_app (Var (nf_var r)) (nf_obs r) (nf_args r)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end | TauF t => TauF ((fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< t) | VisF e k => VisF e (fun r : ex_falso e => (fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< k r) end
Ξ“: neg_ctx
A2, B2: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A2)
t: state (Ξ“ β–Άβ‚“ Β¬ B2)
k: term Ξ“ Β¬ B2
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”
it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Val (Pair s t)) (Snd k)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match match eval_aux (Cut (Val (Pair s t)) (Snd k)) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ“ -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ“) +α΅’ (fun _ : T1 => L_nf Ξ“)) x0) in fun c : state Ξ“ => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end with | RetF r => match eval_aux (s_subst Ξ“ (p_app (Var (nf_var r)) (nf_obs r) (nf_args r)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end | TauF t => TauF ((fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< t) | VisF e k => VisF e (fun r : ex_falso e => (fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< k r) end
Ξ“: neg_ctx
A7, B2: pre_ty
i: Ξ“ βˆ‹ ↑ (A7 `β†’ B2)
v: whn Ξ“ A7
k: term Ξ“ Β¬ B2
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”
it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Val (VarL i)) (App v k)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match match eval_aux (Cut (Val (VarL i)) (App v k)) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ“ -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ“) +α΅’ (fun _ : T1 => L_nf Ξ“)) x0) in fun c : state Ξ“ => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end with | RetF r => match eval_aux (s_subst Ξ“ (p_app (Var (nf_var r)) (nf_obs r) (nf_args r)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end | TauF t => TauF ((fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< t) | VisF e k => VisF e (fun r : ex_falso e => (fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< k r) end
Ξ“: neg_ctx
A3, B3: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3)
v: whn Ξ“ A3
k: term Ξ“ Β¬ B3
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”
it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Val (Lam s)) (App v k)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match match eval_aux (Cut (Val (Lam s)) (App v k)) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ“ -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ“) +α΅’ (fun _ : T1 => L_nf Ξ“)) x0) in fun c : state Ξ“ => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end with | RetF r => match eval_aux (s_subst Ξ“ (p_app (Var (nf_var r)) (nf_obs r) (nf_args r)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end | TauF t => TauF ((fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< t) | VisF e k => VisF e (fun r : ex_falso e => (fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< k r) end
Ξ“: neg_ctx
A1: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A1)
k: term Ξ“ Β¬ A1
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”
it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Mu s) k) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match match eval_aux (Cut (Mu s) k) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ“ -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ“) +α΅’ (fun _ : T1 => L_nf Ξ“)) x0) in fun c : state Ξ“ => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end with | RetF r => match eval_aux (s_subst Ξ“ (p_app (Var (nf_var r)) (nf_obs r) (nf_args r)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end | TauF t => TauF ((fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< t) | VisF e k => VisF e (fun r : ex_falso e => (fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< k r) end
Ξ“: neg_ctx
A2: pre_ty
v: whn Ξ“ A2
i: Ξ“ βˆ‹ Β¬ A2
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Val v) (VarR i)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match match eval_aux (Cut (Val v) (VarR i)) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ“ -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ“) +α΅’ (fun _ : T1 => L_nf Ξ“)) x0) in fun c : state Ξ“ => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end with | RetF r => match eval_aux (s_subst Ξ“ (p_app (Var (nf_var r)) (nf_obs r) (nf_args r)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end | TauF t => TauF ((fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< t) | VisF e k => VisF e (fun r : ex_falso e => (fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< k r) end
Ξ“: neg_ctx
A2: pre_ty
v: whn Ξ“ A2
i: Ξ“ βˆ‹ Β¬ A2
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eq_map βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 (eval (Cut (Val (v `α΅₯βŠ› a)) (a Β¬ A2 i))) (eval (Cut (Val ((p_of_w A2 v `α΅₯βŠ› p_dom_of_w A2 v) `α΅₯βŠ› a)) (a Β¬ A2 i)))
now rewrite (refold_id_aux _ v).
Ξ“: neg_ctx
A3: pre_ty
v: whn Ξ“ A3
s: state (Ξ“ β–Άβ‚“ ↑ A3)
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Val v) (MuT s)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match match eval_aux (Cut (Val v) (MuT s)) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ“ -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ“) +α΅’ (fun _ : T1 => L_nf Ξ“)) x0) in fun c : state Ξ“ => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end with | RetF r => match eval_aux (s_subst Ξ“ (p_app (Var (nf_var r)) (nf_obs r) (nf_args r)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end | TauF t => TauF ((fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< t) | VisF e k => VisF e (fun r : ex_falso e => (fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< k r) end
Ξ“: neg_ctx
A3: pre_ty
v: whn Ξ“ A3
s: state (Ξ“ β–Άβ‚“ ↑ A3)
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst (Ξ” β–Άβ‚“ ↑ A3) (s_subst (Ξ“ β–Άβ‚“ ↑ A3) s (Ξ” β–Άβ‚“ ↑ A3) (a_shift1 a)) Ξ” ₁[ v `α΅₯βŠ› a])) (bind_delay' (eval (s_subst (Ξ“ β–Άβ‚“ ↑ A3) s Ξ“ ₁[ v])) (fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)))
Ξ“: neg_ctx
A3: pre_ty
v: whn Ξ“ A3
s: state (Ξ“ β–Άβ‚“ ↑ A3)
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval ((s β‚œβŠ› ₁[ upg_v v]) β‚œβŠ› a)) (bind_delay' (eval (s_subst (Ξ“ β–Άβ‚“ ↑ A3) s Ξ“ ₁[ v])) (fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)))
apply CIH.
Ξ“: neg_ctx
A0, B0: pre_ty
u: whn Ξ“ A0
s: state (Ξ“ β–Άβ‚“ ↑ A0)
t: state (Ξ“ β–Άβ‚“ ↑ B0)
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Val (Inl u)) (Case s t)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match match eval_aux (Cut (Val (Inl u)) (Case s t)) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ“ -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ“) +α΅’ (fun _ : T1 => L_nf Ξ“)) x0) in fun c : state Ξ“ => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end with | RetF r => match eval_aux (s_subst Ξ“ (p_app (Var (nf_var r)) (nf_obs r) (nf_args r)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end | TauF t => TauF ((fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< t) | VisF e k => VisF e (fun r : ex_falso e => (fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< k r) end
Ξ“: neg_ctx
A0, B0: pre_ty
u: whn Ξ“ A0
s: state (Ξ“ β–Άβ‚“ ↑ A0)
t: state (Ξ“ β–Άβ‚“ ↑ B0)
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst (Ξ” β–Άβ‚“ ↑ A0) (s_subst (Ξ“ β–Άβ‚“ ↑ A0) s (Ξ” β–Άβ‚“ ↑ A0) (a_shift1 a)) Ξ” ₁[ u `α΅₯βŠ› a])) (bind_delay' (eval (s_subst (Ξ“ β–Άβ‚“ ↑ A0) s Ξ“ ₁[ u])) (fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)))
Ξ“: neg_ctx
A0, B0: pre_ty
u: whn Ξ“ A0
s: state (Ξ“ β–Άβ‚“ ↑ A0)
t: state (Ξ“ β–Άβ‚“ ↑ B0)
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval ((s β‚œβŠ› ₁[ upg_v u]) β‚œβŠ› a)) (bind_delay' (eval (s_subst (Ξ“ β–Άβ‚“ ↑ A0) s Ξ“ ₁[ u])) (fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)))
apply CIH.
Ξ“: neg_ctx
A1, B1: pre_ty
u: whn Ξ“ B1
s: state (Ξ“ β–Άβ‚“ ↑ A1)
t: state (Ξ“ β–Άβ‚“ ↑ B1)
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Val (Inr u)) (Case s t)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match match eval_aux (Cut (Val (Inr u)) (Case s t)) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ“ -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ“) +α΅’ (fun _ : T1 => L_nf Ξ“)) x0) in fun c : state Ξ“ => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end with | RetF r => match eval_aux (s_subst Ξ“ (p_app (Var (nf_var r)) (nf_obs r) (nf_args r)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end | TauF t => TauF ((fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< t) | VisF e k => VisF e (fun r : ex_falso e => (fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< k r) end
Ξ“: neg_ctx
A1, B1: pre_ty
u: whn Ξ“ B1
s: state (Ξ“ β–Άβ‚“ ↑ A1)
t: state (Ξ“ β–Άβ‚“ ↑ B1)
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst (Ξ” β–Άβ‚“ ↑ B1) (s_subst (Ξ“ β–Άβ‚“ ↑ B1) t (Ξ” β–Άβ‚“ ↑ B1) (a_shift1 a)) Ξ” ₁[ u `α΅₯βŠ› a])) (bind_delay' (eval (s_subst (Ξ“ β–Άβ‚“ ↑ B1) t Ξ“ ₁[ u])) (fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)))
Ξ“: neg_ctx
A1, B1: pre_ty
u: whn Ξ“ B1
s: state (Ξ“ β–Άβ‚“ ↑ A1)
t: state (Ξ“ β–Άβ‚“ ↑ B1)
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval ((t β‚œβŠ› ₁[ upg_v u]) β‚œβŠ› a)) (bind_delay' (eval (s_subst (Ξ“ β–Άβ‚“ ↑ B1) t Ξ“ ₁[ u])) (fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)))
apply CIH.
Ξ“: neg_ctx
A5, B0: pre_ty
i: Ξ“ βˆ‹ ↑ (A5 `Γ— B0)
k: term Ξ“ Β¬ A5
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Val (VarL i)) (Fst k)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match match eval_aux (Cut (Val (VarL i)) (Fst k)) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ“ -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ“) +α΅’ (fun _ : T1 => L_nf Ξ“)) x0) in fun c : state Ξ“ => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end with | RetF r => match eval_aux (s_subst Ξ“ (p_app (Var (nf_var r)) (nf_obs r) (nf_args r)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end | TauF t => TauF ((fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< t) | VisF e k => VisF e (fun r : ex_falso e => (fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< k r) end
now change (it_eqF _ ?RX ?RY _ _ _) with (it_eq_map βˆ…β‚‘ RX RY T1_0 (eval (Cut (a _ i) (Fst k `β‚œβŠ› a))) (eval (Cut (a _ i) (Fst k `β‚œβŠ› a)))).
Ξ“: neg_ctx
A2, B2: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A2)
t: state (Ξ“ β–Άβ‚“ Β¬ B2)
k: term Ξ“ Β¬ A2
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Val (Pair s t)) (Fst k)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match match eval_aux (Cut (Val (Pair s t)) (Fst k)) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ“ -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ“) +α΅’ (fun _ : T1 => L_nf Ξ“)) x0) in fun c : state Ξ“ => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end with | RetF r => match eval_aux (s_subst Ξ“ (p_app (Var (nf_var r)) (nf_obs r) (nf_args r)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end | TauF t => TauF ((fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< t) | VisF e k => VisF e (fun r : ex_falso e => (fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< k r) end
Ξ“: neg_ctx
A2, B2: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A2)
t: state (Ξ“ β–Άβ‚“ Β¬ B2)
k: term Ξ“ Β¬ A2
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst (Ξ” β–Άβ‚“ Β¬ A2) (s_subst (Ξ“ β–Άβ‚“ Β¬ A2) s (Ξ” β–Άβ‚“ Β¬ A2) (a_shift1 a)) Ξ” ₁[ k `β‚œβŠ› a])) (bind_delay' (eval (s_subst (Ξ“ β–Άβ‚“ Β¬ A2) s Ξ“ ₁[ k])) (fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)))
Ξ“: neg_ctx
A2, B2: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A2)
t: state (Ξ“ β–Άβ‚“ Β¬ B2)
k: term Ξ“ Β¬ A2
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval ((s β‚œβŠ› ₁[ upg_k k]) β‚œβŠ› a)) (bind_delay' (eval (s_subst (Ξ“ β–Άβ‚“ Β¬ A2) s Ξ“ ₁[ k])) (fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)))
apply CIH.
Ξ“: neg_ctx
A6, B1: pre_ty
i: Ξ“ βˆ‹ ↑ (A6 `Γ— B1)
k: term Ξ“ Β¬ B1
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Val (VarL i)) (Snd k)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match match eval_aux (Cut (Val (VarL i)) (Snd k)) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ“ -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ“) +α΅’ (fun _ : T1 => L_nf Ξ“)) x0) in fun c : state Ξ“ => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end with | RetF r => match eval_aux (s_subst Ξ“ (p_app (Var (nf_var r)) (nf_obs r) (nf_args r)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end | TauF t => TauF ((fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< t) | VisF e k => VisF e (fun r : ex_falso e => (fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< k r) end
now change (it_eqF _ ?RX ?RY _ _ _) with (it_eq_map βˆ…β‚‘ RX RY T1_0 (eval (Cut (a _ i) (Snd k `β‚œβŠ› a))) (eval (Cut (a _ i) (Snd k `β‚œβŠ› a)))).
Ξ“: neg_ctx
A2, B2: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A2)
t: state (Ξ“ β–Άβ‚“ Β¬ B2)
k: term Ξ“ Β¬ B2
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Val (Pair s t)) (Snd k)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match match eval_aux (Cut (Val (Pair s t)) (Snd k)) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ“ -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ“) +α΅’ (fun _ : T1 => L_nf Ξ“)) x0) in fun c : state Ξ“ => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end with | RetF r => match eval_aux (s_subst Ξ“ (p_app (Var (nf_var r)) (nf_obs r) (nf_args r)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end | TauF t => TauF ((fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< t) | VisF e k => VisF e (fun r : ex_falso e => (fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< k r) end
Ξ“: neg_ctx
A2, B2: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A2)
t: state (Ξ“ β–Άβ‚“ Β¬ B2)
k: term Ξ“ Β¬ B2
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst (Ξ” β–Άβ‚“ Β¬ B2) (s_subst (Ξ“ β–Άβ‚“ Β¬ B2) t (Ξ” β–Άβ‚“ Β¬ B2) (a_shift1 a)) Ξ” ₁[ k `β‚œβŠ› a])) (bind_delay' (eval (s_subst (Ξ“ β–Άβ‚“ Β¬ B2) t Ξ“ ₁[ k])) (fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)))
Ξ“: neg_ctx
A2, B2: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A2)
t: state (Ξ“ β–Άβ‚“ Β¬ B2)
k: term Ξ“ Β¬ B2
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval ((t β‚œβŠ› ₁[ upg_k k]) β‚œβŠ› a)) (bind_delay' (eval (s_subst (Ξ“ β–Άβ‚“ Β¬ B2) t Ξ“ ₁[ k])) (fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)))
apply CIH.
Ξ“: neg_ctx
A7, B2: pre_ty
i: Ξ“ βˆ‹ ↑ (A7 `β†’ B2)
v: whn Ξ“ A7
k: term Ξ“ Β¬ B2
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Val (VarL i)) (App v k)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match match eval_aux (Cut (Val (VarL i)) (App v k)) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ“ -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ“) +α΅’ (fun _ : T1 => L_nf Ξ“)) x0) in fun c : state Ξ“ => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end with | RetF r => match eval_aux (s_subst Ξ“ (p_app (Var (nf_var r)) (nf_obs r) (nf_args r)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end | TauF t => TauF ((fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< t) | VisF e k => VisF e (fun r : ex_falso e => (fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< k r) end
Ξ“: neg_ctx
A7, B2: pre_ty
i: Ξ“ βˆ‹ ↑ (A7 `β†’ B2)
v: whn Ξ“ A7
k: term Ξ“ Β¬ B2
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Val (VarL i)) (App v k)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match eval_aux (s_subst Ξ“ (p_app (Var (nf_var (app_nf i v k))) (nf_obs (app_nf i v k)) (nf_args (app_nf i v k))) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end
Ξ“: neg_ctx
A7, B2: pre_ty
i: Ξ“ βˆ‹ ↑ (A7 `β†’ B2)
v: whn Ξ“ A7
k: term Ξ“ Β¬ B2
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Val (VarL i)) (App v k)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match eval_aux (s_subst Ξ“ (Cut' (Var i) (PApp (p_of_w A7 v) `β‚œβŠ› (p_dom_of_w A7 v ▢ₐ k))) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end
Ξ“: neg_ctx
A7, B2: pre_ty
i: Ξ“ βˆ‹ ↑ (A7 `β†’ B2)
v: whn Ξ“ A7
k: term Ξ“ Β¬ B2
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eq_map βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 (eval (Cut (a ↑ (A7 `β†’ B2) i) (App v k `β‚œβŠ› a))) (eval (Cut (a ↑ (A7 `β†’ B2) i) ((PApp (p_of_w A7 v) `β‚œβŠ› (p_dom_of_w A7 v ▢ₐ upg_k k)) `β‚œβŠ› a)))
Ξ“: neg_ctx
A7, B2: pre_ty
i: Ξ“ βˆ‹ ↑ (A7 `β†’ B2)
v: whn Ξ“ A7
k: term Ξ“ Β¬ B2
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eq_map βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 (eval (Cut (Val (a ↑ (A7 `β†’ B2) i)) (App (v `α΅₯βŠ› a) (k `β‚œβŠ› a)))) (eval (Cut (Val (a ↑ (A7 `β†’ B2) i)) (App ((p_of_w A7 v `α΅₯βŠ›α΅£ r_pop `α΅₯βŠ› (p_dom_of_w A7 v ▢ₐ upg_k k)) `α΅₯βŠ› a) (upg_k k `β‚œβŠ› a))))
Ξ“: neg_ctx
A7, B2: pre_ty
i: Ξ“ βˆ‹ ↑ (A7 `β†’ B2)
v: whn Ξ“ A7
k: term Ξ“ Β¬ B2
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eq_map βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 (eval (Cut (Val (a ↑ (A7 `β†’ B2) i)) (App (v `α΅₯βŠ› a) (k `β‚œβŠ› a)))) (eval (Cut (Val (a ↑ (A7 `β†’ B2) i)) (App ((p_of_w A7 v `α΅₯βŠ› r_pop α΅£βŠ› (p_dom_of_w A7 v ▢ₐ upg_k k)) `α΅₯βŠ› a) (upg_k k `β‚œβŠ› a))))
Ξ“: neg_ctx
A7, B2: pre_ty
i: Ξ“ βˆ‹ ↑ (A7 `β†’ B2)
v: whn Ξ“ A7
k: term Ξ“ Β¬ B2
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eq_map βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 (eval (Cut (Val (a ↑ (A7 `β†’ B2) i)) (App (v `α΅₯βŠ› a) (k `β‚œβŠ› a)))) (eval (Cut (Val (a ↑ (A7 `β†’ B2) i)) (App ((p_of_w A7 v `α΅₯βŠ› p_dom_of_w A7 v) `α΅₯βŠ› a) (upg_k k `β‚œβŠ› a))))
now rewrite (refold_id_aux _ v).
Ξ“: neg_ctx
A3, B3: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3)
v: whn Ξ“ A3
k: term Ξ“ Β¬ B3
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Val (Lam s)) (App v k)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match match eval_aux (Cut (Val (Lam s)) (App v k)) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ“ -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ“) +α΅’ (fun _ : T1 => L_nf Ξ“)) x0) in fun c : state Ξ“ => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end with | RetF r => match eval_aux (s_subst Ξ“ (p_app (Var (nf_var r)) (nf_obs r) (nf_args r)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end | TauF t => TauF ((fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< t) | VisF e k => VisF e (fun r : ex_falso e => (fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< k r) end
Ξ“: neg_ctx
A3, B3: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3)
v: whn Ξ“ A3
k: term Ξ“ Β¬ B3
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst (Ξ” β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3) (s_subst (Ξ“ β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3) s (Ξ” β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3) (a_shift3 a)) Ξ” ₃[ Lam (s_subst (Ξ“ β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3) s (Ξ” β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3) (a_shift3 a)), v `α΅₯βŠ› a, k `β‚œβŠ› a])) (bind_delay' (eval (s_subst (Ξ“ β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3) s Ξ“ ₃[ Lam s, v, k])) (fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)))
Ξ“: neg_ctx
A3, B3: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3)
v: whn Ξ“ A3
k: term Ξ“ Β¬ B3
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst (Ξ” β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3) (s_subst (Ξ“ β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3) s (Ξ” β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3) (a_shift3 a)) Ξ” ₃[ upg_v (Lam s) α΅₯βŠ› a, v `α΅₯βŠ› a, k `β‚œβŠ› a])) (bind_delay' (eval (s_subst (Ξ“ β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3) s Ξ“ ₃[ Lam s, v, k])) (fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)))
Ξ“: neg_ctx
A3, B3: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3)
v: whn Ξ“ A3
k: term Ξ“ Β¬ B3
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst (Ξ” β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3) (s_subst (Ξ“ β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3) s (Ξ” β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3) (a_shift3 a)) Ξ” ₃[ upg_v (Lam s) α΅₯βŠ› a, v `α΅₯βŠ› a, upg_k k α΅₯βŠ› a])) (bind_delay' (eval (s_subst (Ξ“ β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3) s Ξ“ ₃[ Lam s, v, k])) (fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)))
Ξ“: neg_ctx
A3, B3: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3)
v: whn Ξ“ A3
k: term Ξ“ Β¬ B3
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst (Ξ” β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3) (s_subst (Ξ“ β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3) s (Ξ” β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3) (a_shift3 a)) Ξ” ₃[ upg_v (Lam s) α΅₯βŠ› a, upg_v v α΅₯βŠ› a, upg_k k α΅₯βŠ› a])) (bind_delay' (eval (s_subst (Ξ“ β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3) s Ξ“ ₃[ Lam s, v, k])) (fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)))
Ξ“: neg_ctx
A3, B3: pre_ty
s: state (Ξ“ β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3)
v: whn Ξ“ A3
k: term Ξ“ Β¬ B3
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval ((s β‚œβŠ› ₃[ upg_v (Lam s), upg_v v, upg_k k]) β‚œβŠ› a)) (bind_delay' (eval (s_subst (Ξ“ β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3) s Ξ“ ₃[ Lam s, v, k])) (fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)))
apply CIH.
Ξ“: neg_ctx
A1: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A1)
k: term Ξ“ Β¬ A1
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eqF βˆ…β‚‘ (fun _ : T1 => nf_eq) (it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R) T1_0 match eval_aux (s_subst Ξ“ (Cut (Mu s) k) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end match match eval_aux (Cut (Mu s) k) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ“ -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ“) +α΅’ (fun _ : T1 => L_nf Ξ“)) x0) in fun c : state Ξ“ => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end with | RetF r => match eval_aux (s_subst Ξ“ (p_app (Var (nf_var r)) (nf_obs r) (nf_args r)) Ξ” a) with | inl x => TauF (iter (fun pat : T1 => let 'T1_0 as x0 := pat return (state Ξ” -> itree βˆ…β‚‘ ((fun _ : T1 => state Ξ”) +α΅’ (fun _ : T1 => L_nf Ξ”)) x0) in fun c : state Ξ” => Ret' (eval_aux c)) T1_0 x) | inr y => RetF y end | TauF t => TauF ((fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< t) | VisF e k => VisF e (fun r : ex_falso e => (fun pat : T1 => let 'T1_0 as x := pat return (nf op_copat val_n Ξ“ -> itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”) x) in fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)) =<< k r) end
Ξ“: neg_ctx
A1: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A1)
k: term Ξ“ Β¬ A1
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst (Ξ” β–Άβ‚“ Β¬ A1) (s_subst (Ξ“ β–Άβ‚“ Β¬ A1) s (Ξ” β–Άβ‚“ Β¬ A1) (a_shift1 a)) Ξ” ₁[ k `β‚œβŠ› a])) (bind_delay' (eval (s_subst (Ξ“ β–Άβ‚“ Β¬ A1) s Ξ“ ₁[ k])) (fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)))
Ξ“: neg_ctx
A1: pre_ty
s: state (Ξ“ β–Άβ‚“ Β¬ A1)
k: term Ξ“ Β¬ A1
Ξ”: neg_ctx
R: relα΅’ (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”)) (itree βˆ…β‚‘ (fun _ : T1 => nf op_copat val_n Ξ”))
CIH: forall (c : state Ξ“) (a : Ξ“ =[ val_n ]> Ξ”), it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval (s_subst Ξ“ c Ξ” a)) (bind_delay' (eval c) (fun n : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var n)) (nf_obs n) (nf_args n)) Ξ” a)))
a: Ξ“ =[ val_n ]> Ξ”

it_eq_t βˆ…β‚‘ (fun _ : T1 => nf_eq) R T1_0 (eval ((s β‚œβŠ› ₁[ upg_k k]) β‚œβŠ› a)) (bind_delay' (eval (s_subst (Ξ“ β–Άβ‚“ Β¬ A1) s Ξ“ ₁[ k])) (fun y : nf op_copat val_n Ξ“ => eval (s_subst Ξ“ (p_app (Var (nf_var y)) (nf_obs y) (nf_args y)) Ξ” a)))
apply CIH.

forall (Ξ“ : neg_ctx) (u : nf op_copat val_n Ξ“), Machine.eval (emb u) ≋ ret_delay u
Ξ“: neg_ctx
A: ty
i: Ξ“ βˆ‹ A
o: op_copat A
Ξ³: dom o =[ val_n ]> Ξ“

eval (Cut' (Var i) (o `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
A: ty
i: Ξ“ βˆ‹ A
o: pat A †
Ξ³: dom o =[ val_n ]> Ξ“
eqargs: {| pr1 := ↑ `1; pr2 := PTt |} = {| pr1 := A †; pr2 := o |}
H0: ↑ `1 = A †
H1: ↑ `1,' PTt = A †,' o

eval (Cut' (Var i) (rew [fun projs : sigma (fun A : ty => pat A) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in VarL Ctx.top `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
a, b: pre_ty
Ξ“: neg_ctx
A: ty
i: Ξ“ βˆ‹ A
o: pat A †
Ξ³: dom o =[ val_n ]> Ξ“
eqargs: {| pr1 := ↑ (a `Γ— b); pr2 := PPair |} = {| pr1 := A †; pr2 := o |}
H0: ↑ (a `Γ— b) = A †
H1: ↑ (a `Γ— b),' PPair = A †,' o
eval (Cut' (Var i) (rew [fun projs : sigma (fun A : ty => pat A) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in VarL Ctx.top `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
a0, b0: pre_ty
u: pat ↑ a0
H: forall (Ξ“ : neg_ctx) (A : ty) (i : Ξ“ βˆ‹ A) (o : pat A †) (Ξ³ : dom o =[ val_n ]> Ξ“) (eqargs : {| pr1 := ↑ a0; pr2 := u |} = {| pr1 := A †; pr2 := o |}), rew [fun projs : sigma (fun A0 : ty => pat A0) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in u = o -> eval (Cut' (Var i) (o `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
A: ty
i: Ξ“ βˆ‹ A
o: pat A †
Ξ³: dom o =[ val_n ]> Ξ“
eqargs: {| pr1 := ↑ (a0 `+ b0); pr2 := PInl u |} = {| pr1 := A †; pr2 := o |}
H1: ↑ (a0 `+ b0) = A †
H2: ↑ (a0 `+ b0),' PInl u = A †,' o
eval (Cut' (Var i) (rew [fun projs : sigma (fun A : ty => pat A) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in Inl u `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
a1, b1: pre_ty
u: pat ↑ b1
H: forall (Ξ“ : neg_ctx) (A : ty) (i : Ξ“ βˆ‹ A) (o : pat A †) (Ξ³ : dom o =[ val_n ]> Ξ“) (eqargs : {| pr1 := ↑ b1; pr2 := u |} = {| pr1 := A †; pr2 := o |}), rew [fun projs : sigma (fun A0 : ty => pat A0) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in u = o -> eval (Cut' (Var i) (o `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
A: ty
i: Ξ“ βˆ‹ A
o: pat A †
Ξ³: dom o =[ val_n ]> Ξ“
eqargs: {| pr1 := ↑ (a1 `+ b1); pr2 := PInr u |} = {| pr1 := A †; pr2 := o |}
H1: ↑ (a1 `+ b1) = A †
H2: ↑ (a1 `+ b1),' PInr u = A †,' o
eval (Cut' (Var i) (rew [fun projs : sigma (fun A : ty => pat A) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in Inr u `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
a2, b2: pre_ty
Ξ“: neg_ctx
A: ty
i: Ξ“ βˆ‹ A
o: pat A †
Ξ³: dom o =[ val_n ]> Ξ“
eqargs: {| pr1 := ↑ (a2 `β†’ b2); pr2 := PLam |} = {| pr1 := A †; pr2 := o |}
H0: ↑ (a2 `β†’ b2) = A †
H1: ↑ (a2 `β†’ b2),' PLam = A †,' o
eval (Cut' (Var i) (rew [fun projs : sigma (fun A : ty => pat A) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in VarL Ctx.top `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
a3, b3: pre_ty
Ξ“: neg_ctx
A: ty
i: Ξ“ βˆ‹ A
o: pat A †
Ξ³: dom o =[ val_n ]> Ξ“
eqargs: {| pr1 := Β¬ (a3 `Γ— b3); pr2 := PFst |} = {| pr1 := A †; pr2 := o |}
H0: Β¬ (a3 `Γ— b3) = A †
H1: Β¬ (a3 `Γ— b3),' PFst = A †,' o
eval (Cut' (Var i) (rew [fun projs : sigma (fun A : ty => pat A) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in Fst (VarR Ctx.top) `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
a4, b4: pre_ty
Ξ“: neg_ctx
A: ty
i: Ξ“ βˆ‹ A
o: pat A †
Ξ³: dom o =[ val_n ]> Ξ“
eqargs: {| pr1 := Β¬ (a4 `Γ— b4); pr2 := PSnd |} = {| pr1 := A †; pr2 := o |}
H0: Β¬ (a4 `Γ— b4) = A †
H1: Β¬ (a4 `Γ— b4),' PSnd = A †,' o
eval (Cut' (Var i) (rew [fun projs : sigma (fun A : ty => pat A) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in Snd (VarR Ctx.top) `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
a5, b5: pre_ty
v: pat ↑ a5
H: forall (Ξ“ : neg_ctx) (A : ty) (i : Ξ“ βˆ‹ A) (o : pat A †) (Ξ³ : dom o =[ val_n ]> Ξ“) (eqargs : {| pr1 := ↑ a5; pr2 := v |} = {| pr1 := A †; pr2 := o |}), rew [fun projs : sigma (fun A0 : ty => pat A0) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in v = o -> eval (Cut' (Var i) (o `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
A: ty
i: Ξ“ βˆ‹ A
o: pat A †
Ξ³: dom o =[ val_n ]> Ξ“
eqargs: {| pr1 := Β¬ (a5 `β†’ b5); pr2 := PApp v |} = {| pr1 := A †; pr2 := o |}
H1: Β¬ (a5 `β†’ b5) = A †
H2: Β¬ (a5 `β†’ b5),' PApp v = A †,' o
eval (Cut' (Var i) (rew [fun projs : sigma (fun A : ty => pat A) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in App (v `α΅₯βŠ›α΅£ r_pop) (VarR Ctx.top) `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
i: Ξ“ βˆ‹ Β¬ `1
o: pat (Β¬ `1) †
Ξ³: dom o =[ val_n ]> Ξ“
eqargs: {| pr1 := ↑ `1; pr2 := PTt |} = {| pr1 := (Β¬ `1) †; pr2 := o |}
H1: ↑ `1,' PTt = (Β¬ `1) †,' o

eval (Cut' (Var i) (rew [fun projs : sigma (fun A : ty => pat A) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in VarL Ctx.top `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
a, b: pre_ty
Ξ“: neg_ctx
i: Ξ“ βˆ‹ Β¬ (a `Γ— b)
o: pat (Β¬ (a `Γ— b)) †
Ξ³: dom o =[ val_n ]> Ξ“
eqargs: {| pr1 := ↑ (a `Γ— b); pr2 := PPair |} = {| pr1 := (Β¬ (a `Γ— b)) †; pr2 := o |}
H1: ↑ (a `Γ— b),' PPair = (Β¬ (a `Γ— b)) †,' o
eval (Cut' (Var i) (rew [fun projs : sigma (fun A : ty => pat A) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in VarL Ctx.top `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
a0, b0: pre_ty
u: pat ↑ a0
H: forall (Ξ“ : neg_ctx) (A : ty) (i : Ξ“ βˆ‹ A) (o : pat A †) (Ξ³ : dom o =[ val_n ]> Ξ“) (eqargs : {| pr1 := ↑ a0; pr2 := u |} = {| pr1 := A †; pr2 := o |}), rew [fun projs : sigma (fun A0 : ty => pat A0) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in u = o -> eval (Cut' (Var i) (o `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
i: Ξ“ βˆ‹ Β¬ (a0 `+ b0)
o: pat (Β¬ (a0 `+ b0)) †
Ξ³: dom o =[ val_n ]> Ξ“
eqargs: {| pr1 := ↑ (a0 `+ b0); pr2 := PInl u |} = {| pr1 := (Β¬ (a0 `+ b0)) †; pr2 := o |}
H2: ↑ (a0 `+ b0),' PInl u = (Β¬ (a0 `+ b0)) †,' o
eval (Cut' (Var i) (rew [fun projs : sigma (fun A : ty => pat A) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in Inl u `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
a1, b1: pre_ty
u: pat ↑ b1
H: forall (Ξ“ : neg_ctx) (A : ty) (i : Ξ“ βˆ‹ A) (o : pat A †) (Ξ³ : dom o =[ val_n ]> Ξ“) (eqargs : {| pr1 := ↑ b1; pr2 := u |} = {| pr1 := A †; pr2 := o |}), rew [fun projs : sigma (fun A0 : ty => pat A0) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in u = o -> eval (Cut' (Var i) (o `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
i: Ξ“ βˆ‹ Β¬ (a1 `+ b1)
o: pat (Β¬ (a1 `+ b1)) †
Ξ³: dom o =[ val_n ]> Ξ“
eqargs: {| pr1 := ↑ (a1 `+ b1); pr2 := PInr u |} = {| pr1 := (Β¬ (a1 `+ b1)) †; pr2 := o |}
H2: ↑ (a1 `+ b1),' PInr u = (Β¬ (a1 `+ b1)) †,' o
eval (Cut' (Var i) (rew [fun projs : sigma (fun A : ty => pat A) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in Inr u `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
a2, b2: pre_ty
Ξ“: neg_ctx
i: Ξ“ βˆ‹ Β¬ (a2 `β†’ b2)
o: pat (Β¬ (a2 `β†’ b2)) †
Ξ³: dom o =[ val_n ]> Ξ“
eqargs: {| pr1 := ↑ (a2 `β†’ b2); pr2 := PLam |} = {| pr1 := (Β¬ (a2 `β†’ b2)) †; pr2 := o |}
H1: ↑ (a2 `β†’ b2),' PLam = (Β¬ (a2 `β†’ b2)) †,' o
eval (Cut' (Var i) (rew [fun projs : sigma (fun A : ty => pat A) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in VarL Ctx.top `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
a3, b3: pre_ty
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a3 `Γ— b3)
o: pat (↑ (a3 `Γ— b3)) †
Ξ³: dom o =[ val_n ]> Ξ“
eqargs: {| pr1 := Β¬ (a3 `Γ— b3); pr2 := PFst |} = {| pr1 := (↑ (a3 `Γ— b3)) †; pr2 := o |}
H1: Β¬ (a3 `Γ— b3),' PFst = (↑ (a3 `Γ— b3)) †,' o
eval (Cut' (Var i) (rew [fun projs : sigma (fun A : ty => pat A) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in Fst (VarR Ctx.top) `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
a4, b4: pre_ty
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a4 `Γ— b4)
o: pat (↑ (a4 `Γ— b4)) †
Ξ³: dom o =[ val_n ]> Ξ“
eqargs: {| pr1 := Β¬ (a4 `Γ— b4); pr2 := PSnd |} = {| pr1 := (↑ (a4 `Γ— b4)) †; pr2 := o |}
H1: Β¬ (a4 `Γ— b4),' PSnd = (↑ (a4 `Γ— b4)) †,' o
eval (Cut' (Var i) (rew [fun projs : sigma (fun A : ty => pat A) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in Snd (VarR Ctx.top) `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
a5, b5: pre_ty
v: pat ↑ a5
H: forall (Ξ“ : neg_ctx) (A : ty) (i : Ξ“ βˆ‹ A) (o : pat A †) (Ξ³ : dom o =[ val_n ]> Ξ“) (eqargs : {| pr1 := ↑ a5; pr2 := v |} = {| pr1 := A †; pr2 := o |}), rew [fun projs : sigma (fun A0 : ty => pat A0) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in v = o -> eval (Cut' (Var i) (o `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a5 `β†’ b5)
o: pat (↑ (a5 `β†’ b5)) †
Ξ³: dom o =[ val_n ]> Ξ“
eqargs: {| pr1 := Β¬ (a5 `β†’ b5); pr2 := PApp v |} = {| pr1 := (↑ (a5 `β†’ b5)) †; pr2 := o |}
H2: Β¬ (a5 `β†’ b5),' PApp v = (↑ (a5 `β†’ b5)) †,' o
eval (Cut' (Var i) (rew [fun projs : sigma (fun A : ty => pat A) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in App (v `α΅₯βŠ›α΅£ r_pop) (VarR Ctx.top) `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
i: Ξ“ βˆ‹ Β¬ `1
Ξ³: dom PTt =[ val_n ]> Ξ“
H1: ↑ `1,' PTt = (Β¬ `1) †,' PTt

eval (Cut (Val (Ξ³ ↑ `1 Ctx.top)) (Var i)) ≋ ret_delay (i β‹… PTt ⦇ Ξ³ ⦈)
a, b: pre_ty
Ξ“: neg_ctx
i: Ξ“ βˆ‹ Β¬ (a `Γ— b)
Ξ³: dom PPair =[ val_n ]> Ξ“
H1: ↑ (a `Γ— b),' PPair = (Β¬ (a `Γ— b)) †,' PPair
eval (Cut (Val (Ξ³ ↑ (a `Γ— b) Ctx.top)) (Var i)) ≋ ret_delay (i β‹… PPair ⦇ Ξ³ ⦈)
a0, b0: pre_ty
u: pat ↑ a0
H: forall (Ξ“ : neg_ctx) (A : ty) (i : Ξ“ βˆ‹ A) (o : pat A †) (Ξ³ : dom o =[ val_n ]> Ξ“) (eqargs : {| pr1 := ↑ a0; pr2 := u |} = {| pr1 := A †; pr2 := o |}), rew [fun projs : sigma (fun A0 : ty => pat A0) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in u = o -> eval (Cut' (Var i) (o `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
i: Ξ“ βˆ‹ Β¬ (a0 `+ b0)
Ξ³: dom (PInl u) =[ val_n ]> Ξ“
H2: ↑ (a0 `+ b0),' PInl u = (Β¬ (a0 `+ b0)) †,' PInl u
eval (Cut (Val (Inl (u `α΅₯βŠ› Ξ³))) (Var i)) ≋ ret_delay (i β‹… PInl u ⦇ Ξ³ ⦈)
a1, b1: pre_ty
u: pat ↑ b1
H: forall (Ξ“ : neg_ctx) (A : ty) (i : Ξ“ βˆ‹ A) (o : pat A †) (Ξ³ : dom o =[ val_n ]> Ξ“) (eqargs : {| pr1 := ↑ b1; pr2 := u |} = {| pr1 := A †; pr2 := o |}), rew [fun projs : sigma (fun A0 : ty => pat A0) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in u = o -> eval (Cut' (Var i) (o `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
i: Ξ“ βˆ‹ Β¬ (a1 `+ b1)
Ξ³: dom (PInr u) =[ val_n ]> Ξ“
H2: ↑ (a1 `+ b1),' PInr u = (Β¬ (a1 `+ b1)) †,' PInr u
eval (Cut (Val (Inr (u `α΅₯βŠ› Ξ³))) (Var i)) ≋ ret_delay (i β‹… PInr u ⦇ Ξ³ ⦈)
a2, b2: pre_ty
Ξ“: neg_ctx
i: Ξ“ βˆ‹ Β¬ (a2 `β†’ b2)
Ξ³: dom PLam =[ val_n ]> Ξ“
H1: ↑ (a2 `β†’ b2),' PLam = (Β¬ (a2 `β†’ b2)) †,' PLam
eval (Cut (Val (Ξ³ ↑ (a2 `β†’ b2) Ctx.top)) (Var i)) ≋ ret_delay (i β‹… PLam ⦇ Ξ³ ⦈)
a3, b3: pre_ty
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a3 `Γ— b3)
Ξ³: dom PFst =[ val_n ]> Ξ“
H1: Β¬ (a3 `Γ— b3),' PFst = (↑ (a3 `Γ— b3)) †,' PFst
eval (Cut (Val (Var i)) (Fst (Ξ³ Β¬ a3 Ctx.top))) ≋ ret_delay (i β‹… PFst ⦇ Ξ³ ⦈)
a4, b4: pre_ty
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a4 `Γ— b4)
Ξ³: dom PSnd =[ val_n ]> Ξ“
H1: Β¬ (a4 `Γ— b4),' PSnd = (↑ (a4 `Γ— b4)) †,' PSnd
eval (Cut (Val (Var i)) (Snd (Ξ³ Β¬ b4 Ctx.top))) ≋ ret_delay (i β‹… PSnd ⦇ Ξ³ ⦈)
a5, b5: pre_ty
v: pat ↑ a5
H: forall (Ξ“ : neg_ctx) (A : ty) (i : Ξ“ βˆ‹ A) (o : pat A †) (Ξ³ : dom o =[ val_n ]> Ξ“) (eqargs : {| pr1 := ↑ a5; pr2 := v |} = {| pr1 := A †; pr2 := o |}), rew [fun projs : sigma (fun A0 : ty => pat A0) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in v = o -> eval (Cut' (Var i) (o `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a5 `β†’ b5)
Ξ³: dom (PApp v) =[ val_n ]> Ξ“
H2: Β¬ (a5 `β†’ b5),' PApp v = (↑ (a5 `β†’ b5)) †,' PApp v
eval (Cut (Val (Var i)) (App (v `α΅₯βŠ›α΅£ r_pop `α΅₯βŠ› Ξ³) (Ξ³ Β¬ b5 Ctx.top))) ≋ ret_delay (i β‹… PApp v ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
i: Ξ“ βˆ‹ Β¬ `1
Ξ³: dom PTt =[ val_n ]> Ξ“
H1: ↑ `1,' PTt = (Β¬ `1) †,' PTt

nf_eq (s_var_upg i β‹… w_split `1 (Ξ³ ↑ `1 Ctx.top)) (i β‹… PTt ⦇ Ξ³ ⦈)
a, b: pre_ty
Ξ“: neg_ctx
i: Ξ“ βˆ‹ Β¬ (a `Γ— b)
Ξ³: dom PPair =[ val_n ]> Ξ“
H1: ↑ (a `Γ— b),' PPair = (Β¬ (a `Γ— b)) †,' PPair
nf_eq (s_var_upg i β‹… w_split (a `Γ— b) (Ξ³ ↑ (a `Γ— b) Ctx.top)) (i β‹… PPair ⦇ Ξ³ ⦈)
a0, b0: pre_ty
u: pat ↑ a0
H: forall (Ξ“ : neg_ctx) (A : ty) (i : Ξ“ βˆ‹ A) (o : pat A †) (Ξ³ : dom o =[ val_n ]> Ξ“) (eqargs : {| pr1 := ↑ a0; pr2 := u |} = {| pr1 := A †; pr2 := o |}), rew [fun projs : sigma (fun A0 : ty => pat A0) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in u = o -> eval (Cut' (Var i) (o `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
i: Ξ“ βˆ‹ Β¬ (a0 `+ b0)
Ξ³: dom (PInl u) =[ val_n ]> Ξ“
H2: ↑ (a0 `+ b0),' PInl u = (Β¬ (a0 `+ b0)) †,' PInl u
nf_eq (s_var_upg i β‹… w_split (a0 `+ b0) (Inl (u `α΅₯βŠ› Ξ³))) (i β‹… PInl u ⦇ Ξ³ ⦈)
a1, b1: pre_ty
u: pat ↑ b1
H: forall (Ξ“ : neg_ctx) (A : ty) (i : Ξ“ βˆ‹ A) (o : pat A †) (Ξ³ : dom o =[ val_n ]> Ξ“) (eqargs : {| pr1 := ↑ b1; pr2 := u |} = {| pr1 := A †; pr2 := o |}), rew [fun projs : sigma (fun A0 : ty => pat A0) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in u = o -> eval (Cut' (Var i) (o `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
i: Ξ“ βˆ‹ Β¬ (a1 `+ b1)
Ξ³: dom (PInr u) =[ val_n ]> Ξ“
H2: ↑ (a1 `+ b1),' PInr u = (Β¬ (a1 `+ b1)) †,' PInr u
nf_eq (s_var_upg i β‹… w_split (a1 `+ b1) (Inr (u `α΅₯βŠ› Ξ³))) (i β‹… PInr u ⦇ Ξ³ ⦈)
a2, b2: pre_ty
Ξ“: neg_ctx
i: Ξ“ βˆ‹ Β¬ (a2 `β†’ b2)
Ξ³: dom PLam =[ val_n ]> Ξ“
H1: ↑ (a2 `β†’ b2),' PLam = (Β¬ (a2 `β†’ b2)) †,' PLam
nf_eq (s_var_upg i β‹… w_split (a2 `β†’ b2) (Ξ³ ↑ (a2 `β†’ b2) Ctx.top)) (i β‹… PLam ⦇ Ξ³ ⦈)
a3, b3: pre_ty
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a3 `Γ— b3)
Ξ³: dom PFst =[ val_n ]> Ξ“
H1: Β¬ (a3 `Γ— b3),' PFst = (↑ (a3 `Γ— b3)) †,' PFst
nf_eq (fst_nf i (Ξ³ Β¬ a3 Ctx.top)) (i β‹… PFst ⦇ Ξ³ ⦈)
a4, b4: pre_ty
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a4 `Γ— b4)
Ξ³: dom PSnd =[ val_n ]> Ξ“
H1: Β¬ (a4 `Γ— b4),' PSnd = (↑ (a4 `Γ— b4)) †,' PSnd
nf_eq (snd_nf i (Ξ³ Β¬ b4 Ctx.top)) (i β‹… PSnd ⦇ Ξ³ ⦈)
a5, b5: pre_ty
v: pat ↑ a5
H: forall (Ξ“ : neg_ctx) (A : ty) (i : Ξ“ βˆ‹ A) (o : pat A †) (Ξ³ : dom o =[ val_n ]> Ξ“) (eqargs : {| pr1 := ↑ a5; pr2 := v |} = {| pr1 := A †; pr2 := o |}), rew [fun projs : sigma (fun A0 : ty => pat A0) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in v = o -> eval (Cut' (Var i) (o `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a5 `β†’ b5)
Ξ³: dom (PApp v) =[ val_n ]> Ξ“
H2: Β¬ (a5 `β†’ b5),' PApp v = (↑ (a5 `β†’ b5)) †,' PApp v
nf_eq (app_nf i (v `α΅₯βŠ›α΅£ r_pop `α΅₯βŠ› Ξ³) (Ξ³ Β¬ b5 Ctx.top)) (i β‹… PApp v ⦇ Ξ³ ⦈)
a0, b0: pre_ty
u: pat ↑ a0
H: forall (Ξ“ : neg_ctx) (A : ty) (i : Ξ“ βˆ‹ A) (o : pat A †) (Ξ³ : dom o =[ val_n ]> Ξ“) (eqargs : {| pr1 := ↑ a0; pr2 := u |} = {| pr1 := A †; pr2 := o |}), rew [fun projs : sigma (fun A0 : ty => pat A0) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in u = o -> eval (Cut' (Var i) (o `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
i: Ξ“ βˆ‹ Β¬ (a0 `+ b0)
Ξ³: dom (PInl u) =[ val_n ]> Ξ“
H2: ↑ (a0 `+ b0),' PInl u = (Β¬ (a0 `+ b0)) †,' PInl u

nf_eq (s_var_upg i β‹… w_split (a0 `+ b0) (Inl (u `α΅₯βŠ› Ξ³))) (i β‹… PInl u ⦇ Ξ³ ⦈)
a1, b1: pre_ty
u: pat ↑ b1
H: forall (Ξ“ : neg_ctx) (A : ty) (i : Ξ“ βˆ‹ A) (o : pat A †) (Ξ³ : dom o =[ val_n ]> Ξ“) (eqargs : {| pr1 := ↑ b1; pr2 := u |} = {| pr1 := A †; pr2 := o |}), rew [fun projs : sigma (fun A0 : ty => pat A0) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in u = o -> eval (Cut' (Var i) (o `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
i: Ξ“ βˆ‹ Β¬ (a1 `+ b1)
Ξ³: dom (PInr u) =[ val_n ]> Ξ“
H2: ↑ (a1 `+ b1),' PInr u = (Β¬ (a1 `+ b1)) †,' PInr u
nf_eq (s_var_upg i β‹… w_split (a1 `+ b1) (Inr (u `α΅₯βŠ› Ξ³))) (i β‹… PInr u ⦇ Ξ³ ⦈)
a5, b5: pre_ty
v: pat ↑ a5
H: forall (Ξ“ : neg_ctx) (A : ty) (i : Ξ“ βˆ‹ A) (o : pat A †) (Ξ³ : dom o =[ val_n ]> Ξ“) (eqargs : {| pr1 := ↑ a5; pr2 := v |} = {| pr1 := A †; pr2 := o |}), rew [fun projs : sigma (fun A0 : ty => pat A0) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in v = o -> eval (Cut' (Var i) (o `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a5 `β†’ b5)
Ξ³: dom (PApp v) =[ val_n ]> Ξ“
H2: Β¬ (a5 `β†’ b5),' PApp v = (↑ (a5 `β†’ b5)) †,' PApp v
nf_eq (app_nf i (v `α΅₯βŠ›α΅£ r_pop `α΅₯βŠ› Ξ³) (Ξ³ Β¬ b5 Ctx.top)) (i β‹… PApp v ⦇ Ξ³ ⦈)
a5, b5: pre_ty
v: pat ↑ a5
H: forall (Ξ“ : neg_ctx) (A : ty) (i : Ξ“ βˆ‹ A) (o : pat A †) (Ξ³ : dom o =[ val_n ]> Ξ“) (eqargs : {| pr1 := ↑ a5; pr2 := v |} = {| pr1 := A †; pr2 := o |}), rew [fun projs : sigma (fun A0 : ty => pat A0) => val (pat_dom (pr2 projs)) (pr1 projs)] eqargs in v = o -> eval (Cut' (Var i) (o `β‚œβŠ› Ξ³)) ≋ ret_delay (i β‹… o ⦇ Ξ³ ⦈)
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a5 `β†’ b5)
Ξ³: dom (PApp v) =[ val_n ]> Ξ“
H2: Β¬ (a5 `β†’ b5),' PApp v = (↑ (a5 `β†’ b5)) †,' PApp v

nf_eq (app_nf i (v `α΅₯βŠ›α΅£ r_pop `α΅₯βŠ› Ξ³) (Ξ³ Β¬ b5 Ctx.top)) (i β‹… PApp v ⦇ Ξ³ ⦈)
(* a bit of an ugly case because we didn't write proper generic functions for splitting negative values.. hence knowing this one is an App is getting in our way *)
a5, b5: pre_ty
v: pat ↑ a5
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a5 `β†’ b5)
Ξ³: dom (PApp v) =[ val_n ]> Ξ“

nf_eq (i β‹… PApp (p_of_w a5 (v `α΅₯βŠ›α΅£ r_pop `α΅₯βŠ› Ξ³)) ⦇ p_dom_of_w a5 (v `α΅₯βŠ›α΅£ r_pop `α΅₯βŠ› Ξ³) ▢ₐ Ξ³ Β¬ b5 Ctx.top ⦈) (i β‹… PApp v ⦇ Ξ³ ⦈)
a5, b5: pre_ty
v: pat ↑ a5
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a5 `β†’ b5)
Ξ³: dom (PApp v) =[ val_n ]> Ξ“

nf_eq (i β‹… PApp (p_of_w a5 (v `α΅₯βŠ› r_pop α΅£βŠ› Ξ³)) ⦇ p_dom_of_w a5 (v `α΅₯βŠ› r_pop α΅£βŠ› Ξ³) ▢ₐ Ξ³ Β¬ b5 Ctx.top ⦈) (i β‹… PApp v ⦇ Ξ³ ⦈)
a5, b5: pre_ty
v: pat ↑ a5
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a5 `β†’ b5)
Ξ³: dom (PApp v) =[ val_n ]> Ξ“
Ξ³':= (r_pop α΅£βŠ› Ξ³)%asgn: pat_dom v =[ val ]> Ξ“

nf_eq (i β‹… PApp (p_of_w a5 (v `α΅₯βŠ› r_pop α΅£βŠ› Ξ³)) ⦇ p_dom_of_w a5 (v `α΅₯βŠ› r_pop α΅£βŠ› Ξ³) ▢ₐ Ξ³ Β¬ b5 Ctx.top ⦈) (i β‹… PApp v ⦇ Ξ³ ⦈)
a5, b5: pre_ty
v: pat ↑ a5
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a5 `β†’ b5)
Ξ³: dom (PApp v) =[ val_n ]> Ξ“
Ξ³':= (r_pop α΅£βŠ› Ξ³)%asgn: pat_dom v =[ val ]> Ξ“

nf_eq (i β‹… PApp (p_of_w a5 (v `α΅₯βŠ› Ξ³')) ⦇ p_dom_of_w a5 (v `α΅₯βŠ› Ξ³') ▢ₐ Ξ³ Β¬ b5 Ctx.top ⦈) (i β‹… PApp v ⦇ Ξ³ ⦈)
a5, b5: pre_ty
v: pat ↑ a5
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a5 `β†’ b5)
Ξ³: dom (PApp v) =[ val_n ]> Ξ“
Ξ³':= (r_pop α΅£βŠ› Ξ³)%asgn: pat_dom v =[ val ]> Ξ“
vv:= Ξ³ Β¬ b5 Ctx.top: term Ξ“ Β¬ b5

nf_eq (i β‹… PApp (p_of_w a5 (v `α΅₯βŠ› Ξ³')) ⦇ p_dom_of_w a5 (v `α΅₯βŠ› Ξ³') ▢ₐ vv ⦈) (i β‹… PApp v ⦇ Ξ³ ⦈)
a5, b5: pre_ty
v: pat ↑ a5
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a5 `β†’ b5)
Ξ³: dom (PApp v) =[ val_n ]> Ξ“
Ξ³':= (r_pop α΅£βŠ› Ξ³)%asgn: pat_dom v =[ val ]> Ξ“
vv:= Ξ³ Β¬ b5 Ctx.top: term Ξ“ Β¬ b5
H: Ξ³' ▢ₐ upg_k vv ≑ₐ Ξ³

nf_eq (i β‹… PApp (p_of_w a5 (v `α΅₯βŠ› Ξ³')) ⦇ p_dom_of_w a5 (v `α΅₯βŠ› Ξ³') ▢ₐ vv ⦈) (i β‹… PApp v ⦇ Ξ³ ⦈)
a5, b5: pre_ty
v: pat ↑ a5
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a5 `β†’ b5)
Ξ³: dom (PApp v) =[ val_n ]> Ξ“
a: pat_dom v =[ val ]> Ξ“
t: term Ξ“ Β¬ b5
H: a ▢ₐ upg_k t ≑ₐ Ξ³

nf_eq (i β‹… PApp (p_of_w a5 (v `α΅₯βŠ› a)) ⦇ p_dom_of_w a5 (v `α΅₯βŠ› a) ▢ₐ t ⦈) (i β‹… PApp v ⦇ Ξ³ ⦈)
a5, b5: pre_ty
v: pat ↑ a5
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a5 `β†’ b5)
Ξ³: dom (PApp v) =[ val_n ]> Ξ“
a: pat_dom v =[ val ]> Ξ“
t: term Ξ“ Β¬ b5
H: a ▢ₐ upg_k t ≑ₐ Ξ³
H0: rew [fun p : pat ↑ a5 => pat_dom p =[ val ]> Ξ“] p_of_w_eq a5 v a in p_dom_of_w a5 ((v : val (pat_dom v) ↑ a5) `α΅₯βŠ› a) ≑ₐ a

nf_eq (i β‹… PApp (p_of_w a5 (v `α΅₯βŠ› a)) ⦇ p_dom_of_w a5 (v `α΅₯βŠ› a) ▢ₐ t ⦈) (i β‹… PApp v ⦇ Ξ³ ⦈)
a5, b5: pre_ty
v: pat ↑ a5
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a5 `β†’ b5)
Ξ³: dom (PApp v) =[ val_n ]> Ξ“
a: pat_dom v =[ val ]> Ξ“
t: term Ξ“ Β¬ b5
H: a ▢ₐ upg_k t ≑ₐ Ξ³
H':= p_of_w_eq a5 v a: p_of_w a5 ((v : val (pat_dom v) ↑ a5) `α΅₯βŠ› a) = v
H0: rew [fun p : pat ↑ a5 => pat_dom p =[ val ]> Ξ“] H' in p_dom_of_w a5 ((v : val (pat_dom v) ↑ a5) `α΅₯βŠ› a) ≑ₐ a

nf_eq (i β‹… PApp (p_of_w a5 (v `α΅₯βŠ› a)) ⦇ p_dom_of_w a5 (v `α΅₯βŠ› a) ▢ₐ t ⦈) (i β‹… PApp v ⦇ Ξ³ ⦈)
a5, b5: pre_ty
v: pat ↑ a5
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a5 `β†’ b5)
Ξ³: dom (PApp v) =[ val_n ]> Ξ“
a: pat_dom v =[ val ]> Ξ“
t: term Ξ“ Β¬ b5
H: a ▢ₐ upg_k t ≑ₐ Ξ³
H':= p_of_w_eq a5 v a: p_of_w a5 ((v : val (pat_dom v) ↑ a5) `α΅₯βŠ› a) = v
aa:= p_dom_of_w a5 ((v : val (pat_dom v) ↑ a5) `α΅₯βŠ› a): pat_dom (p_of_w a5 ((v : val (pat_dom v) ↑ a5) `α΅₯βŠ› a)) =[ val ]> Ξ“
H0: rew [fun p : pat ↑ a5 => pat_dom p =[ val ]> Ξ“] H' in aa ≑ₐ a

nf_eq (i β‹… PApp (p_of_w a5 (v `α΅₯βŠ› a)) ⦇ aa ▢ₐ t ⦈) (i β‹… PApp v ⦇ Ξ³ ⦈)
a5, b5: pre_ty
v: pat ↑ a5
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a5 `β†’ b5)
Ξ³: dom (PApp v) =[ val_n ]> Ξ“
a: pat_dom v =[ val ]> Ξ“
t: term Ξ“ Β¬ b5
H: a ▢ₐ upg_k t ≑ₐ Ξ³
H':= p_of_w_eq a5 v a: p_of_w a5 ((v : val (pat_dom v) ↑ a5) `α΅₯βŠ› a) = v
a': pat_dom (p_of_w a5 ((v : val (pat_dom v) ↑ a5) `α΅₯βŠ› a)) =[ val ]> Ξ“
H0: rew [fun p : pat ↑ a5 => pat_dom p =[ val ]> Ξ“] H' in a' ≑ₐ a

nf_eq (i β‹… PApp (p_of_w a5 (v `α΅₯βŠ› a)) ⦇ a' ▢ₐ t ⦈) (i β‹… PApp v ⦇ Ξ³ ⦈)
a5, b5: pre_ty
v: pat ↑ a5
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a5 `β†’ b5)
Ξ³: dom (PApp v) =[ val_n ]> Ξ“
a: pat_dom v =[ val ]> Ξ“
t: term Ξ“ Β¬ b5
H: a ▢ₐ upg_k t ≑ₐ Ξ³
H':= p_of_w_eq a5 v a: p_of_w a5 ((v : val (pat_dom v) ↑ a5) `α΅₯βŠ› a) = v
a': pat_dom v =[ val ]> Ξ“
H0: rew [fun p : pat ↑ a5 => pat_dom p =[ val ]> Ξ“] eq_refl in a' ≑ₐ a

a' ▢ₐ t ≑ₐ Ξ³
a5, b5: pre_ty
v: pat ↑ a5
Ξ“: neg_ctx
i: Ξ“ βˆ‹ ↑ (a5 `β†’ b5)
Ξ³: dom (PApp v) =[ val_n ]> Ξ“
a: pat_dom v =[ val ]> Ξ“
t: term Ξ“ Β¬ b5
H: a ▢ₐ upg_k t ≑ₐ Ξ³
H':= p_of_w_eq a5 v a: p_of_w a5 ((v : val (pat_dom v) ↑ a5) `α΅₯βŠ› a) = v
a': pat_dom v =[ val ]> Ξ“
H0: rew [fun p : pat ↑ a5 => pat_dom p =[ val ]> Ξ“] eq_refl in a' ≑ₐ a

a' ▢ₐ t ≑ₐ a ▢ₐ upg_k t
refine (a_append_eq _ _ _ _ _ _); auto.

well_founded head_inst_nostep
y: ty
o: op_copat y
B: ty
m: op_copat B
Ξ“: neg_ctx
v: val_n Ξ“ y
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
t0: is_var v -> T0
i0: evalβ‚’ (v βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)

Acc head_inst_nostep (B,' m)
p: pre_ty
o: op_copat ↑ p
B: ty
m: op_copat B
Ξ“: neg_ctx
v: val Ξ“ ↑ p
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
t0: is_var v -> T0
i0: evalβ‚’ (v βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)

Acc head_inst_nostep (B,' m)
p: pre_ty
o: op_copat Β¬ p
B: ty
m: op_copat B
Ξ“: neg_ctx
v: val Ξ“ Β¬ p
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
t0: is_var v -> T0
i0: evalβ‚’ (v βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
A0, B0: pre_ty
o: op_copat ↑ (A0 `+ B0)
B: ty
m: op_copat B
Ξ“: neg_ctx
w: whn Ξ“ A0
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
t0: is_var (Inl w) -> T0
i0: evalβ‚’ (Inl w βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)

Acc head_inst_nostep (B,' m)
A1, B1: pre_ty
o: op_copat ↑ (A1 `+ B1)
B: ty
m: op_copat B
Ξ“: neg_ctx
w0: whn Ξ“ B1
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
t0: is_var (Inr w0) -> T0
i0: evalβ‚’ (Inr w0 βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
o: op_copat ↑ `1
B: ty
m: op_copat B
Ξ“: neg_ctx
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
t0: is_var Tt -> T0
i0: evalβ‚’ (Tt βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
A2, B2: pre_ty
o: op_copat ↑ (A2 `Γ— B2)
B: ty
m: op_copat B
Ξ“: neg_ctx
s: state (Ξ“ β–Άβ‚“ Β¬ A2)
s0: state (Ξ“ β–Άβ‚“ Β¬ B2)
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
t0: is_var (Pair s s0) -> T0
i0: evalβ‚’ (Pair s s0 βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
A3, B3: pre_ty
o: op_copat ↑ (A3 `β†’ B3)
B: ty
m: op_copat B
Ξ“: neg_ctx
s1: state (Ξ“ β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3)
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
t0: is_var (Lam s1) -> T0
i0: evalβ‚’ (Lam s1 βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
A2: pre_ty
o: op_copat Β¬ A2
B: ty
m: op_copat B
Ξ“: neg_ctx
s0: state (Ξ“ β–Άβ‚“ ↑ A2)
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
t0: is_var (MuT s0) -> T0
i0: evalβ‚’ (MuT s0 βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
o: op_copat Β¬ `0
B: ty
m: op_copat B
Ξ“: neg_ctx
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
t0: is_var Boom -> T0
i0: evalβ‚’ (Boom βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
A3, B0: pre_ty
o: op_copat Β¬ (A3 `+ B0)
B: ty
m: op_copat B
Ξ“: neg_ctx
s1: state (Ξ“ β–Άβ‚“ ↑ A3)
s2: state (Ξ“ β–Άβ‚“ ↑ B0)
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
t0: is_var (Case s1 s2) -> T0
i0: evalβ‚’ (Case s1 s2 βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
A4, B1: pre_ty
o: op_copat Β¬ (A4 `Γ— B1)
B: ty
m: op_copat B
Ξ“: neg_ctx
t1: term Ξ“ Β¬ A4
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
t0: is_var (Fst t1) -> T0
i0: evalβ‚’ (Fst t1 βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
A5, B2: pre_ty
o: op_copat Β¬ (A5 `Γ— B2)
B: ty
m: op_copat B
Ξ“: neg_ctx
t2: term Ξ“ Β¬ B2
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
t0: is_var (Snd t2) -> T0
i0: evalβ‚’ (Snd t2 βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
A6, B3: pre_ty
o: op_copat Β¬ (A6 `β†’ B3)
B: ty
m: op_copat B
Ξ“: neg_ctx
w0: whn Ξ“ A6
t3: term Ξ“ Β¬ B3
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
t0: is_var (App w0 t3) -> T0
i0: evalβ‚’ (App w0 t3 βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
A0, B0: pre_ty
o: op_copat ↑ (A0 `+ B0)
B: ty
m: op_copat B
Ξ“: neg_ctx
w: whn Ξ“ A0
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Inl w βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)

Acc head_inst_nostep (B,' m)
A1, B1: pre_ty
o: op_copat ↑ (A1 `+ B1)
B: ty
m: op_copat B
Ξ“: neg_ctx
w0: whn Ξ“ B1
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Inr w0 βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
o: op_copat ↑ `1
B: ty
m: op_copat B
Ξ“: neg_ctx
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Tt βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
A2, B2: pre_ty
o: op_copat ↑ (A2 `Γ— B2)
B: ty
m: op_copat B
Ξ“: neg_ctx
s: state (Ξ“ β–Άβ‚“ Β¬ A2)
s0: state (Ξ“ β–Άβ‚“ Β¬ B2)
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Pair s s0 βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
A3, B3: pre_ty
o: op_copat ↑ (A3 `β†’ B3)
B: ty
m: op_copat B
Ξ“: neg_ctx
s1: state (Ξ“ β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3)
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Lam s1 βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
A2: pre_ty
o: op_copat Β¬ A2
B: ty
m: op_copat B
Ξ“: neg_ctx
s0: state (Ξ“ β–Άβ‚“ ↑ A2)
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (MuT s0 βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
o: op_copat Β¬ `0
B: ty
m: op_copat B
Ξ“: neg_ctx
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Boom βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
A3, B0: pre_ty
o: op_copat Β¬ (A3 `+ B0)
B: ty
m: op_copat B
Ξ“: neg_ctx
s1: state (Ξ“ β–Άβ‚“ ↑ A3)
s2: state (Ξ“ β–Άβ‚“ ↑ B0)
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Case s1 s2 βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
A4, B1: pre_ty
o: op_copat Β¬ (A4 `Γ— B1)
B: ty
m: op_copat B
Ξ“: neg_ctx
t1: term Ξ“ Β¬ A4
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Fst t1 βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
A5, B2: pre_ty
o: op_copat Β¬ (A5 `Γ— B2)
B: ty
m: op_copat B
Ξ“: neg_ctx
t2: term Ξ“ Β¬ B2
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Snd t2 βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
A6, B3: pre_ty
o: op_copat Β¬ (A6 `β†’ B3)
B: ty
m: op_copat B
Ξ“: neg_ctx
w0: whn Ξ“ A6
t3: term Ξ“ Β¬ B3
a: dom o =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (App w0 t3 βŠ™ o β¦— a ⦘) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a4, b3: pre_ty
B: ty
m: op_copat B
Ξ“: neg_ctx
s: state (Ξ“ β–Άβ‚“ Β¬ a4)
s0: state (Ξ“ β–Άβ‚“ Β¬ b3)
a: dom PFst =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Cut (Val (Pair s s0)) (Fst (a Β¬ a4 Ctx.top))) β‰Š ret_delay (i β‹… m)

Acc head_inst_nostep (B,' m)
a5, b4: pre_ty
B: ty
m: op_copat B
Ξ“: neg_ctx
s: state (Ξ“ β–Άβ‚“ Β¬ a5)
s0: state (Ξ“ β–Άβ‚“ Β¬ b4)
a: dom PSnd =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Cut (Val (Pair s s0)) (Snd (a Β¬ b4 Ctx.top))) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a6, b5: pre_ty
p1: pat ↑ a6
B: ty
m: op_copat B
Ξ“: neg_ctx
s1: state (Ξ“ β–Άβ‚“ ↑ (a6 `β†’ b5) β–Άβ‚“ ↑ a6 β–Άβ‚“ Β¬ b5)
a: dom (PApp p1) =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Cut (Val (Lam s1)) (App (p1 `α΅₯βŠ›α΅£ r_pop `α΅₯βŠ› a) (a Β¬ b5 Ctx.top))) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
B: ty
m: op_copat B
Ξ“: neg_ctx
s0: state (Ξ“ β–Άβ‚“ ↑ `1)
a: dom PTt =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Cut (Val (a ↑ `1 Ctx.top)) (MuT s0)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a0, b: pre_ty
B: ty
m: op_copat B
Ξ“: neg_ctx
s0: state (Ξ“ β–Άβ‚“ ↑ (a0 `Γ— b))
a: dom PPair =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Cut (Val (a ↑ (a0 `Γ— b) Ctx.top)) (MuT s0)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a1, b0: pre_ty
p: pat ↑ a1
B: ty
m: op_copat B
Ξ“: neg_ctx
s0: state (Ξ“ β–Άβ‚“ ↑ (a1 `+ b0))
a: dom (PInl p) =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Cut (Val (Inl (p `α΅₯βŠ› a))) (MuT s0)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a2, b1: pre_ty
p0: pat ↑ b1
B: ty
m: op_copat B
Ξ“: neg_ctx
s0: state (Ξ“ β–Άβ‚“ ↑ (a2 `+ b1))
a: dom (PInr p0) =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Cut (Val (Inr (p0 `α΅₯βŠ› a))) (MuT s0)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a3, b2: pre_ty
B: ty
m: op_copat B
Ξ“: neg_ctx
s0: state (Ξ“ β–Άβ‚“ ↑ (a3 `β†’ b2))
a: dom PLam =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Cut (Val (a ↑ (a3 `β†’ b2) Ctx.top)) (MuT s0)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a1, b0: pre_ty
p: pat ↑ a1
B: ty
m: op_copat B
Ξ“: neg_ctx
s1: state (Ξ“ β–Άβ‚“ ↑ a1)
s2: state (Ξ“ β–Άβ‚“ ↑ b0)
a: dom (PInl p) =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Cut (Val (Inl (p `α΅₯βŠ› a))) (Case s1 s2)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a2, b1: pre_ty
p0: pat ↑ b1
B: ty
m: op_copat B
Ξ“: neg_ctx
s1: state (Ξ“ β–Άβ‚“ ↑ a2)
s2: state (Ξ“ β–Άβ‚“ ↑ b1)
a: dom (PInr p0) =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Cut (Val (Inr (p0 `α΅₯βŠ› a))) (Case s1 s2)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a0, b: pre_ty
B: ty
m: op_copat B
Ξ“: neg_ctx
t1: term Ξ“ Β¬ a0
a: dom PPair =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Cut (Val (a ↑ (a0 `Γ— b) Ctx.top)) (Fst t1)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a0, b: pre_ty
B: ty
m: op_copat B
Ξ“: neg_ctx
t2: term Ξ“ Β¬ b
a: dom PPair =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Cut (Val (a ↑ (a0 `Γ— b) Ctx.top)) (Snd t2)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a3, b2: pre_ty
B: ty
m: op_copat B
Ξ“: neg_ctx
w0: whn Ξ“ a3
t3: term Ξ“ Β¬ b2
a: dom PLam =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Cut (Val (a ↑ (a3 `β†’ b2) Ctx.top)) (App w0 t3)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a4, b3: pre_ty
B: ty
m: op_copat B
Ξ“: neg_ctx
s: state (Ξ“ β–Άβ‚“ Β¬ a4)
s0: state (Ξ“ β–Άβ‚“ Β¬ b3)
i: Ξ“ βˆ‹ B
v': term Ξ“ Β¬ a4
i0: evalβ‚’ (Cut (Val (Pair s s0)) (Fst v')) β‰Š ret_delay (i β‹… m)

Acc head_inst_nostep (B,' m)
a5, b4: pre_ty
B: ty
m: op_copat B
Ξ“: neg_ctx
s: state (Ξ“ β–Άβ‚“ Β¬ a5)
s0: state (Ξ“ β–Άβ‚“ Β¬ b4)
i: Ξ“ βˆ‹ B
v': term Ξ“ Β¬ b4
i0: evalβ‚’ (Cut (Val (Pair s s0)) (Snd v')) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a6, b5: pre_ty
p1: pat ↑ a6
B: ty
m: op_copat B
Ξ“: neg_ctx
s1: state (Ξ“ β–Άβ‚“ ↑ (a6 `β†’ b5) β–Άβ‚“ ↑ a6 β–Άβ‚“ Β¬ b5)
a: dom (PApp p1) =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Cut (Val (Lam s1)) (App (p1 `α΅₯βŠ›α΅£ r_pop `α΅₯βŠ› a) (a Β¬ b5 Ctx.top))) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
B: ty
m: op_copat B
Ξ“: neg_ctx
s0: state (Ξ“ β–Άβ‚“ ↑ `1)
i: Ξ“ βˆ‹ B
v': whn Ξ“ `1
i0: evalβ‚’ (Cut (Val v') (MuT s0)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a0, b: pre_ty
B: ty
m: op_copat B
Ξ“: neg_ctx
s0: state (Ξ“ β–Άβ‚“ ↑ (a0 `Γ— b))
i: Ξ“ βˆ‹ B
v': whn Ξ“ (a0 `Γ— b)
i0: evalβ‚’ (Cut (Val v') (MuT s0)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a1, b0: pre_ty
p: pat ↑ a1
B: ty
m: op_copat B
Ξ“: neg_ctx
s0: state (Ξ“ β–Άβ‚“ ↑ (a1 `+ b0))
a: dom (PInl p) =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Cut (Val (Inl (p `α΅₯βŠ› a))) (MuT s0)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a2, b1: pre_ty
p0: pat ↑ b1
B: ty
m: op_copat B
Ξ“: neg_ctx
s0: state (Ξ“ β–Άβ‚“ ↑ (a2 `+ b1))
a: dom (PInr p0) =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Cut (Val (Inr (p0 `α΅₯βŠ› a))) (MuT s0)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a3, b2: pre_ty
B: ty
m: op_copat B
Ξ“: neg_ctx
s0: state (Ξ“ β–Άβ‚“ ↑ (a3 `β†’ b2))
i: Ξ“ βˆ‹ B
v': whn Ξ“ (a3 `β†’ b2)
i0: evalβ‚’ (Cut (Val v') (MuT s0)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a1, b0: pre_ty
p: pat ↑ a1
B: ty
m: op_copat B
Ξ“: neg_ctx
s1: state (Ξ“ β–Άβ‚“ ↑ a1)
s2: state (Ξ“ β–Άβ‚“ ↑ b0)
a: dom (PInl p) =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Cut (Val (Inl (p `α΅₯βŠ› a))) (Case s1 s2)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a2, b1: pre_ty
p0: pat ↑ b1
B: ty
m: op_copat B
Ξ“: neg_ctx
s1: state (Ξ“ β–Άβ‚“ ↑ a2)
s2: state (Ξ“ β–Άβ‚“ ↑ b1)
a: dom (PInr p0) =[ val_n ]> Ξ“
i: Ξ“ βˆ‹ B
i0: evalβ‚’ (Cut (Val (Inr (p0 `α΅₯βŠ› a))) (Case s1 s2)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a0, b: pre_ty
B: ty
m: op_copat B
Ξ“: neg_ctx
t1: term Ξ“ Β¬ a0
i: Ξ“ βˆ‹ B
v': whn Ξ“ (a0 `Γ— b)
i0: evalβ‚’ (Cut (Val v') (Fst t1)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a0, b: pre_ty
B: ty
m: op_copat B
Ξ“: neg_ctx
t2: term Ξ“ Β¬ b
i: Ξ“ βˆ‹ B
v': whn Ξ“ (a0 `Γ— b)
i0: evalβ‚’ (Cut (Val v') (Snd t2)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a3, b2: pre_ty
B: ty
m: op_copat B
Ξ“: neg_ctx
w0: whn Ξ“ a3
t3: term Ξ“ Β¬ b2
i: Ξ“ βˆ‹ B
v': whn Ξ“ (a3 `β†’ b2)
i0: evalβ‚’ (Cut (Val v') (App w0 t3)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a0, b: pre_ty
B: ty
m: op_copat B
Ξ“: neg_ctx
t1: term Ξ“ Β¬ a0
i: Ξ“ βˆ‹ B
v': whn Ξ“ (a0 `Γ— b)
i0: evalβ‚’ (Cut (Val v') (Fst t1)) β‰Š ret_delay (i β‹… m)

Acc head_inst_nostep (B,' m)
a0, b: pre_ty
B: ty
m: op_copat B
Ξ“: neg_ctx
t2: term Ξ“ Β¬ b
i: Ξ“ βˆ‹ B
v': whn Ξ“ (a0 `Γ— b)
i0: evalβ‚’ (Cut (Val v') (Snd t2)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a3, b2: pre_ty
B: ty
m: op_copat B
Ξ“: neg_ctx
w0: whn Ξ“ a3
t3: term Ξ“ Β¬ b2
i: Ξ“ βˆ‹ B
v': whn Ξ“ (a3 `β†’ b2)
i0: evalβ‚’ (Cut (Val v') (App w0 t3)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a0, b: pre_ty
B: ty
m: op_copat B
Ξ“: neg_ctx
t1: term Ξ“ Β¬ a0
i: Ξ“ βˆ‹ B
c: Ξ“ βˆ‹ ↑ (a0 `Γ— b)
i0: evalβ‚’ (Cut (Val (VarL c)) (Fst t1)) β‰Š ret_delay (i β‹… m)

Acc head_inst_nostep (B,' m)
a0, b: pre_ty
B: ty
m: op_copat B
Ξ“: neg_ctx
t2: term Ξ“ Β¬ b
i: Ξ“ βˆ‹ B
c: Ξ“ βˆ‹ ↑ (a0 `Γ— b)
i0: evalβ‚’ (Cut (Val (VarL c)) (Snd t2)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a3, b2: pre_ty
B: ty
m: op_copat B
Ξ“: neg_ctx
w0: whn Ξ“ a3
t3: term Ξ“ Β¬ b2
i: Ξ“ βˆ‹ B
c: Ξ“ βˆ‹ ↑ (a3 `β†’ b2)
i0: evalβ‚’ (Cut (Val (VarL c)) (App w0 t3)) β‰Š ret_delay (i β‹… m)
Acc head_inst_nostep (B,' m)
a0, b: pre_ty
Ξ“: neg_ctx
t1: term Ξ“ Β¬ a0
c: Ξ“ βˆ‹ ↑ (a0 `Γ— b)

Acc head_inst_nostep (↑ (a0 `Γ— b),' PFst)
a0, b: pre_ty
Ξ“: neg_ctx
t2: term Ξ“ Β¬ b
c: Ξ“ βˆ‹ ↑ (a0 `Γ— b)
Acc head_inst_nostep (↑ (a0 `Γ— b),' PSnd)
a3, b2: pre_ty
Ξ“: neg_ctx
w0: whn Ξ“ a3
t3: term Ξ“ Β¬ b2
c: Ξ“ βˆ‹ ↑ (a3 `β†’ b2)
Acc head_inst_nostep (↑ (a3 `β†’ b2),' PApp (p_of_w a3 w0))
a0, b: pre_ty
Ξ“: neg_ctx
t1: term Ξ“ Β¬ a0
c: Ξ“ βˆ‹ ↑ (a0 `Γ— b)
t: ty
o: pat t †
Ξ“0: neg_ctx
v: val_n Ξ“0 ↑ (a0 `Γ— b)
a: dom PFst =[ val_n ]> Ξ“0
i: Ξ“0 βˆ‹ projT1 (t,' o)
t0: is_var v -> T0
i0: evalβ‚’ (v βŠ™ PFst β¦— a ⦘) β‰Š ret_delay (i β‹… projT2 (t,' o))

Acc head_inst_nostep (t,' o)
a0, b: pre_ty
Ξ“: neg_ctx
t2: term Ξ“ Β¬ b
c: Ξ“ βˆ‹ ↑ (a0 `Γ— b)
t: ty
o: pat t †
Ξ“0: neg_ctx
v: val_n Ξ“0 ↑ (a0 `Γ— b)
a: dom PSnd =[ val_n ]> Ξ“0
i: Ξ“0 βˆ‹ projT1 (t,' o)
t0: is_var v -> T0
i0: evalβ‚’ (v βŠ™ PSnd β¦— a ⦘) β‰Š ret_delay (i β‹… projT2 (t,' o))
Acc head_inst_nostep (t,' o)
a3, b2: pre_ty
Ξ“: neg_ctx
w0: whn Ξ“ a3
t3: term Ξ“ Β¬ b2
c: Ξ“ βˆ‹ ↑ (a3 `β†’ b2)
t: ty
o: pat t †
Ξ“0: neg_ctx
v: val_n Ξ“0 ↑ (a3 `β†’ b2)
a: dom (PApp (p_of_w a3 w0)) =[ val_n ]> Ξ“0
i: Ξ“0 βˆ‹ projT1 (t,' o)
t0: is_var v -> T0
i0: evalβ‚’ (v βŠ™ PApp (p_of_w a3 w0) β¦— a ⦘) β‰Š ret_delay (i β‹… projT2 (t,' o))
Acc head_inst_nostep (t,' o)
A2, B2: pre_ty
Ξ“: neg_ctx
t1: term Ξ“ Β¬ A2
c: Ξ“ βˆ‹ ↑ (A2 `Γ— B2)
t: ty
o: pat t †
Ξ“0: neg_ctx
s: state (Ξ“0 β–Άβ‚“ Β¬ A2)
s0: state (Ξ“0 β–Άβ‚“ Β¬ B2)
a: dom PFst =[ val_n ]> Ξ“0
i: Ξ“0 βˆ‹ projT1 (t,' o)
t0: is_var (Pair s s0) -> T0
i0: evalβ‚’ (Pair s s0 βŠ™ PFst β¦— a ⦘) β‰Š ret_delay (i β‹… projT2 (t,' o))

Acc head_inst_nostep (t,' o)
A2, B2: pre_ty
Ξ“: neg_ctx
t2: term Ξ“ Β¬ B2
c: Ξ“ βˆ‹ ↑ (A2 `Γ— B2)
t: ty
o: pat t †
Ξ“0: neg_ctx
s: state (Ξ“0 β–Άβ‚“ Β¬ A2)
s0: state (Ξ“0 β–Άβ‚“ Β¬ B2)
a: dom PSnd =[ val_n ]> Ξ“0
i: Ξ“0 βˆ‹ projT1 (t,' o)
t0: is_var (Pair s s0) -> T0
i0: evalβ‚’ (Pair s s0 βŠ™ PSnd β¦— a ⦘) β‰Š ret_delay (i β‹… projT2 (t,' o))
Acc head_inst_nostep (t,' o)
A3, B3: pre_ty
Ξ“: neg_ctx
w0: whn Ξ“ A3
t3: term Ξ“ Β¬ B3
c: Ξ“ βˆ‹ ↑ (A3 `β†’ B3)
t: ty
o: pat t †
Ξ“0: neg_ctx
s1: state (Ξ“0 β–Άβ‚“ ↑ (A3 `β†’ B3) β–Άβ‚“ ↑ A3 β–Άβ‚“ Β¬ B3)
a: dom (PApp (p_of_w A3 w0)) =[ val_n ]> Ξ“0
i: Ξ“0 βˆ‹ projT1 (t,' o)
t0: is_var (Lam s1) -> T0
i0: evalβ‚’ (Lam s1 βŠ™ PApp (p_of_w A3 w0) β¦— a ⦘) β‰Š ret_delay (i β‹… projT2 (t,' o))
Acc head_inst_nostep (t,' o)
all: apply it_eq_step in i0; cbn in i0; now inversion i0. Qed. Definition subst_eq (Ξ” : neg_ctx) {Ξ“} : relation (state Ξ“) := fun u v => forall (Οƒ : Ξ“ =[val]> Ξ”), evalβ‚’ (u β‚œβŠ› Οƒ : state_n Ξ”) β‰ˆ evalβ‚’ (v β‚œβŠ› Οƒ : state_n Ξ”) . Notation "x β‰ˆβŸ¦sub Ξ” βŸ§β‰ˆ y" := (subst_eq Ξ” x y) (at level 50).
Ξ”, Ξ“: neg_ctx
x, y: state Ξ“

x β‰ˆβŸ¦ogs Ξ” βŸ§β‰ˆ y -> x β‰ˆβŸ¦sub Ξ” βŸ§β‰ˆ y
exact (ogs_correction _ x y). Qed. Definition c_of_t {Ξ“ : neg_ctx} {A} (t : term Ξ“ ↑A) : state_n (Ξ“ β–Άβ‚› {| sub_elt := Β¬A ; sub_prf := stt |}) := Cut (t_shift1 _ t) (VarR Ctx.top) . Notation "'name⁺'" := c_of_t. Definition a_of_sk {Ξ“ Ξ” : neg_ctx} {A} (s : Ξ“ =[val]> Ξ”) (k : term Ξ” Β¬A) : (Ξ“ β–Άβ‚› {| sub_elt := Β¬A ; sub_prf := stt |}) =[val_n]> Ξ” := [ s ,β‚“ k : val _ Β¬_ ].
Ξ“, Ξ”: neg_ctx
A: pre_ty
t: term Ξ“ ↑ A
s: Ξ“ =[ val ]> Ξ”
k: term Ξ” Β¬ A

Cut (t `β‚œβŠ› s) k = name⁺ t β‚œβŠ› a_of_sk s k
Ξ“, Ξ”: neg_ctx
A: pre_ty
t: term Ξ“ ↑ A
s: Ξ“ =[ val ]> Ξ”
k: term Ξ” Β¬ A

Cut (t `β‚œβŠ› s) k = name⁺ t β‚œβŠ› a_of_sk s k
cbn; f_equal; unfold t_shift1; rewrite t_sub_ren; now apply t_sub_eq. Qed. Definition ciu_eq (Ξ” : neg_ctx) {Ξ“ A} : relation (term Ξ“ ↑A) := fun u v => forall (Οƒ : Ξ“ =[val]> Ξ”) (k : term Ξ” Β¬A), evalβ‚’ (Cut (u `β‚œβŠ› Οƒ) k : state_n Ξ”) β‰ˆ evalβ‚’ (Cut (v `β‚œβŠ› Οƒ) k : state_n Ξ”) . Notation "x β‰ˆβŸ¦ciu Ξ” βŸ§βΊβ‰ˆ y" := (ciu_eq Ξ” x y) (at level 50).
Ξ”, Ξ“: neg_ctx
A: pre_ty
x, y: term Ξ“ ↑ A

name⁺ x β‰ˆβŸ¦ogs Ξ” βŸ§β‰ˆ name⁺ y -> x β‰ˆβŸ¦ciu Ξ” βŸ§βΊβ‰ˆ y
Ξ”, Ξ“: neg_ctx
A: pre_ty
x, y: term Ξ“ ↑ A
H: name⁺ x β‰ˆβŸ¦ogs Ξ” βŸ§β‰ˆ name⁺ y
Οƒ: Ξ“ =[ val ]> Ξ”
k: term Ξ” Β¬ A

evalβ‚’ (name⁺ x β‚œβŠ› a_of_sk Οƒ k) β‰ˆ evalβ‚’ (name⁺ y β‚œβŠ› a_of_sk Οƒ k)
now apply subst_correct. Qed.