Library f_typ

*Typing rules for PTSF.
Require Import f_term f_env.

Require Import base.

Require Import List.

Require Import Peano_dec.

Require Import Compare_dec.

Require Import Lt Le Gt Plus Minus.


Module f_typ_mod (X:term_sig) (Y:pts_sig X) (TM: f_term_mod X) (EM: f_env_mod X TM) .
Interactive Module f_typ_mod started


  Import X Y TM EM.


Typing judgements.
The equivalence of these rules with the alternative rules in the paper is proven at the bottom of this file.
Reserved Notation "Γ ⊢ t : T" (at level 80, t, T at level 30, no associativity) .

Reserved Notation "Γ ⊣ " (at level 80, no associativity).

Reserved Notation "Γ ⊢ H : M = N" (at level 80, H, M, N at level 30, no associativity).


Inductive wf : Env -> Prop :=
 | wf_nil : nil
 | wf_cons : forall Γ A s, Γ A : !s -> A::Γ
where "Γ ⊣" := (wf Γ) : F_scope
with typ : Env -> Term -> Term -> Prop :=
 | cSort : forall Γ s t, Ax s t -> Γ -> Γ !s : !t
 | cVar : forall Γ A v, Γ -> A v Γ -> Γ #v : A
 | cProd : forall Γ A B s1 s2 s3, Rel s1 s2 s3 -> Γ A : !s1 -> A::Γ B : !s2 -> Γ Π(A), B : !s3
 | cAbs : forall Γ A B b s1 s2 s3, Rel s1 s2 s3 -> Γ A : !s1 -> A::Γ b : B -> A::Γ B : !s2 -> Γ λ[A], b : Π(A), B
 | cApp : forall Γ F a A B , Γ F : Π(A), B -> Γ a : A -> Γ F · a : B[←a]
 | cConv : forall Γ a A B s H, Γ a : A -> Γ B : !s -> Γ H : A = B -> Γ a H : B
where "Γ ⊢ t : T" := (typ Γ t T) : F_scope
with typ_h : Env -> Prf -> Term -> Term -> Prop :=
 | cRefl : forall Γ a A, Γ a : A -> Γ ρ a : a = a
 | cSym : forall Γ H A B, Γ H : A = B -> Γ H : B = A
 | cTrans : forall Γ H K A B C, Γ H : A = B -> Γ K : B = C -> Γ HK : A = C
 | cBeta : forall Γ a A b B s1 s2 s3, Rel s1 s2 s3 -> Γ a : A -> Γ A : !s1
                      -> A::Γ b : B -> A::Γ B : !s2 -> Γ β((λ[A], ba) : (λ[A], ba = b[←a]
 | cProdEq : forall Γ A A' B B' H K s1 s2 s3 s1' s2' s3', Rel s1 s2 s3 -> Rel s1' s2' s3'
                      -> Γ A : !s1 -> Γ A' : !s1' -> A::Γ B : !s2 -> A'::Γ B' : !s2'
                      -> Γ H : A = A' -> A::Γ K : B = (B'1#1)[←#0Hh1] -> Γ {H,[A]K} : Π(A), B = Π(A'), B'
 | cAbsEq : forall Γ A A' b b' B B' H K s1 s2 s3 s1' s2' s3', Rel s1 s2 s3 -> Rel s1' s2' s3'
                      -> Γ A : !s1 -> Γ A' : !s1' -> A::Γ b : B -> A'::Γ b' : B' -> A::Γ B : !s2 -> A'::Γ B' : !s2'
                      -> Γ H : A = A' -> A::Γ K : b = (b'1#1)[←#0Hh1] -> Γ H,[A]K : λ[A], b = λ[A'], b'
 | cAppEq : forall Γ F F' a a' A A' B B' H K, Γ F : Π(A), B -> Γ F' : Π(A'), B' -> Γ a : A -> Γ a' : A'
                      -> Γ H : F = F' -> Γ K : a = a' -> Γ H ·h K : F · a = F' · a'
 | cIota : forall Γ a A B s H, Γ a : A -> Γ B : !s -> Γ H : A = B -> Γ ι(aH) : a = aH
where "Γ ⊢ H : A = B" := (typ_h Γ H A B) : F_scope.
wf, typ, typ_h are defined
wf_ind is defined
typ_ind is defined
typ_h_ind is defined



Hint Constructors wf typ typ_h.
Warning: the hint: eapply wf_cons will only be used by eauto
Warning: the hint: eapply cProd will only be used by eauto
Warning: the hint: eapply cAbs will only be used by eauto
Warning: the hint: eapply cApp will only be used by eauto
Warning: the hint: eapply cConv will only be used by eauto
Warning: the hint: eapply cRefl will only be used by eauto
Warning: the hint: eapply cTrans will only be used by eauto
Warning: the hint: eapply cBeta will only be used by eauto
Warning: the hint: eapply cProdEq will only be used by eauto
Warning: the hint: eapply cAbsEq will only be used by eauto
Warning: the hint: eapply cAppEq will only be used by eauto
Warning: the hint: eapply cIota will only be used by eauto



Open Scope F_scope.


Scheme typ_ind' := Induction for typ Sort Prop
 with wf_ind' := Induction for wf Sort Prop
 with typh_ind' := Induction for typ_h Sort Prop.
typh_ind' is defined
wf_ind' is defined
typ_ind' is defined
typ_ind', wf_ind', typh_ind' are recursively defined



Combined Scheme typ_induc from typ_ind', typh_ind',wf_ind'.
typ_induc is defined
typ_induc is recursively defined



some simple rewrite rules, if the statement P is an conjunction
Ltac rewrite_l P := rewrite ((and_ind (fun A _ => A)) P).
rewrite_l is defined


Ltac rewrite_r P := rewrite ((and_ind (fun _ A => A)) P).
rewrite_r is defined


Ltac rewrite_l_rev P := rewrite <- ((and_ind (fun A _ => A)) P).
rewrite_l_rev is defined


Ltac rewrite_r_rev P := rewrite <- ((and_ind (fun _ A => A)) P).
rewrite_r_rev is defined



Definition semitype A Γ := (exists s,A=!s)\/(exists s, Γ A : !s).
semitype is defined


Definition has_type A Γ := (exists B, Γ A : B).
has_type is defined


Definition is_type A Γ := (exists B, Γ B : A).
is_type is defined


Definition typ_h_short Γ A B := (exists H, Γ H : A = B).
typ_h_short is defined


Notation "Γ ⊢ M = N" := (typ_h_short Γ M N) (at level 80, M, N at level 30, no associativity).

Notation "Γ ⊢ A : B : C" := (Γ A : B/\Γ B : C) (at level 80, A, B, C at level 30, no associativity).


Basic properties of PTS. Context Validity: if a judgment is valid, its context is well-formed.
Lemma wf_typ : forall Γ t T, Γ t : T -> Γ .
1 subgoals, subgoal 1 (ID 157)
  
  ============================
   forall (Γ : Env) (t T : Term), Γ ⊢ t : T -> Γ ⊣

(dependent evars:)


induction 1; eauto.
No more subgoals.
(dependent evars:)


Qed.
wf_typ is defined



Hint Resolve wf_typ.
Warning: the hint: eapply wf_typ will only be used by eauto



Inversion Lemmas , one for each kind of term from a typing derivation of some particular term, we can infer informations about its type and subterms.

Lemma gen_sort : forall Γ s T, Γ !s : T -> exists t, T = !t /\ Ax s t.
1 subgoals, subgoal 1 (ID 263)
  
  ============================
   forall (Γ : Env) (s : Sorts) (T : Term),
   Γ ⊢ !s : T -> exists t : Sorts, T = !t /\ Ax s t

(dependent evars:)


inversion 1;subst;repeat eassumption||econstructor.
No more subgoals.
(dependent evars: ?457 using ,)


Qed.
gen_sort is defined



Lemma gen_var : forall Γ x A, Γ #x : A -> exists A', A = A' /\ A' x Γ .
1 subgoals, subgoal 1 (ID 473)
  
  ============================
   forall (Γ : Env) (x : Vars) (A : Term),
   Γ ⊢ #x : A -> exists A' : Term, A = A' /\ A' ↓ x ⊂ Γ

(dependent evars:)


inversion 1;subst;repeat eassumption||econstructor.
No more subgoals.
(dependent evars: ?664 using ,)


Qed.
gen_var is defined



Lemma gen_pi : forall Γ A B T, Γ Π(A),B : T -> exists s1 s2 s3,
    T = !s3 /\ Rel s1 s2 s3 /\ Γ A : !s1 /\ A::Γ B : !s2 .
1 subgoals, subgoal 1 (ID 684)
  
  ============================
   forall (Γ : Env) (A B T : Term),
   Γ ⊢ Π (A), B : T ->
   exists s1 s2 s3 : Sorts,
     T = !s3 /\ Rel s1 s2 s3 /\ (Γ ⊢ A : !s1) /\ A :: Γ ⊢ B : !s2

(dependent evars:)


inversion 1;subst;repeat eassumption||econstructor.
No more subgoals.
(dependent evars: ?891 using , ?894 using , ?897 using ,)


Qed.
gen_pi is defined



Lemma gen_la : forall Γ A M T, Γ λ[A],M : T -> exists s1 s2 s3 B,
T = Π(A), B /\ Rel s1 s2 s3 /\ Γ A : !s1 /\ A::Γ M : B /\ A::Γ B : !s2.
1 subgoals, subgoal 1 (ID 926)
  
  ============================
   forall (Γ : Env) (A M T : Term),
   Γ ⊢ λ [A], M : T ->
   exists (s1 s2 s3 : Sorts) (B : Term),
     T = Π (A), B /\ Rel s1 s2 s3 /\ (Γ ⊢ A : !s1) /\ A :: Γ ⊢ M : B : !s2

(dependent evars:)


inversion 1;subst;repeat eassumption||econstructor.
No more subgoals.
(dependent evars: ?1135 using , ?1138 using , ?1141 using , ?1144 using ,)


Qed.
gen_la is defined



Lemma gen_app : forall Γ M N T, Γ M · N : T -> exists A B, T = B[← N] /\ Γ M : Π(A),B /\ Γ N : A.
1 subgoals, subgoal 1 (ID 1172)
  
  ============================
   forall (Γ : Env) (M N T : Term),
   Γ ⊢ M · N : T ->
   exists A B : Term, T = B [ ← N] /\ (Γ ⊢ M : Π (A), B) /\ Γ ⊢ N : A

(dependent evars:)


inversion 1;subst;repeat eassumption||econstructor.
No more subgoals.
(dependent evars: ?1377 using , ?1380 using ,)


Qed.
gen_app is defined



Lemma gen_conv : forall Γ a H T, Γ a H : T -> exists A s, Γ a : A /\ Γ T:!s /\ Γ H : A = T.
1 subgoals, subgoal 1 (ID 1401)
  
  ============================
   forall (Γ : Env) (a : Term) (H : Prf) (T : Term),
   Γ ⊢ a ∽ H : T ->
   exists (A : Term) (s : Sorts),
     (Γ ⊢ a : A) /\ (Γ ⊢ T : !s) /\ Γ ⊢ H : A = T

(dependent evars:)


inversion 1;subst;repeat eassumption||econstructor.
No more subgoals.
(dependent evars: ?1605 using , ?1608 using ,)


Qed.
gen_conv is defined



Weakening Property: if a judgement is valid, we can insert a well-typed term in the context, it will remain valid. This is where the type checking for inserting items in a context is done.

Theorem weakening:
(forall Γ M N, Γ M : N -> forall Δ A s n Γ', ins_in_env Δ A n Γ Γ' -> Δ A : !s -> Γ' M 1 # n : N 1 # n ) /\
(forall Γ H M N, Γ H : M = N -> forall Δ A s n Γ', ins_in_env Δ A n Γ Γ' -> Δ A : !s -> Γ' H h 1 # n : M 1 # n = N 1 # n ) /\
(forall Γ , Γ -> forall Δ A s n Γ', ins_in_env Δ A n Γ Γ' -> Δ A : !s -> Γ' ).
1 subgoals, subgoal 1 (ID 1645)
  
  ============================
   (forall (Γ : Env) (M N : Term),
    Γ ⊢ M : N ->
    forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
    ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊢ M ↑  1 # n : N ↑  1 # n) /\
   (forall (Γ : Env) (H : Prf) (M N : Term),
    Γ ⊢ H : M = N ->
    forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
    ins_in_env Δ A n Γ Γ' ->
    Δ ⊢ A : !s -> Γ' ⊢ H ↑h 1 # n : M ↑  1 # n = N ↑  1 # n) /\
   (forall Γ : Env,
    Γ ⊣ ->
    forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
    ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊣)

(dependent evars:)


apply typ_induc; simpl in *; intros;eauto.
9 subgoals, subgoal 1 (ID 1703)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
      ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊣
  i : A ↓ v ⊂ Γ
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H0 : ins_in_env Δ A0 n Γ Γ'
  H1 : Δ ⊢ A0 : !s
  ============================
   Γ' ⊢ (if le_gt_dec n v then #(S v) else #v) : A ↑  1 # n

subgoal 2 (ID 1742) is:
 Γ' ⊢ λ [A ↑  1 # n], b ↑  1 # (S n) : Π (A ↑  1 # n), B ↑  1 # (S n)
subgoal 3 (ID 1758) is:
 Γ' ⊢ F ↑  1 # n · a ↑  1 # n : B [ ← a] ↑  1 # n
subgoal 4 (ID 1784) is:
 Γ' ⊣
subgoal 5 (ID 1796) is:
 Γ' ⊣
subgoal 6 (ID 1862) is:
 Γ' ⊢ β((λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n)
 : (λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n = 
 b [ ← a] ↑  1 # n
subgoal 7 (ID 1896) is:
 Γ' ⊢ {H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n)}
 : Π (A ↑  1 # n), B ↑  1 # (S n) = Π (A' ↑  1 # n), B' ↑  1 # (S n)
subgoal 8 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 9 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using ,)


destruct (le_gt_dec n v).
10 subgoals, subgoal 1 (ID 4014)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
      ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊣
  i : A ↓ v ⊂ Γ
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H0 : ins_in_env Δ A0 n Γ Γ'
  H1 : Δ ⊢ A0 : !s
  l : n <= v
  ============================
   Γ' ⊢ #(S v) : A ↑  1 # n

subgoal 2 (ID 4015) is:
 Γ' ⊢ #v : A ↑  1 # n
subgoal 3 (ID 1742) is:
 Γ' ⊢ λ [A ↑  1 # n], b ↑  1 # (S n) : Π (A ↑  1 # n), B ↑  1 # (S n)
subgoal 4 (ID 1758) is:
 Γ' ⊢ F ↑  1 # n · a ↑  1 # n : B [ ← a] ↑  1 # n
subgoal 5 (ID 1784) is:
 Γ' ⊣
subgoal 6 (ID 1796) is:
 Γ' ⊣
subgoal 7 (ID 1862) is:
 Γ' ⊢ β((λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n)
 : (λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n = 
 b [ ← a] ↑  1 # n
subgoal 8 (ID 1896) is:
 Γ' ⊢ {H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n)}
 : Π (A ↑  1 # n), B ↑  1 # (S n) = Π (A' ↑  1 # n), B' ↑  1 # (S n)
subgoal 9 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 10 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using ,)


constructor.
11 subgoals, subgoal 1 (ID 4018)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
      ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊣
  i : A ↓ v ⊂ Γ
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H0 : ins_in_env Δ A0 n Γ Γ'
  H1 : Δ ⊢ A0 : !s
  l : n <= v
  ============================
   Γ' ⊣

subgoal 2 (ID 4019) is:
 A ↑  1 # n ↓ S v ⊂ Γ'
subgoal 3 (ID 4015) is:
 Γ' ⊢ #v : A ↑  1 # n
subgoal 4 (ID 1742) is:
 Γ' ⊢ λ [A ↑  1 # n], b ↑  1 # (S n) : Π (A ↑  1 # n), B ↑  1 # (S n)
subgoal 5 (ID 1758) is:
 Γ' ⊢ F ↑  1 # n · a ↑  1 # n : B [ ← a] ↑  1 # n
subgoal 6 (ID 1784) is:
 Γ' ⊣
subgoal 7 (ID 1796) is:
 Γ' ⊣
subgoal 8 (ID 1862) is:
 Γ' ⊢ β((λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n)
 : (λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n = 
 b [ ← a] ↑  1 # n
subgoal 9 (ID 1896) is:
 Γ' ⊢ {H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n)}
 : Π (A ↑  1 # n), B ↑  1 # (S n) = Π (A' ↑  1 # n), B' ↑  1 # (S n)
subgoal 10 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 11 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using ,)

eapply H; eauto.
10 subgoals, subgoal 1 (ID 4019)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
      ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊣
  i : A ↓ v ⊂ Γ
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H0 : ins_in_env Δ A0 n Γ Γ'
  H1 : Δ ⊢ A0 : !s
  l : n <= v
  ============================
   A ↑  1 # n ↓ S v ⊂ Γ'

subgoal 2 (ID 4015) is:
 Γ' ⊢ #v : A ↑  1 # n
subgoal 3 (ID 1742) is:
 Γ' ⊢ λ [A ↑  1 # n], b ↑  1 # (S n) : Π (A ↑  1 # n), B ↑  1 # (S n)
subgoal 4 (ID 1758) is:
 Γ' ⊢ F ↑  1 # n · a ↑  1 # n : B [ ← a] ↑  1 # n
subgoal 5 (ID 1784) is:
 Γ' ⊣
subgoal 6 (ID 1796) is:
 Γ' ⊣
subgoal 7 (ID 1862) is:
 Γ' ⊢ β((λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n)
 : (λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n = 
 b [ ← a] ↑  1 # n
subgoal 8 (ID 1896) is:
 Γ' ⊢ {H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n)}
 : Π (A ↑  1 # n), B ↑  1 # (S n) = Π (A' ↑  1 # n), B' ↑  1 # (S n)
subgoal 9 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 10 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using ,)

destruct i as (AA & ?& ?).
10 subgoals, subgoal 1 (ID 4036)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
      ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊣
  AA : Term
  H2 : A = AA ↑  (S v)
  H3 : AA ↓ v ∈ Γ
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H0 : ins_in_env Δ A0 n Γ Γ'
  H1 : Δ ⊢ A0 : !s
  l : n <= v
  ============================
   A ↑  1 # n ↓ S v ⊂ Γ'

subgoal 2 (ID 4015) is:
 Γ' ⊢ #v : A ↑  1 # n
subgoal 3 (ID 1742) is:
 Γ' ⊢ λ [A ↑  1 # n], b ↑  1 # (S n) : Π (A ↑  1 # n), B ↑  1 # (S n)
subgoal 4 (ID 1758) is:
 Γ' ⊢ F ↑  1 # n · a ↑  1 # n : B [ ← a] ↑  1 # n
subgoal 5 (ID 1784) is:
 Γ' ⊣
subgoal 6 (ID 1796) is:
 Γ' ⊣
subgoal 7 (ID 1862) is:
 Γ' ⊢ β((λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n)
 : (λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n = 
 b [ ← a] ↑  1 # n
subgoal 8 (ID 1896) is:
 Γ' ⊢ {H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n)}
 : Π (A ↑  1 # n), B ↑  1 # (S n) = Π (A' ↑  1 # n), B' ↑  1 # (S n)
subgoal 9 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 10 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using ,)

exists AA; split.
11 subgoals, subgoal 1 (ID 4040)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
      ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊣
  AA : Term
  H2 : A = AA ↑  (S v)
  H3 : AA ↓ v ∈ Γ
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H0 : ins_in_env Δ A0 n Γ Γ'
  H1 : Δ ⊢ A0 : !s
  l : n <= v
  ============================
   A ↑  1 # n = AA ↑  (S (S v))

subgoal 2 (ID 4041) is:
 AA ↓ S v ∈ Γ'
subgoal 3 (ID 4015) is:
 Γ' ⊢ #v : A ↑  1 # n
subgoal 4 (ID 1742) is:
 Γ' ⊢ λ [A ↑  1 # n], b ↑  1 # (S n) : Π (A ↑  1 # n), B ↑  1 # (S n)
subgoal 5 (ID 1758) is:
 Γ' ⊢ F ↑  1 # n · a ↑  1 # n : B [ ← a] ↑  1 # n
subgoal 6 (ID 1784) is:
 Γ' ⊣
subgoal 7 (ID 1796) is:
 Γ' ⊣
subgoal 8 (ID 1862) is:
 Γ' ⊢ β((λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n)
 : (λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n = 
 b [ ← a] ↑  1 # n
subgoal 9 (ID 1896) is:
 Γ' ⊢ {H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n)}
 : Π (A ↑  1 # n), B ↑  1 # (S n) = Π (A' ↑  1 # n), B' ↑  1 # (S n)
subgoal 10 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 11 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using ,)


rewrite H2; change (S (S v)) with (1+ S v); rewrite_l liftP3; simpl; intuition.
10 subgoals, subgoal 1 (ID 4041)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
      ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊣
  AA : Term
  H2 : A = AA ↑  (S v)
  H3 : AA ↓ v ∈ Γ
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H0 : ins_in_env Δ A0 n Γ Γ'
  H1 : Δ ⊢ A0 : !s
  l : n <= v
  ============================
   AA ↓ S v ∈ Γ'

subgoal 2 (ID 4015) is:
 Γ' ⊢ #v : A ↑  1 # n
subgoal 3 (ID 1742) is:
 Γ' ⊢ λ [A ↑  1 # n], b ↑  1 # (S n) : Π (A ↑  1 # n), B ↑  1 # (S n)
subgoal 4 (ID 1758) is:
 Γ' ⊢ F ↑  1 # n · a ↑  1 # n : B [ ← a] ↑  1 # n
subgoal 5 (ID 1784) is:
 Γ' ⊣
subgoal 6 (ID 1796) is:
 Γ' ⊣
subgoal 7 (ID 1862) is:
 Γ' ⊢ β((λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n)
 : (λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n = 
 b [ ← a] ↑  1 # n
subgoal 8 (ID 1896) is:
 Γ' ⊢ {H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n)}
 : Π (A ↑  1 # n), B ↑  1 # (S n) = Π (A' ↑  1 # n), B' ↑  1 # (S n)
subgoal 9 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 10 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using ,)

eapply ins_item_ge;eauto.
9 subgoals, subgoal 1 (ID 4015)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
      ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊣
  i : A ↓ v ⊂ Γ
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H0 : ins_in_env Δ A0 n Γ Γ'
  H1 : Δ ⊢ A0 : !s
  g : n > v
  ============================
   Γ' ⊢ #v : A ↑  1 # n

subgoal 2 (ID 1742) is:
 Γ' ⊢ λ [A ↑  1 # n], b ↑  1 # (S n) : Π (A ↑  1 # n), B ↑  1 # (S n)
subgoal 3 (ID 1758) is:
 Γ' ⊢ F ↑  1 # n · a ↑  1 # n : B [ ← a] ↑  1 # n
subgoal 4 (ID 1784) is:
 Γ' ⊣
subgoal 5 (ID 1796) is:
 Γ' ⊣
subgoal 6 (ID 1862) is:
 Γ' ⊢ β((λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n)
 : (λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n = 
 b [ ← a] ↑  1 # n
subgoal 7 (ID 1896) is:
 Γ' ⊢ {H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n)}
 : Π (A ↑  1 # n), B ↑  1 # (S n) = Π (A' ↑  1 # n), B' ↑  1 # (S n)
subgoal 8 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 9 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using ,)


constructor.
10 subgoals, subgoal 1 (ID 4104)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
      ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊣
  i : A ↓ v ⊂ Γ
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H0 : ins_in_env Δ A0 n Γ Γ'
  H1 : Δ ⊢ A0 : !s
  g : n > v
  ============================
   Γ' ⊣

subgoal 2 (ID 4105) is:
 A ↑  1 # n ↓ v ⊂ Γ'
subgoal 3 (ID 1742) is:
 Γ' ⊢ λ [A ↑  1 # n], b ↑  1 # (S n) : Π (A ↑  1 # n), B ↑  1 # (S n)
subgoal 4 (ID 1758) is:
 Γ' ⊢ F ↑  1 # n · a ↑  1 # n : B [ ← a] ↑  1 # n
subgoal 5 (ID 1784) is:
 Γ' ⊣
subgoal 6 (ID 1796) is:
 Γ' ⊣
subgoal 7 (ID 1862) is:
 Γ' ⊢ β((λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n)
 : (λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n = 
 b [ ← a] ↑  1 # n
subgoal 8 (ID 1896) is:
 Γ' ⊢ {H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n)}
 : Π (A ↑  1 # n), B ↑  1 # (S n) = Π (A' ↑  1 # n), B' ↑  1 # (S n)
subgoal 9 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 10 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using ,)

eapply H; eauto.
9 subgoals, subgoal 1 (ID 4105)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
      ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊣
  i : A ↓ v ⊂ Γ
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H0 : ins_in_env Δ A0 n Γ Γ'
  H1 : Δ ⊢ A0 : !s
  g : n > v
  ============================
   A ↑  1 # n ↓ v ⊂ Γ'

subgoal 2 (ID 1742) is:
 Γ' ⊢ λ [A ↑  1 # n], b ↑  1 # (S n) : Π (A ↑  1 # n), B ↑  1 # (S n)
subgoal 3 (ID 1758) is:
 Γ' ⊢ F ↑  1 # n · a ↑  1 # n : B [ ← a] ↑  1 # n
subgoal 4 (ID 1784) is:
 Γ' ⊣
subgoal 5 (ID 1796) is:
 Γ' ⊣
subgoal 6 (ID 1862) is:
 Γ' ⊢ β((λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n)
 : (λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n = 
 b [ ← a] ↑  1 # n
subgoal 7 (ID 1896) is:
 Γ' ⊢ {H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n)}
 : Π (A ↑  1 # n), B ↑  1 # (S n) = Π (A' ↑  1 # n), B' ↑  1 # (S n)
subgoal 8 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 9 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using ,)

eapply ins_item_lift_lt;eauto.
8 subgoals, subgoal 1 (ID 1742)
  
  Γ : Env
  A : Term
  B : Term
  b : Term
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  r : Rel s1 s2 s3
  t : Γ ⊢ A : !s1
  H : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
      ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ A ↑  1 # n : !s1
  t0 : A :: Γ ⊢ b : B
  H0 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ b ↑  1 # n : B ↑  1 # n
  t1 : A :: Γ ⊢ B : !s2
  H1 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ B ↑  1 # n : !s2
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H2 : ins_in_env Δ A0 n Γ Γ'
  H3 : Δ ⊢ A0 : !s
  ============================
   Γ' ⊢ λ [A ↑  1 # n], b ↑  1 # (S n) : Π (A ↑  1 # n), B ↑  1 # (S n)

subgoal 2 (ID 1758) is:
 Γ' ⊢ F ↑  1 # n · a ↑  1 # n : B [ ← a] ↑  1 # n
subgoal 3 (ID 1784) is:
 Γ' ⊣
subgoal 4 (ID 1796) is:
 Γ' ⊣
subgoal 5 (ID 1862) is:
 Γ' ⊢ β((λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n)
 : (λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n = 
 b [ ← a] ↑  1 # n
subgoal 6 (ID 1896) is:
 Γ' ⊢ {H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n)}
 : Π (A ↑  1 # n), B ↑  1 # (S n) = Π (A' ↑  1 # n), B' ↑  1 # (S n)
subgoal 7 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 8 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using ,)


econstructor; eauto.
7 subgoals, subgoal 1 (ID 1758)
  
  Γ : Env
  F : Term
  a : Term
  A : Term
  B : Term
  t : Γ ⊢ F : Π (A), B
  H : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
      ins_in_env Δ A0 n Γ Γ' ->
      Δ ⊢ A0 : !s -> Γ' ⊢ F ↑  1 # n : Π (A ↑  1 # n), B ↑  1 # (S n)
  t0 : Γ ⊢ a : A
  H0 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ a ↑  1 # n : A ↑  1 # n
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H1 : ins_in_env Δ A0 n Γ Γ'
  H2 : Δ ⊢ A0 : !s
  ============================
   Γ' ⊢ F ↑  1 # n · a ↑  1 # n : B [ ← a] ↑  1 # n

subgoal 2 (ID 1784) is:
 Γ' ⊣
subgoal 3 (ID 1796) is:
 Γ' ⊣
subgoal 4 (ID 1862) is:
 Γ' ⊢ β((λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n)
 : (λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n = 
 b [ ← a] ↑  1 # n
subgoal 5 (ID 1896) is:
 Γ' ⊢ {H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n)}
 : Π (A ↑  1 # n), B ↑  1 # (S n) = Π (A' ↑  1 # n), B' ↑  1 # (S n)
subgoal 6 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 7 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using , ?4124 using , ?4125 using , ?4126 using , ?4131 using , ?4132 using , ?4133 using , ?4136 using , ?4137 using , ?4138 using , ?4142 using , ?4143 using , ?4144 using ,)


change n with (0+n); rewrite_l substP1; simpl.
7 subgoals, subgoal 1 (ID 4154)
  
  Γ : Env
  F : Term
  a : Term
  A : Term
  B : Term
  t : Γ ⊢ F : Π (A), B
  H : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
      ins_in_env Δ A0 n Γ Γ' ->
      Δ ⊢ A0 : !s -> Γ' ⊢ F ↑  1 # n : Π (A ↑  1 # n), B ↑  1 # (S n)
  t0 : Γ ⊢ a : A
  H0 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ a ↑  1 # n : A ↑  1 # n
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H1 : ins_in_env Δ A0 n Γ Γ'
  H2 : Δ ⊢ A0 : !s
  ============================
   Γ' ⊢ F ↑  1 # n · a ↑  1 # n : (B ↑  1 # (S n)) [ ← a ↑  1 # n]

subgoal 2 (ID 1784) is:
 Γ' ⊣
subgoal 3 (ID 1796) is:
 Γ' ⊣
subgoal 4 (ID 1862) is:
 Γ' ⊢ β((λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n)
 : (λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n = 
 b [ ← a] ↑  1 # n
subgoal 5 (ID 1896) is:
 Γ' ⊢ {H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n)}
 : Π (A ↑  1 # n), B ↑  1 # (S n) = Π (A' ↑  1 # n), B' ↑  1 # (S n)
subgoal 6 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 7 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using , ?4124 using , ?4125 using , ?4126 using , ?4131 using , ?4132 using , ?4133 using , ?4136 using , ?4137 using , ?4138 using , ?4142 using , ?4143 using , ?4144 using ,)


econstructor; eauto.
6 subgoals, subgoal 1 (ID 1784)
  
  Δ : Env
  A : Term
  s : Sorts
  n : nat
  Γ' : Env
  H : ins_in_env Δ A n nil Γ'
  H0 : Δ ⊢ A : !s
  ============================
   Γ' ⊣

subgoal 2 (ID 1796) is:
 Γ' ⊣
subgoal 3 (ID 1862) is:
 Γ' ⊢ β((λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n)
 : (λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n = 
 b [ ← a] ↑  1 # n
subgoal 4 (ID 1896) is:
 Γ' ⊢ {H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n)}
 : Π (A ↑  1 # n), B ↑  1 # (S n) = Π (A' ↑  1 # n), B' ↑  1 # (S n)
subgoal 5 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 6 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using , ?4124 using , ?4125 using , ?4126 using , ?4131 using , ?4132 using , ?4133 using , ?4136 using , ?4137 using , ?4138 using , ?4142 using , ?4143 using , ?4144 using , ?4160 using , ?4163 using , ?4164 using , ?4165 using , ?4168 using , ?4169 using , ?4170 using ,)


inversion H; subst;eauto.
5 subgoals, subgoal 1 (ID 1796)
  
  Γ : Env
  A : Term
  s : Sorts
  t : Γ ⊢ A : !s
  H : forall (Δ : Env) (A0 : Term) (s0 : Sorts) (n : nat) (Γ' : Env),
      ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s0 -> Γ' ⊢ A ↑  1 # n : !s
  Δ : Env
  A0 : Term
  s0 : Sorts
  n : nat
  Γ' : Env
  H0 : ins_in_env Δ A0 n (A :: Γ) Γ'
  H1 : Δ ⊢ A0 : !s0
  ============================
   Γ' ⊣

subgoal 2 (ID 1862) is:
 Γ' ⊢ β((λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n)
 : (λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n = 
 b [ ← a] ↑  1 # n
subgoal 3 (ID 1896) is:
 Γ' ⊢ {H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n)}
 : Π (A ↑  1 # n), B ↑  1 # (S n) = Π (A' ↑  1 # n), B' ↑  1 # (S n)
subgoal 4 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 5 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using , ?4124 using , ?4125 using , ?4126 using , ?4131 using , ?4132 using , ?4133 using , ?4136 using , ?4137 using , ?4138 using , ?4142 using , ?4143 using , ?4144 using , ?4160 using , ?4163 using , ?4164 using , ?4165 using , ?4168 using , ?4169 using , ?4170 using , ?4233 using ,)


inversion H0; subst;eauto.
4 subgoals, subgoal 1 (ID 1862)
  
  Γ : Env
  a : Term
  A : Term
  b : Term
  B : Term
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  r : Rel s1 s2 s3
  t : Γ ⊢ a : A
  H : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
      ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ a ↑  1 # n : A ↑  1 # n
  t0 : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ A ↑  1 # n : !s1
  t1 : A :: Γ ⊢ b : B
  H1 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ b ↑  1 # n : B ↑  1 # n
  t2 : A :: Γ ⊢ B : !s2
  H2 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ B ↑  1 # n : !s2
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H3 : ins_in_env Δ A0 n Γ Γ'
  H4 : Δ ⊢ A0 : !s
  ============================
   Γ' ⊢ β((λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n)
   : (λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n = 
   b [ ← a] ↑  1 # n

subgoal 2 (ID 1896) is:
 Γ' ⊢ {H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n)}
 : Π (A ↑  1 # n), B ↑  1 # (S n) = Π (A' ↑  1 # n), B' ↑  1 # (S n)
subgoal 3 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 4 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using , ?4124 using , ?4125 using , ?4126 using , ?4131 using , ?4132 using , ?4133 using , ?4136 using , ?4137 using , ?4138 using , ?4142 using , ?4143 using , ?4144 using , ?4160 using , ?4163 using , ?4164 using , ?4165 using , ?4168 using , ?4169 using , ?4170 using , ?4233 using , ?4330 using , ?4335 using , ?4340 using , ?4341 using , ?4342 using ,)


change n with (0+n); rewrite_l substP1; simpl.
4 subgoals, subgoal 1 (ID 4351)
  
  Γ : Env
  a : Term
  A : Term
  b : Term
  B : Term
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  r : Rel s1 s2 s3
  t : Γ ⊢ a : A
  H : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
      ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ a ↑  1 # n : A ↑  1 # n
  t0 : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ A ↑  1 # n : !s1
  t1 : A :: Γ ⊢ b : B
  H1 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ b ↑  1 # n : B ↑  1 # n
  t2 : A :: Γ ⊢ B : !s2
  H2 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ B ↑  1 # n : !s2
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H3 : ins_in_env Δ A0 n Γ Γ'
  H4 : Δ ⊢ A0 : !s
  ============================
   Γ' ⊢ β((λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n)
   : (λ [A ↑  1 # n], b ↑  1 # (S n)) · a ↑  1 # n =
   (b ↑  1 # (S n)) [ ← a ↑  1 # n]

subgoal 2 (ID 1896) is:
 Γ' ⊢ {H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n)}
 : Π (A ↑  1 # n), B ↑  1 # (S n) = Π (A' ↑  1 # n), B' ↑  1 # (S n)
subgoal 3 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 4 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using , ?4124 using , ?4125 using , ?4126 using , ?4131 using , ?4132 using , ?4133 using , ?4136 using , ?4137 using , ?4138 using , ?4142 using , ?4143 using , ?4144 using , ?4160 using , ?4163 using , ?4164 using , ?4165 using , ?4168 using , ?4169 using , ?4170 using , ?4233 using , ?4330 using , ?4335 using , ?4340 using , ?4341 using , ?4342 using ,)


econstructor;eauto.
3 subgoals, subgoal 1 (ID 1896)
  
  Γ : Env
  A : Term
  A' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ A ↑  1 # n : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊢ A' ↑  1 # n : !s1'
  t1 : A :: Γ ⊢ B : !s2
  H2 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ B ↑  1 # n : !s2
  t2 : A' :: Γ ⊢ B' : !s2'
  H3 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n (A' :: Γ) Γ' -> Δ ⊢ A : !s -> Γ' ⊢ B' ↑  1 # n : !s2'
  t3 : Γ ⊢ H : A = A'
  H4 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ H ↑h 1 # n : A ↑  1 # n = A' ↑  1 # n
  t4 : A :: Γ ⊢ K : B = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H5 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s ->
       Γ' ⊢ K ↑h 1 # n : B ↑  1 # n = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] ↑  1 # n
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H6 : ins_in_env Δ A0 n Γ Γ'
  H7 : Δ ⊢ A0 : !s
  ============================
   Γ' ⊢ {H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n)}
   : Π (A ↑  1 # n), B ↑  1 # (S n) = Π (A' ↑  1 # n), B' ↑  1 # (S n)

subgoal 2 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 3 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using , ?4124 using , ?4125 using , ?4126 using , ?4131 using , ?4132 using , ?4133 using , ?4136 using , ?4137 using , ?4138 using , ?4142 using , ?4143 using , ?4144 using , ?4160 using , ?4163 using , ?4164 using , ?4165 using , ?4168 using , ?4169 using , ?4170 using , ?4233 using , ?4330 using , ?4335 using , ?4340 using , ?4341 using , ?4342 using , ?4356 using , ?4357 using , ?4358 using , ?4359 using , ?4365 using , ?4366 using , ?4367 using , ?4370 using , ?4371 using , ?4372 using , ?4375 using , ?4376 using , ?4377 using , ?4381 using , ?4382 using , ?4383 using ,)


econstructor; [eexact r|eexact r0|eauto..].
3 subgoals, subgoal 1 (ID 4405)
  
  Γ : Env
  A : Term
  A' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ A ↑  1 # n : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊢ A' ↑  1 # n : !s1'
  t1 : A :: Γ ⊢ B : !s2
  H2 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ B ↑  1 # n : !s2
  t2 : A' :: Γ ⊢ B' : !s2'
  H3 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n (A' :: Γ) Γ' -> Δ ⊢ A : !s -> Γ' ⊢ B' ↑  1 # n : !s2'
  t3 : Γ ⊢ H : A = A'
  H4 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ H ↑h 1 # n : A ↑  1 # n = A' ↑  1 # n
  t4 : A :: Γ ⊢ K : B = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H5 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s ->
       Γ' ⊢ K ↑h 1 # n : B ↑  1 # n = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] ↑  1 # n
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H6 : ins_in_env Δ A0 n Γ Γ'
  H7 : Δ ⊢ A0 : !s
  ============================
   A ↑  1 # n :: Γ' ⊢ K ↑h 1 # (S n) : B ↑  1 # (S n) =
   (B' ↑  1 # (S n) ↑  1 # 1) [ ← #0 ∽ H ↑h 1 # n ↑h 1]

subgoal 2 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 3 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using , ?4124 using , ?4125 using , ?4126 using , ?4131 using , ?4132 using , ?4133 using , ?4136 using , ?4137 using , ?4138 using , ?4142 using , ?4143 using , ?4144 using , ?4160 using , ?4163 using , ?4164 using , ?4165 using , ?4168 using , ?4169 using , ?4170 using , ?4233 using , ?4330 using , ?4335 using , ?4340 using , ?4341 using , ?4342 using , ?4356 using , ?4357 using , ?4358 using , ?4359 using , ?4365 using , ?4366 using , ?4367 using , ?4370 using , ?4371 using , ?4372 using , ?4375 using , ?4376 using , ?4377 using , ?4381 using , ?4382 using , ?4383 using , ?4392 using , ?4393 using , ?4394 using , ?4395 using , ?4396 using , ?4397 using , ?4406 using , ?4407 using , ?4408 using , ?4411 using , ?4412 using , ?4413 using , ?4416 using , ?4417 using , ?4418 using , ?4422 using , ?4423 using , ?4424 using , ?4428 using , ?4429 using , ?4430 using ,)


rewrite_l_rev liftP2;intuition.
3 subgoals, subgoal 1 (ID 4436)
  
  Γ : Env
  A : Term
  A' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ A ↑  1 # n : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊢ A' ↑  1 # n : !s1'
  t1 : A :: Γ ⊢ B : !s2
  H2 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ B ↑  1 # n : !s2
  t2 : A' :: Γ ⊢ B' : !s2'
  H3 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n (A' :: Γ) Γ' -> Δ ⊢ A : !s -> Γ' ⊢ B' ↑  1 # n : !s2'
  t3 : Γ ⊢ H : A = A'
  H4 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ H ↑h 1 # n : A ↑  1 # n = A' ↑  1 # n
  t4 : A :: Γ ⊢ K : B = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H5 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s ->
       Γ' ⊢ K ↑h 1 # n : B ↑  1 # n = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] ↑  1 # n
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H6 : ins_in_env Δ A0 n Γ Γ'
  H7 : Δ ⊢ A0 : !s
  ============================
   A ↑  1 # n :: Γ' ⊢ K ↑h 1 # (S n) : B ↑  1 # (S n) =
   (B' ↑  1 # 1 ↑  1 # (1 + S n)) [ ← #0 ∽ H ↑h 1 # n ↑h 1]

subgoal 2 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 3 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using , ?4124 using , ?4125 using , ?4126 using , ?4131 using , ?4132 using , ?4133 using , ?4136 using , ?4137 using , ?4138 using , ?4142 using , ?4143 using , ?4144 using , ?4160 using , ?4163 using , ?4164 using , ?4165 using , ?4168 using , ?4169 using , ?4170 using , ?4233 using , ?4330 using , ?4335 using , ?4340 using , ?4341 using , ?4342 using , ?4356 using , ?4357 using , ?4358 using , ?4359 using , ?4365 using , ?4366 using , ?4367 using , ?4370 using , ?4371 using , ?4372 using , ?4375 using , ?4376 using , ?4377 using , ?4381 using , ?4382 using , ?4383 using , ?4392 using , ?4393 using , ?4394 using , ?4395 using , ?4396 using , ?4397 using , ?4406 using , ?4407 using , ?4408 using , ?4411 using , ?4412 using , ?4413 using , ?4416 using , ?4417 using , ?4418 using , ?4422 using , ?4423 using , ?4424 using , ?4428 using , ?4429 using , ?4430 using ,)


rewrite_r_rev liftP2;intuition.
3 subgoals, subgoal 1 (ID 4512)
  
  Γ : Env
  A : Term
  A' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ A ↑  1 # n : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊢ A' ↑  1 # n : !s1'
  t1 : A :: Γ ⊢ B : !s2
  H2 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ B ↑  1 # n : !s2
  t2 : A' :: Γ ⊢ B' : !s2'
  H3 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n (A' :: Γ) Γ' -> Δ ⊢ A : !s -> Γ' ⊢ B' ↑  1 # n : !s2'
  t3 : Γ ⊢ H : A = A'
  H4 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ H ↑h 1 # n : A ↑  1 # n = A' ↑  1 # n
  t4 : A :: Γ ⊢ K : B = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H5 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s ->
       Γ' ⊢ K ↑h 1 # n : B ↑  1 # n = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] ↑  1 # n
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H6 : ins_in_env Δ A0 n Γ Γ'
  H7 : Δ ⊢ A0 : !s
  ============================
   A ↑  1 # n :: Γ' ⊢ K ↑h 1 # (S n) : B ↑  1 # (S n) =
   (B' ↑  1 # 1 ↑  1 # (1 + S n)) [ ← #0 ∽ H ↑h 1 ↑h 1 # (1 + n)]

subgoal 2 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 3 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using , ?4124 using , ?4125 using , ?4126 using , ?4131 using , ?4132 using , ?4133 using , ?4136 using , ?4137 using , ?4138 using , ?4142 using , ?4143 using , ?4144 using , ?4160 using , ?4163 using , ?4164 using , ?4165 using , ?4168 using , ?4169 using , ?4170 using , ?4233 using , ?4330 using , ?4335 using , ?4340 using , ?4341 using , ?4342 using , ?4356 using , ?4357 using , ?4358 using , ?4359 using , ?4365 using , ?4366 using , ?4367 using , ?4370 using , ?4371 using , ?4372 using , ?4375 using , ?4376 using , ?4377 using , ?4381 using , ?4382 using , ?4383 using , ?4392 using , ?4393 using , ?4394 using , ?4395 using , ?4396 using , ?4397 using , ?4406 using , ?4407 using , ?4408 using , ?4411 using , ?4412 using , ?4413 using , ?4416 using , ?4417 using , ?4418 using , ?4422 using , ?4423 using , ?4424 using , ?4428 using , ?4429 using , ?4430 using ,)


replace (#0 H h 1 h 1 # (1 + n)) with ((#0 H h 1) 1 # (S n)) by trivial.
3 subgoals, subgoal 1 (ID 4587)
  
  Γ : Env
  A : Term
  A' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ A ↑  1 # n : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊢ A' ↑  1 # n : !s1'
  t1 : A :: Γ ⊢ B : !s2
  H2 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ B ↑  1 # n : !s2
  t2 : A' :: Γ ⊢ B' : !s2'
  H3 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n (A' :: Γ) Γ' -> Δ ⊢ A : !s -> Γ' ⊢ B' ↑  1 # n : !s2'
  t3 : Γ ⊢ H : A = A'
  H4 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ H ↑h 1 # n : A ↑  1 # n = A' ↑  1 # n
  t4 : A :: Γ ⊢ K : B = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H5 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s ->
       Γ' ⊢ K ↑h 1 # n : B ↑  1 # n = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] ↑  1 # n
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H6 : ins_in_env Δ A0 n Γ Γ'
  H7 : Δ ⊢ A0 : !s
  ============================
   A ↑  1 # n :: Γ' ⊢ K ↑h 1 # (S n) : B ↑  1 # (S n) =
   (B' ↑  1 # 1 ↑  1 # (1 + S n)) [ ← (#0 ∽ H ↑h 1) ↑  1 # (S n)]

subgoal 2 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 3 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using , ?4124 using , ?4125 using , ?4126 using , ?4131 using , ?4132 using , ?4133 using , ?4136 using , ?4137 using , ?4138 using , ?4142 using , ?4143 using , ?4144 using , ?4160 using , ?4163 using , ?4164 using , ?4165 using , ?4168 using , ?4169 using , ?4170 using , ?4233 using , ?4330 using , ?4335 using , ?4340 using , ?4341 using , ?4342 using , ?4356 using , ?4357 using , ?4358 using , ?4359 using , ?4365 using , ?4366 using , ?4367 using , ?4370 using , ?4371 using , ?4372 using , ?4375 using , ?4376 using , ?4377 using , ?4381 using , ?4382 using , ?4383 using , ?4392 using , ?4393 using , ?4394 using , ?4395 using , ?4396 using , ?4397 using , ?4406 using , ?4407 using , ?4408 using , ?4411 using , ?4412 using , ?4413 using , ?4416 using , ?4417 using , ?4418 using , ?4422 using , ?4423 using , ?4424 using , ?4428 using , ?4429 using , ?4430 using ,)


replace (1+S n) with (S (0+S n)) by trivial.
3 subgoals, subgoal 1 (ID 4592)
  
  Γ : Env
  A : Term
  A' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ A ↑  1 # n : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊢ A' ↑  1 # n : !s1'
  t1 : A :: Γ ⊢ B : !s2
  H2 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ B ↑  1 # n : !s2
  t2 : A' :: Γ ⊢ B' : !s2'
  H3 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n (A' :: Γ) Γ' -> Δ ⊢ A : !s -> Γ' ⊢ B' ↑  1 # n : !s2'
  t3 : Γ ⊢ H : A = A'
  H4 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ H ↑h 1 # n : A ↑  1 # n = A' ↑  1 # n
  t4 : A :: Γ ⊢ K : B = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H5 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s ->
       Γ' ⊢ K ↑h 1 # n : B ↑  1 # n = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] ↑  1 # n
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H6 : ins_in_env Δ A0 n Γ Γ'
  H7 : Δ ⊢ A0 : !s
  ============================
   A ↑  1 # n :: Γ' ⊢ K ↑h 1 # (S n) : B ↑  1 # (S n) =
   (B' ↑  1 # 1 ↑  1 # (S (0 + S n))) [ ← (#0 ∽ H ↑h 1) ↑  1 # (S n)]

subgoal 2 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 3 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using , ?4124 using , ?4125 using , ?4126 using , ?4131 using , ?4132 using , ?4133 using , ?4136 using , ?4137 using , ?4138 using , ?4142 using , ?4143 using , ?4144 using , ?4160 using , ?4163 using , ?4164 using , ?4165 using , ?4168 using , ?4169 using , ?4170 using , ?4233 using , ?4330 using , ?4335 using , ?4340 using , ?4341 using , ?4342 using , ?4356 using , ?4357 using , ?4358 using , ?4359 using , ?4365 using , ?4366 using , ?4367 using , ?4370 using , ?4371 using , ?4372 using , ?4375 using , ?4376 using , ?4377 using , ?4381 using , ?4382 using , ?4383 using , ?4392 using , ?4393 using , ?4394 using , ?4395 using , ?4396 using , ?4397 using , ?4406 using , ?4407 using , ?4408 using , ?4411 using , ?4412 using , ?4413 using , ?4416 using , ?4417 using , ?4418 using , ?4422 using , ?4423 using , ?4424 using , ?4428 using , ?4429 using , ?4430 using ,)


rewrite_l_rev substP1;simpl.
3 subgoals, subgoal 1 (ID 4598)
  
  Γ : Env
  A : Term
  A' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ A ↑  1 # n : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊢ A' ↑  1 # n : !s1'
  t1 : A :: Γ ⊢ B : !s2
  H2 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ B ↑  1 # n : !s2
  t2 : A' :: Γ ⊢ B' : !s2'
  H3 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n (A' :: Γ) Γ' -> Δ ⊢ A : !s -> Γ' ⊢ B' ↑  1 # n : !s2'
  t3 : Γ ⊢ H : A = A'
  H4 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ H ↑h 1 # n : A ↑  1 # n = A' ↑  1 # n
  t4 : A :: Γ ⊢ K : B = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H5 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s ->
       Γ' ⊢ K ↑h 1 # n : B ↑  1 # n = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] ↑  1 # n
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H6 : ins_in_env Δ A0 n Γ Γ'
  H7 : Δ ⊢ A0 : !s
  ============================
   A ↑  1 # n :: Γ' ⊢ K ↑h 1 # (S n) : B ↑  1 # (S n) =
   (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] ↑  1 # (S n)

subgoal 2 (ID 1936) is:
 Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
 : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)
subgoal 3 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using , ?4124 using , ?4125 using , ?4126 using , ?4131 using , ?4132 using , ?4133 using , ?4136 using , ?4137 using , ?4138 using , ?4142 using , ?4143 using , ?4144 using , ?4160 using , ?4163 using , ?4164 using , ?4165 using , ?4168 using , ?4169 using , ?4170 using , ?4233 using , ?4330 using , ?4335 using , ?4340 using , ?4341 using , ?4342 using , ?4356 using , ?4357 using , ?4358 using , ?4359 using , ?4365 using , ?4366 using , ?4367 using , ?4370 using , ?4371 using , ?4372 using , ?4375 using , ?4376 using , ?4377 using , ?4381 using , ?4382 using , ?4383 using , ?4392 using , ?4393 using , ?4394 using , ?4395 using , ?4396 using , ?4397 using , ?4406 using , ?4407 using , ?4408 using , ?4411 using , ?4412 using , ?4413 using , ?4416 using , ?4417 using , ?4418 using , ?4422 using , ?4423 using , ?4424 using , ?4428 using , ?4429 using , ?4430 using ,)


eapply H5;eauto.
2 subgoals, subgoal 1 (ID 1936)
  
  Γ : Env
  A : Term
  A' : Term
  b : Term
  b' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ A ↑  1 # n : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊢ A' ↑  1 # n : !s1'
  t1 : A :: Γ ⊢ b : B
  H2 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ b ↑  1 # n : B ↑  1 # n
  t2 : A' :: Γ ⊢ b' : B'
  H3 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n (A' :: Γ) Γ' ->
       Δ ⊢ A : !s -> Γ' ⊢ b' ↑  1 # n : B' ↑  1 # n
  t3 : A :: Γ ⊢ B : !s2
  H4 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ B ↑  1 # n : !s2
  t4 : A' :: Γ ⊢ B' : !s2'
  H5 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n (A' :: Γ) Γ' -> Δ ⊢ A : !s -> Γ' ⊢ B' ↑  1 # n : !s2'
  t5 : Γ ⊢ H : A = A'
  H6 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ H ↑h 1 # n : A ↑  1 # n = A' ↑  1 # n
  t6 : A :: Γ ⊢ K : b = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H7 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s ->
       Γ' ⊢ K ↑h 1 # n : b ↑  1 # n = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] ↑  1 # n
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H8 : ins_in_env Δ A0 n Γ Γ'
  H9 : Δ ⊢ A0 : !s
  ============================
   Γ' ⊢ ⟨H ↑h 1 # n, [A ↑  1 # n]K ↑h 1 # (S n) ⟩
   : λ [A ↑  1 # n], b ↑  1 # (S n) = λ [A' ↑  1 # n], b' ↑  1 # (S n)

subgoal 2 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using , ?4124 using , ?4125 using , ?4126 using , ?4131 using , ?4132 using , ?4133 using , ?4136 using , ?4137 using , ?4138 using , ?4142 using , ?4143 using , ?4144 using , ?4160 using , ?4163 using , ?4164 using , ?4165 using , ?4168 using , ?4169 using , ?4170 using , ?4233 using , ?4330 using , ?4335 using , ?4340 using , ?4341 using , ?4342 using , ?4356 using , ?4357 using , ?4358 using , ?4359 using , ?4365 using , ?4366 using , ?4367 using , ?4370 using , ?4371 using , ?4372 using , ?4375 using , ?4376 using , ?4377 using , ?4381 using , ?4382 using , ?4383 using , ?4392 using , ?4393 using , ?4394 using , ?4395 using , ?4396 using , ?4397 using , ?4406 using , ?4407 using , ?4408 using , ?4411 using , ?4412 using , ?4413 using , ?4416 using , ?4417 using , ?4418 using , ?4422 using , ?4423 using , ?4424 using , ?4428 using , ?4429 using , ?4430 using , ?4599 using , ?4600 using , ?4601 using ,)


econstructor; [eexact r|eexact r0|eauto..].
2 subgoals, subgoal 1 (ID 4628)
  
  Γ : Env
  A : Term
  A' : Term
  b : Term
  b' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ A ↑  1 # n : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊢ A' ↑  1 # n : !s1'
  t1 : A :: Γ ⊢ b : B
  H2 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ b ↑  1 # n : B ↑  1 # n
  t2 : A' :: Γ ⊢ b' : B'
  H3 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n (A' :: Γ) Γ' ->
       Δ ⊢ A : !s -> Γ' ⊢ b' ↑  1 # n : B' ↑  1 # n
  t3 : A :: Γ ⊢ B : !s2
  H4 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ B ↑  1 # n : !s2
  t4 : A' :: Γ ⊢ B' : !s2'
  H5 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n (A' :: Γ) Γ' -> Δ ⊢ A : !s -> Γ' ⊢ B' ↑  1 # n : !s2'
  t5 : Γ ⊢ H : A = A'
  H6 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ H ↑h 1 # n : A ↑  1 # n = A' ↑  1 # n
  t6 : A :: Γ ⊢ K : b = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H7 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s ->
       Γ' ⊢ K ↑h 1 # n : b ↑  1 # n = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] ↑  1 # n
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H8 : ins_in_env Δ A0 n Γ Γ'
  H9 : Δ ⊢ A0 : !s
  ============================
   A ↑  1 # n :: Γ' ⊢ K ↑h 1 # (S n) : b ↑  1 # (S n) =
   (b' ↑  1 # (S n) ↑  1 # 1) [ ← #0 ∽ H ↑h 1 # n ↑h 1]

subgoal 2 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using , ?4124 using , ?4125 using , ?4126 using , ?4131 using , ?4132 using , ?4133 using , ?4136 using , ?4137 using , ?4138 using , ?4142 using , ?4143 using , ?4144 using , ?4160 using , ?4163 using , ?4164 using , ?4165 using , ?4168 using , ?4169 using , ?4170 using , ?4233 using , ?4330 using , ?4335 using , ?4340 using , ?4341 using , ?4342 using , ?4356 using , ?4357 using , ?4358 using , ?4359 using , ?4365 using , ?4366 using , ?4367 using , ?4370 using , ?4371 using , ?4372 using , ?4375 using , ?4376 using , ?4377 using , ?4381 using , ?4382 using , ?4383 using , ?4392 using , ?4393 using , ?4394 using , ?4395 using , ?4396 using , ?4397 using , ?4406 using , ?4407 using , ?4408 using , ?4411 using , ?4412 using , ?4413 using , ?4416 using , ?4417 using , ?4418 using , ?4422 using , ?4423 using , ?4424 using , ?4428 using , ?4429 using , ?4430 using , ?4599 using , ?4600 using , ?4601 using , ?4611 using , ?4612 using , ?4613 using , ?4614 using , ?4615 using , ?4616 using , ?4617 using , ?4618 using , ?4629 using , ?4630 using , ?4631 using , ?4634 using , ?4635 using , ?4636 using , ?4639 using , ?4640 using , ?4641 using , ?4645 using , ?4646 using , ?4647 using , ?4651 using , ?4652 using , ?4653 using , ?4657 using , ?4658 using , ?4659 using , ?4663 using , ?4664 using , ?4665 using ,)


rewrite_l_rev liftP2;intuition.
2 subgoals, subgoal 1 (ID 4671)
  
  Γ : Env
  A : Term
  A' : Term
  b : Term
  b' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ A ↑  1 # n : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊢ A' ↑  1 # n : !s1'
  t1 : A :: Γ ⊢ b : B
  H2 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ b ↑  1 # n : B ↑  1 # n
  t2 : A' :: Γ ⊢ b' : B'
  H3 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n (A' :: Γ) Γ' ->
       Δ ⊢ A : !s -> Γ' ⊢ b' ↑  1 # n : B' ↑  1 # n
  t3 : A :: Γ ⊢ B : !s2
  H4 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ B ↑  1 # n : !s2
  t4 : A' :: Γ ⊢ B' : !s2'
  H5 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n (A' :: Γ) Γ' -> Δ ⊢ A : !s -> Γ' ⊢ B' ↑  1 # n : !s2'
  t5 : Γ ⊢ H : A = A'
  H6 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ H ↑h 1 # n : A ↑  1 # n = A' ↑  1 # n
  t6 : A :: Γ ⊢ K : b = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H7 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s ->
       Γ' ⊢ K ↑h 1 # n : b ↑  1 # n = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] ↑  1 # n
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H8 : ins_in_env Δ A0 n Γ Γ'
  H9 : Δ ⊢ A0 : !s
  ============================
   A ↑  1 # n :: Γ' ⊢ K ↑h 1 # (S n) : b ↑  1 # (S n) =
   (b' ↑  1 # 1 ↑  1 # (1 + S n)) [ ← #0 ∽ H ↑h 1 # n ↑h 1]

subgoal 2 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using , ?4124 using , ?4125 using , ?4126 using , ?4131 using , ?4132 using , ?4133 using , ?4136 using , ?4137 using , ?4138 using , ?4142 using , ?4143 using , ?4144 using , ?4160 using , ?4163 using , ?4164 using , ?4165 using , ?4168 using , ?4169 using , ?4170 using , ?4233 using , ?4330 using , ?4335 using , ?4340 using , ?4341 using , ?4342 using , ?4356 using , ?4357 using , ?4358 using , ?4359 using , ?4365 using , ?4366 using , ?4367 using , ?4370 using , ?4371 using , ?4372 using , ?4375 using , ?4376 using , ?4377 using , ?4381 using , ?4382 using , ?4383 using , ?4392 using , ?4393 using , ?4394 using , ?4395 using , ?4396 using , ?4397 using , ?4406 using , ?4407 using , ?4408 using , ?4411 using , ?4412 using , ?4413 using , ?4416 using , ?4417 using , ?4418 using , ?4422 using , ?4423 using , ?4424 using , ?4428 using , ?4429 using , ?4430 using , ?4599 using , ?4600 using , ?4601 using , ?4611 using , ?4612 using , ?4613 using , ?4614 using , ?4615 using , ?4616 using , ?4617 using , ?4618 using , ?4629 using , ?4630 using , ?4631 using , ?4634 using , ?4635 using , ?4636 using , ?4639 using , ?4640 using , ?4641 using , ?4645 using , ?4646 using , ?4647 using , ?4651 using , ?4652 using , ?4653 using , ?4657 using , ?4658 using , ?4659 using , ?4663 using , ?4664 using , ?4665 using ,)


rewrite_r_rev liftP2;intuition.
2 subgoals, subgoal 1 (ID 4759)
  
  Γ : Env
  A : Term
  A' : Term
  b : Term
  b' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ A ↑  1 # n : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊢ A' ↑  1 # n : !s1'
  t1 : A :: Γ ⊢ b : B
  H2 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ b ↑  1 # n : B ↑  1 # n
  t2 : A' :: Γ ⊢ b' : B'
  H3 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n (A' :: Γ) Γ' ->
       Δ ⊢ A : !s -> Γ' ⊢ b' ↑  1 # n : B' ↑  1 # n
  t3 : A :: Γ ⊢ B : !s2
  H4 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ B ↑  1 # n : !s2
  t4 : A' :: Γ ⊢ B' : !s2'
  H5 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n (A' :: Γ) Γ' -> Δ ⊢ A : !s -> Γ' ⊢ B' ↑  1 # n : !s2'
  t5 : Γ ⊢ H : A = A'
  H6 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ H ↑h 1 # n : A ↑  1 # n = A' ↑  1 # n
  t6 : A :: Γ ⊢ K : b = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H7 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s ->
       Γ' ⊢ K ↑h 1 # n : b ↑  1 # n = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] ↑  1 # n
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H8 : ins_in_env Δ A0 n Γ Γ'
  H9 : Δ ⊢ A0 : !s
  ============================
   A ↑  1 # n :: Γ' ⊢ K ↑h 1 # (S n) : b ↑  1 # (S n) =
   (b' ↑  1 # 1 ↑  1 # (1 + S n)) [ ← #0 ∽ H ↑h 1 ↑h 1 # (1 + n)]

subgoal 2 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using , ?4124 using , ?4125 using , ?4126 using , ?4131 using , ?4132 using , ?4133 using , ?4136 using , ?4137 using , ?4138 using , ?4142 using , ?4143 using , ?4144 using , ?4160 using , ?4163 using , ?4164 using , ?4165 using , ?4168 using , ?4169 using , ?4170 using , ?4233 using , ?4330 using , ?4335 using , ?4340 using , ?4341 using , ?4342 using , ?4356 using , ?4357 using , ?4358 using , ?4359 using , ?4365 using , ?4366 using , ?4367 using , ?4370 using , ?4371 using , ?4372 using , ?4375 using , ?4376 using , ?4377 using , ?4381 using , ?4382 using , ?4383 using , ?4392 using , ?4393 using , ?4394 using , ?4395 using , ?4396 using , ?4397 using , ?4406 using , ?4407 using , ?4408 using , ?4411 using , ?4412 using , ?4413 using , ?4416 using , ?4417 using , ?4418 using , ?4422 using , ?4423 using , ?4424 using , ?4428 using , ?4429 using , ?4430 using , ?4599 using , ?4600 using , ?4601 using , ?4611 using , ?4612 using , ?4613 using , ?4614 using , ?4615 using , ?4616 using , ?4617 using , ?4618 using , ?4629 using , ?4630 using , ?4631 using , ?4634 using , ?4635 using , ?4636 using , ?4639 using , ?4640 using , ?4641 using , ?4645 using , ?4646 using , ?4647 using , ?4651 using , ?4652 using , ?4653 using , ?4657 using , ?4658 using , ?4659 using , ?4663 using , ?4664 using , ?4665 using ,)


replace (#0 H h 1 h 1 # (1 + n)) with ((#0 H h 1) 1 # (S n)) by trivial.
2 subgoals, subgoal 1 (ID 4846)
  
  Γ : Env
  A : Term
  A' : Term
  b : Term
  b' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ A ↑  1 # n : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊢ A' ↑  1 # n : !s1'
  t1 : A :: Γ ⊢ b : B
  H2 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ b ↑  1 # n : B ↑  1 # n
  t2 : A' :: Γ ⊢ b' : B'
  H3 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n (A' :: Γ) Γ' ->
       Δ ⊢ A : !s -> Γ' ⊢ b' ↑  1 # n : B' ↑  1 # n
  t3 : A :: Γ ⊢ B : !s2
  H4 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ B ↑  1 # n : !s2
  t4 : A' :: Γ ⊢ B' : !s2'
  H5 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n (A' :: Γ) Γ' -> Δ ⊢ A : !s -> Γ' ⊢ B' ↑  1 # n : !s2'
  t5 : Γ ⊢ H : A = A'
  H6 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ H ↑h 1 # n : A ↑  1 # n = A' ↑  1 # n
  t6 : A :: Γ ⊢ K : b = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H7 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s ->
       Γ' ⊢ K ↑h 1 # n : b ↑  1 # n = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] ↑  1 # n
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H8 : ins_in_env Δ A0 n Γ Γ'
  H9 : Δ ⊢ A0 : !s
  ============================
   A ↑  1 # n :: Γ' ⊢ K ↑h 1 # (S n) : b ↑  1 # (S n) =
   (b' ↑  1 # 1 ↑  1 # (1 + S n)) [ ← (#0 ∽ H ↑h 1) ↑  1 # (S n)]

subgoal 2 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using , ?4124 using , ?4125 using , ?4126 using , ?4131 using , ?4132 using , ?4133 using , ?4136 using , ?4137 using , ?4138 using , ?4142 using , ?4143 using , ?4144 using , ?4160 using , ?4163 using , ?4164 using , ?4165 using , ?4168 using , ?4169 using , ?4170 using , ?4233 using , ?4330 using , ?4335 using , ?4340 using , ?4341 using , ?4342 using , ?4356 using , ?4357 using , ?4358 using , ?4359 using , ?4365 using , ?4366 using , ?4367 using , ?4370 using , ?4371 using , ?4372 using , ?4375 using , ?4376 using , ?4377 using , ?4381 using , ?4382 using , ?4383 using , ?4392 using , ?4393 using , ?4394 using , ?4395 using , ?4396 using , ?4397 using , ?4406 using , ?4407 using , ?4408 using , ?4411 using , ?4412 using , ?4413 using , ?4416 using , ?4417 using , ?4418 using , ?4422 using , ?4423 using , ?4424 using , ?4428 using , ?4429 using , ?4430 using , ?4599 using , ?4600 using , ?4601 using , ?4611 using , ?4612 using , ?4613 using , ?4614 using , ?4615 using , ?4616 using , ?4617 using , ?4618 using , ?4629 using , ?4630 using , ?4631 using , ?4634 using , ?4635 using , ?4636 using , ?4639 using , ?4640 using , ?4641 using , ?4645 using , ?4646 using , ?4647 using , ?4651 using , ?4652 using , ?4653 using , ?4657 using , ?4658 using , ?4659 using , ?4663 using , ?4664 using , ?4665 using ,)


replace (1+S n) with (S (0+S n)) by trivial.
2 subgoals, subgoal 1 (ID 4851)
  
  Γ : Env
  A : Term
  A' : Term
  b : Term
  b' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ A ↑  1 # n : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊢ A' ↑  1 # n : !s1'
  t1 : A :: Γ ⊢ b : B
  H2 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ b ↑  1 # n : B ↑  1 # n
  t2 : A' :: Γ ⊢ b' : B'
  H3 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n (A' :: Γ) Γ' ->
       Δ ⊢ A : !s -> Γ' ⊢ b' ↑  1 # n : B' ↑  1 # n
  t3 : A :: Γ ⊢ B : !s2
  H4 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ B ↑  1 # n : !s2
  t4 : A' :: Γ ⊢ B' : !s2'
  H5 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n (A' :: Γ) Γ' -> Δ ⊢ A : !s -> Γ' ⊢ B' ↑  1 # n : !s2'
  t5 : Γ ⊢ H : A = A'
  H6 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ H ↑h 1 # n : A ↑  1 # n = A' ↑  1 # n
  t6 : A :: Γ ⊢ K : b = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H7 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s ->
       Γ' ⊢ K ↑h 1 # n : b ↑  1 # n = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] ↑  1 # n
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H8 : ins_in_env Δ A0 n Γ Γ'
  H9 : Δ ⊢ A0 : !s
  ============================
   A ↑  1 # n :: Γ' ⊢ K ↑h 1 # (S n) : b ↑  1 # (S n) =
   (b' ↑  1 # 1 ↑  1 # (S (0 + S n))) [ ← (#0 ∽ H ↑h 1) ↑  1 # (S n)]

subgoal 2 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using , ?4124 using , ?4125 using , ?4126 using , ?4131 using , ?4132 using , ?4133 using , ?4136 using , ?4137 using , ?4138 using , ?4142 using , ?4143 using , ?4144 using , ?4160 using , ?4163 using , ?4164 using , ?4165 using , ?4168 using , ?4169 using , ?4170 using , ?4233 using , ?4330 using , ?4335 using , ?4340 using , ?4341 using , ?4342 using , ?4356 using , ?4357 using , ?4358 using , ?4359 using , ?4365 using , ?4366 using , ?4367 using , ?4370 using , ?4371 using , ?4372 using , ?4375 using , ?4376 using , ?4377 using , ?4381 using , ?4382 using , ?4383 using , ?4392 using , ?4393 using , ?4394 using , ?4395 using , ?4396 using , ?4397 using , ?4406 using , ?4407 using , ?4408 using , ?4411 using , ?4412 using , ?4413 using , ?4416 using , ?4417 using , ?4418 using , ?4422 using , ?4423 using , ?4424 using , ?4428 using , ?4429 using , ?4430 using , ?4599 using , ?4600 using , ?4601 using , ?4611 using , ?4612 using , ?4613 using , ?4614 using , ?4615 using , ?4616 using , ?4617 using , ?4618 using , ?4629 using , ?4630 using , ?4631 using , ?4634 using , ?4635 using , ?4636 using , ?4639 using , ?4640 using , ?4641 using , ?4645 using , ?4646 using , ?4647 using , ?4651 using , ?4652 using , ?4653 using , ?4657 using , ?4658 using , ?4659 using , ?4663 using , ?4664 using , ?4665 using ,)


rewrite_l_rev substP1;simpl.
2 subgoals, subgoal 1 (ID 4857)
  
  Γ : Env
  A : Term
  A' : Term
  b : Term
  b' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ A ↑  1 # n : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊢ A' ↑  1 # n : !s1'
  t1 : A :: Γ ⊢ b : B
  H2 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ b ↑  1 # n : B ↑  1 # n
  t2 : A' :: Γ ⊢ b' : B'
  H3 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n (A' :: Γ) Γ' ->
       Δ ⊢ A : !s -> Γ' ⊢ b' ↑  1 # n : B' ↑  1 # n
  t3 : A :: Γ ⊢ B : !s2
  H4 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ B ↑  1 # n : !s2
  t4 : A' :: Γ ⊢ B' : !s2'
  H5 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n (A' :: Γ) Γ' -> Δ ⊢ A : !s -> Γ' ⊢ B' ↑  1 # n : !s2'
  t5 : Γ ⊢ H : A = A'
  H6 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ H ↑h 1 # n : A ↑  1 # n = A' ↑  1 # n
  t6 : A :: Γ ⊢ K : b = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H7 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n (A :: Γ) Γ' ->
       Δ ⊢ A0 : !s ->
       Γ' ⊢ K ↑h 1 # n : b ↑  1 # n = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] ↑  1 # n
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H8 : ins_in_env Δ A0 n Γ Γ'
  H9 : Δ ⊢ A0 : !s
  ============================
   A ↑  1 # n :: Γ' ⊢ K ↑h 1 # (S n) : b ↑  1 # (S n) =
   (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] ↑  1 # (S n)

subgoal 2 (ID 1966) is:
 Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
 F' ↑  1 # n · a' ↑  1 # n
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using , ?4124 using , ?4125 using , ?4126 using , ?4131 using , ?4132 using , ?4133 using , ?4136 using , ?4137 using , ?4138 using , ?4142 using , ?4143 using , ?4144 using , ?4160 using , ?4163 using , ?4164 using , ?4165 using , ?4168 using , ?4169 using , ?4170 using , ?4233 using , ?4330 using , ?4335 using , ?4340 using , ?4341 using , ?4342 using , ?4356 using , ?4357 using , ?4358 using , ?4359 using , ?4365 using , ?4366 using , ?4367 using , ?4370 using , ?4371 using , ?4372 using , ?4375 using , ?4376 using , ?4377 using , ?4381 using , ?4382 using , ?4383 using , ?4392 using , ?4393 using , ?4394 using , ?4395 using , ?4396 using , ?4397 using , ?4406 using , ?4407 using , ?4408 using , ?4411 using , ?4412 using , ?4413 using , ?4416 using , ?4417 using , ?4418 using , ?4422 using , ?4423 using , ?4424 using , ?4428 using , ?4429 using , ?4430 using , ?4599 using , ?4600 using , ?4601 using , ?4611 using , ?4612 using , ?4613 using , ?4614 using , ?4615 using , ?4616 using , ?4617 using , ?4618 using , ?4629 using , ?4630 using , ?4631 using , ?4634 using , ?4635 using , ?4636 using , ?4639 using , ?4640 using , ?4641 using , ?4645 using , ?4646 using , ?4647 using , ?4651 using , ?4652 using , ?4653 using , ?4657 using , ?4658 using , ?4659 using , ?4663 using , ?4664 using , ?4665 using ,)


eapply H7;eauto.
1 subgoals, subgoal 1 (ID 1966)
  
  Γ : Env
  F : Term
  F' : Term
  a : Term
  a' : Term
  A : Term
  A' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  t : Γ ⊢ F : Π (A), B
  H0 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' ->
       Δ ⊢ A0 : !s -> Γ' ⊢ F ↑  1 # n : Π (A ↑  1 # n), B ↑  1 # (S n)
  t0 : Γ ⊢ F' : Π (A'), B'
  H1 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n Γ Γ' ->
       Δ ⊢ A : !s -> Γ' ⊢ F' ↑  1 # n : Π (A' ↑  1 # n), B' ↑  1 # (S n)
  t1 : Γ ⊢ a : A
  H2 : forall (Δ : Env) (A0 : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A0 n Γ Γ' -> Δ ⊢ A0 : !s -> Γ' ⊢ a ↑  1 # n : A ↑  1 # n
  t2 : Γ ⊢ a' : A'
  H3 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n Γ Γ' -> Δ ⊢ A : !s -> Γ' ⊢ a' ↑  1 # n : A' ↑  1 # n
  t3 : Γ ⊢ H : F = F'
  H4 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n Γ Γ' ->
       Δ ⊢ A : !s -> Γ' ⊢ H ↑h 1 # n : F ↑  1 # n = F' ↑  1 # n
  t4 : Γ ⊢ K : a = a'
  H5 : forall (Δ : Env) (A : Term) (s : Sorts) (n : nat) (Γ' : Env),
       ins_in_env Δ A n Γ Γ' ->
       Δ ⊢ A : !s -> Γ' ⊢ K ↑h 1 # n : a ↑  1 # n = a' ↑  1 # n
  Δ : Env
  A0 : Term
  s : Sorts
  n : nat
  Γ' : Env
  H6 : ins_in_env Δ A0 n Γ Γ'
  H7 : Δ ⊢ A0 : !s
  ============================
   Γ' ⊢ H ↑h 1 # n ·h K ↑h 1 # n : F ↑  1 # n · a ↑  1 # n =
   F' ↑  1 # n · a' ↑  1 # n

(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using , ?4124 using , ?4125 using , ?4126 using , ?4131 using , ?4132 using , ?4133 using , ?4136 using , ?4137 using , ?4138 using , ?4142 using , ?4143 using , ?4144 using , ?4160 using , ?4163 using , ?4164 using , ?4165 using , ?4168 using , ?4169 using , ?4170 using , ?4233 using , ?4330 using , ?4335 using , ?4340 using , ?4341 using , ?4342 using , ?4356 using , ?4357 using , ?4358 using , ?4359 using , ?4365 using , ?4366 using , ?4367 using , ?4370 using , ?4371 using , ?4372 using , ?4375 using , ?4376 using , ?4377 using , ?4381 using , ?4382 using , ?4383 using , ?4392 using , ?4393 using , ?4394 using , ?4395 using , ?4396 using , ?4397 using , ?4406 using , ?4407 using , ?4408 using , ?4411 using , ?4412 using , ?4413 using , ?4416 using , ?4417 using , ?4418 using , ?4422 using , ?4423 using , ?4424 using , ?4428 using , ?4429 using , ?4430 using , ?4599 using , ?4600 using , ?4601 using , ?4611 using , ?4612 using , ?4613 using , ?4614 using , ?4615 using , ?4616 using , ?4617 using , ?4618 using , ?4629 using , ?4630 using , ?4631 using , ?4634 using , ?4635 using , ?4636 using , ?4639 using , ?4640 using , ?4641 using , ?4645 using , ?4646 using , ?4647 using , ?4651 using , ?4652 using , ?4653 using , ?4657 using , ?4658 using , ?4659 using , ?4663 using , ?4664 using , ?4665 using , ?4858 using , ?4859 using , ?4860 using ,)


econstructor; eauto.
No more subgoals.
(dependent evars: ?1994 using ?2001 , ?1995 using ?2000 , ?2000 using , ?2001 using , ?2117 using , ?2118 using , ?2119 using , ?2120 using , ?2181 using , ?2182 using , ?2186 using , ?2187 using , ?2188 using , ?2191 using , ?2192 using , ?2193 using , ?2220 using , ?2221 using , ?2225 using , ?2226 using , ?2227 using , ?2230 using , ?2231 using , ?2232 using , ?2235 using , ?2236 using , ?2237 using , ?3827 using , ?3829 using , ?3830 using , ?3831 using , ?3835 using , ?3836 using , ?3837 using , ?3840 using , ?3843 using , ?3844 using , ?3845 using , ?3848 using , ?3849 using , ?3850 using , ?3957 using , ?3958 using ?3971 ?3970 ?3969 , ?3959 using , ?3963 using , ?3964 using , ?3965 using , ?3969 using , ?3970 using , ?3971 using , ?3972 using , ?3973 using , ?3974 using , ?4001 using , ?4002 using , ?4003 using , ?4020 using , ?4021 using , ?4022 using , ?4023 using , ?4095 using , ?4096 using , ?4097 using , ?4098 using , ?4106 using , ?4107 using , ?4108 using , ?4109 using , ?4112 using , ?4113 using , ?4114 using , ?4124 using , ?4125 using , ?4126 using , ?4131 using , ?4132 using , ?4133 using , ?4136 using , ?4137 using , ?4138 using , ?4142 using , ?4143 using , ?4144 using , ?4160 using , ?4163 using , ?4164 using , ?4165 using , ?4168 using , ?4169 using , ?4170 using , ?4233 using , ?4330 using , ?4335 using , ?4340 using , ?4341 using , ?4342 using , ?4356 using , ?4357 using , ?4358 using , ?4359 using , ?4365 using , ?4366 using , ?4367 using , ?4370 using , ?4371 using , ?4372 using , ?4375 using , ?4376 using , ?4377 using , ?4381 using , ?4382 using , ?4383 using , ?4392 using , ?4393 using , ?4394 using , ?4395 using , ?4396 using , ?4397 using , ?4406 using , ?4407 using , ?4408 using , ?4411 using , ?4412 using , ?4413 using , ?4416 using , ?4417 using , ?4418 using , ?4422 using , ?4423 using , ?4424 using , ?4428 using , ?4429 using , ?4430 using , ?4599 using , ?4600 using , ?4601 using , ?4611 using , ?4612 using , ?4613 using , ?4614 using , ?4615 using , ?4616 using , ?4617 using , ?4618 using , ?4629 using , ?4630 using , ?4631 using , ?4634 using , ?4635 using , ?4636 using , ?4639 using , ?4640 using , ?4641 using , ?4645 using , ?4646 using , ?4647 using , ?4651 using , ?4652 using , ?4653 using , ?4657 using , ?4658 using , ?4659 using , ?4663 using , ?4664 using , ?4665 using , ?4858 using , ?4859 using , ?4860 using , ?4871 using , ?4872 using , ?4873 using , ?4874 using , ?4881 using , ?4882 using , ?4883 using , ?4886 using , ?4887 using , ?4888 using , ?4891 using , ?4892 using , ?4893 using , ?4896 using , ?4897 using , ?4898 using , ?4901 using , ?4902 using , ?4903 using , ?4906 using , ?4907 using , ?4908 using ,)


Qed.
weakening is defined



Theorem thinning : forall Γ M N A s, Γ M : N -> Γ A : !s -> A::Γ M 1 : N 1.
1 subgoals, subgoal 1 (ID 4918)
  
  ============================
   forall (Γ : Env) (M N A : Term) (s : Sorts),
   Γ ⊢ M : N -> Γ ⊢ A : !s -> A :: Γ ⊢ M ↑  1 : N ↑  1

(dependent evars:)


intros;eapply weakening;eassumption||econstructor.
No more subgoals.
(dependent evars: ?4934 using ?4941 , ?4935 using ?4943 , ?4936 using ?4944 , ?4937 using ?4946 , ?4941 using , ?4943 using , ?4944 using , ?4946 using ,)


Qed.
thinning is defined



Theorem thinning_h : forall Γ H M N A s, Γ H : M = N -> Γ A : !s -> A::Γ H h 1 : M 1 = N 1.
1 subgoals, subgoal 1 (ID 4964)
  
  ============================
   forall (Γ : Env) (H : Prf) (M N A : Term) (s : Sorts),
   Γ ⊢ H : M = N -> Γ ⊢ A : !s -> A :: Γ ⊢ H ↑h 1 : M ↑  1 = N ↑  1

(dependent evars:)


intros;eapply weakening;eassumption||econstructor.
No more subgoals.
(dependent evars: ?4979 using ?4986 , ?4980 using ?4988 , ?4981 using ?4989 , ?4982 using ?4991 , ?4986 using ?4993 , ?4988 using ?4995 , ?4989 using ?4996 , ?4991 using ?4998 , ?4993 using , ?4995 using , ?4996 using , ?4998 using ,)


Qed.
thinning_h is defined



Theorem thinning_n : forall n Δ Δ', trunc n Δ Δ' -> forall M T , Δ' M : T -> Δ -> Δ M n : T n.
1 subgoals, subgoal 1 (ID 5017)
  
  ============================
   forall (n : nat) (Δ Δ' : list Term),
   trunc n Δ Δ' ->
   forall M T : Term, Δ' ⊢ M : T -> Δ ⊣ -> Δ ⊢ M ↑  n : T ↑  n

(dependent evars:)


induction n; intros;inversion H; subst.
2 subgoals, subgoal 1 (ID 5153)
  
  Δ' : list Term
  M : Term
  T : Term
  H0 : Δ' ⊢ M : T
  H : trunc 0 Δ' Δ'
  H1 : Δ' ⊣
  ============================
   Δ' ⊢ M ↑  0 : T ↑  0

subgoal 2 (ID 5161) is:
 x :: Γ ⊢ M ↑  (S n) : T ↑  (S n)
(dependent evars:)


do 2 rewrite_l lift0; trivial.
1 subgoals, subgoal 1 (ID 5161)
  
  n : nat
  IHn : forall Δ Δ' : list Term,
        trunc n Δ Δ' ->
        forall M T : Term, Δ' ⊢ M : T -> Δ ⊣ -> Δ ⊢ M ↑  n : T ↑  n
  Δ' : list Term
  M : Term
  T : Term
  H0 : Δ' ⊢ M : T
  Γ : list Term
  x : Term
  H3 : trunc n Γ Δ'
  H : trunc (S n) (x :: Γ) Δ'
  H1 : x :: Γ ⊣
  ============================
   x :: Γ ⊢ M ↑  (S n) : T ↑  (S n)

(dependent evars:)


change (S n) with (1+n).
1 subgoals, subgoal 1 (ID 5171)
  
  n : nat
  IHn : forall Δ Δ' : list Term,
        trunc n Δ Δ' ->
        forall M T : Term, Δ' ⊢ M : T -> Δ ⊣ -> Δ ⊢ M ↑  n : T ↑  n
  Δ' : list Term
  M : Term
  T : Term
  H0 : Δ' ⊢ M : T
  Γ : list Term
  x : Term
  H3 : trunc n Γ Δ'
  H : trunc (S n) (x :: Γ) Δ'
  H1 : x :: Γ ⊣
  ============================
   x :: Γ ⊢ M ↑  (1 + n) : T ↑  (1 + n)

(dependent evars:)


replace (M (1+n)) with ((M n )↑ 1) by (apply lift_lift).
1 subgoals, subgoal 1 (ID 5175)
  
  n : nat
  IHn : forall Δ Δ' : list Term,
        trunc n Δ Δ' ->
        forall M T : Term, Δ' ⊢ M : T -> Δ ⊣ -> Δ ⊢ M ↑  n : T ↑  n
  Δ' : list Term
  M : Term
  T : Term
  H0 : Δ' ⊢ M : T
  Γ : list Term
  x : Term
  H3 : trunc n Γ Δ'
  H : trunc (S n) (x :: Γ) Δ'
  H1 : x :: Γ ⊣
  ============================
   x :: Γ ⊢ M ↑  n ↑  1 : T ↑  (1 + n)

(dependent evars:)


replace (T (1+n)) with ((T n) 1) by (apply lift_lift).
1 subgoals, subgoal 1 (ID 5184)
  
  n : nat
  IHn : forall Δ Δ' : list Term,
        trunc n Δ Δ' ->
        forall M T : Term, Δ' ⊢ M : T -> Δ ⊣ -> Δ ⊢ M ↑  n : T ↑  n
  Δ' : list Term
  M : Term
  T : Term
  H0 : Δ' ⊢ M : T
  Γ : list Term
  x : Term
  H3 : trunc n Γ Δ'
  H : trunc (S n) (x :: Γ) Δ'
  H1 : x :: Γ ⊣
  ============================
   x :: Γ ⊢ M ↑  n ↑  1 : T ↑  n ↑  1

(dependent evars:)


inversion H1; subst.
1 subgoals, subgoal 1 (ID 5237)
  
  n : nat
  IHn : forall Δ Δ' : list Term,
        trunc n Δ Δ' ->
        forall M T : Term, Δ' ⊢ M : T -> Δ ⊣ -> Δ ⊢ M ↑  n : T ↑  n
  Δ' : list Term
  M : Term
  T : Term
  H0 : Δ' ⊢ M : T
  Γ : list Term
  x : Term
  H3 : trunc n Γ Δ'
  H : trunc (S n) (x :: Γ) Δ'
  H1 : x :: Γ ⊣
  s : Sorts
  H4 : Γ ⊢ x : !s
  ============================
   x :: Γ ⊢ M ↑  n ↑  1 : T ↑  n ↑  1

(dependent evars:)


apply thinning with s; trivial.
1 subgoals, subgoal 1 (ID 5238)
  
  n : nat
  IHn : forall Δ Δ' : list Term,
        trunc n Δ Δ' ->
        forall M T : Term, Δ' ⊢ M : T -> Δ ⊣ -> Δ ⊢ M ↑  n : T ↑  n
  Δ' : list Term
  M : Term
  T : Term
  H0 : Δ' ⊢ M : T
  Γ : list Term
  x : Term
  H3 : trunc n Γ Δ'
  H : trunc (S n) (x :: Γ) Δ'
  H1 : x :: Γ ⊣
  s : Sorts
  H4 : Γ ⊢ x : !s
  ============================
   Γ ⊢ M ↑  n : T ↑  n

(dependent evars:)


eapply IHn.
3 subgoals, subgoal 1 (ID 5241)
  
  n : nat
  IHn : forall Δ Δ' : list Term,
        trunc n Δ Δ' ->
        forall M T : Term, Δ' ⊢ M : T -> Δ ⊣ -> Δ ⊢ M ↑  n : T ↑  n
  Δ' : list Term
  M : Term
  T : Term
  H0 : Δ' ⊢ M : T
  Γ : list Term
  x : Term
  H3 : trunc n Γ Δ'
  H : trunc (S n) (x :: Γ) Δ'
  H1 : x :: Γ ⊣
  s : Sorts
  H4 : Γ ⊢ x : !s
  ============================
   trunc n Γ ?5240

subgoal 2 (ID 5242) is:
 ?5240 ⊢ M : T
subgoal 3 (ID 5243) is:
 Γ ⊣
(dependent evars: ?5240 open,)

apply H3.
2 subgoals, subgoal 1 (ID 5242)
  
  n : nat
  IHn : forall Δ Δ' : list Term,
        trunc n Δ Δ' ->
        forall M T : Term, Δ' ⊢ M : T -> Δ ⊣ -> Δ ⊢ M ↑  n : T ↑  n
  Δ' : list Term
  M : Term
  T : Term
  H0 : Δ' ⊢ M : T
  Γ : list Term
  x : Term
  H3 : trunc n Γ Δ'
  H : trunc (S n) (x :: Γ) Δ'
  H1 : x :: Γ ⊣
  s : Sorts
  H4 : Γ ⊢ x : !s
  ============================
   Δ' ⊢ M : T

subgoal 2 (ID 5243) is:
 Γ ⊣
(dependent evars: ?5240 using ,)

trivial.
1 subgoals, subgoal 1 (ID 5243)
  
  n : nat
  IHn : forall Δ Δ' : list Term,
        trunc n Δ Δ' ->
        forall M T : Term, Δ' ⊢ M : T -> Δ ⊣ -> Δ ⊢ M ↑  n : T ↑  n
  Δ' : list Term
  M : Term
  T : Term
  H0 : Δ' ⊢ M : T
  Γ : list Term
  x : Term
  H3 : trunc n Γ Δ'
  H : trunc (S n) (x :: Γ) Δ'
  H1 : x :: Γ ⊣
  s : Sorts
  H4 : Γ ⊢ x : !s
  ============================
   Γ ⊣

(dependent evars: ?5240 using ,)

eauto.
No more subgoals.
(dependent evars: ?5240 using , ?5244 using , ?5245 using ,)


Qed.
thinning_n is defined



Theorem thinning_n_h : forall n Δ Δ' H M N ,trunc n Δ Δ' -> Δ' H : M = N -> Δ -> Δ H h n : M n = N n.
1 subgoals, subgoal 1 (ID 5331)
  
  ============================
   forall (n : nat) (Δ Δ' : list Term) (H : Prf) (M N : Term),
   trunc n Δ Δ' -> Δ' ⊢ H : M = N -> Δ ⊣ -> Δ ⊢ H ↑h n : M ↑  n = N ↑  n

(dependent evars:)


induction n;inversion 1;intros;subst.
2 subgoals, subgoal 1 (ID 5467)
  
  Δ' : list Term
  H : Prf
  M : Term
  N : Term
  H1 : Δ' ⊢ H : M = N
  H4 : Δ' ⊣
  H0 : trunc 0 Δ' Δ'
  ============================
   Δ' ⊢ H ↑h 0 : M ↑  0 = N ↑  0

subgoal 2 (ID 5474) is:
 x :: Γ ⊢ H ↑h (S n) : M ↑  (S n) = N ↑  (S n)
(dependent evars:)


do 2 rewrite_l lift0; rewrite_r lift0; trivial.
1 subgoals, subgoal 1 (ID 5474)
  
  n : nat
  IHn : forall (Δ Δ' : list Term) (H : Prf) (M N : Term),
        trunc n Δ Δ' -> Δ' ⊢ H : M = N -> Δ ⊣ -> Δ ⊢ H ↑h n : M ↑  n = N ↑  n
  Δ' : list Term
  H : Prf
  M : Term
  N : Term
  Γ : list Term
  x : Term
  H2 : trunc n Γ Δ'
  H5 : Δ' ⊢ H : M = N
  H6 : x :: Γ ⊣
  H0 : trunc (S n) (x :: Γ) Δ'
  ============================
   x :: Γ ⊢ H ↑h (S n) : M ↑  (S n) = N ↑  (S n)

(dependent evars:)


change (S n) with (1+n).
1 subgoals, subgoal 1 (ID 5488)
  
  n : nat
  IHn : forall (Δ Δ' : list Term) (H : Prf) (M N : Term),
        trunc n Δ Δ' -> Δ' ⊢ H : M = N -> Δ ⊣ -> Δ ⊢ H ↑h n : M ↑  n = N ↑  n
  Δ' : list Term
  H : Prf
  M : Term
  N : Term
  Γ : list Term
  x : Term
  H2 : trunc n Γ Δ'
  H5 : Δ' ⊢ H : M = N
  H6 : x :: Γ ⊣
  H0 : trunc (S n) (x :: Γ) Δ'
  ============================
   x :: Γ ⊢ H ↑h (1 + n) : M ↑  (1 + n) = N ↑  (1 + n)

(dependent evars:)


do 2 rewrite_l_rev lift_lift;rewrite_r_rev lift_lift.
1 subgoals, subgoal 1 (ID 5500)
  
  n : nat
  IHn : forall (Δ Δ' : list Term) (H : Prf) (M N : Term),
        trunc n Δ Δ' -> Δ' ⊢ H : M = N -> Δ ⊣ -> Δ ⊢ H ↑h n : M ↑  n = N ↑  n
  Δ' : list Term
  H : Prf
  M : Term
  N : Term
  Γ : list Term
  x : Term
  H2 : trunc n Γ Δ'
  H5 : Δ' ⊢ H : M = N
  H6 : x :: Γ ⊣
  H0 : trunc (S n) (x :: Γ) Δ'
  ============================
   x :: Γ ⊢ H ↑h n ↑h 1 : M ↑  n ↑  1 = N ↑  n ↑  1

(dependent evars:)


inversion H6;subst.
1 subgoals, subgoal 1 (ID 5548)
  
  n : nat
  IHn : forall (Δ Δ' : list Term) (H : Prf) (M N : Term),
        trunc n Δ Δ' -> Δ' ⊢ H : M = N -> Δ ⊣ -> Δ ⊢ H ↑h n : M ↑  n = N ↑  n
  Δ' : list Term
  H : Prf
  M : Term
  N : Term
  Γ : list Term
  x : Term
  H2 : trunc n Γ Δ'
  H5 : Δ' ⊢ H : M = N
  H6 : x :: Γ ⊣
  H0 : trunc (S n) (x :: Γ) Δ'
  s : Sorts
  H3 : Γ ⊢ x : !s
  ============================
   x :: Γ ⊢ H ↑h n ↑h 1 : M ↑  n ↑  1 = N ↑  n ↑  1

(dependent evars:)


eapply thinning_h with s;[eapply IHn;try eapply wf_typ;eassumption|assumption].
No more subgoals.
(dependent evars: ?5551 using , ?5555 using , ?5556 using ,)


Qed.
thinning_n_h is defined



Substitution Property: if a judgment is valid and we replace a variable by a well-typed term of the same type, it will remain valid.

Lemma sub_trunc : forall Δ a A n Γ Γ', sub_in_env Δ a A n Γ Γ' -> trunc n Γ' Δ.
1 subgoals, subgoal 1 (ID 5575)
  
  ============================
   forall (Δ : Env) (a A : Term) (n : nat) (Γ Γ' : Env),
   sub_in_env Δ a A n Γ Γ' -> trunc n Γ' Δ

(dependent evars:)


induction 1;constructor;trivial.
No more subgoals.
(dependent evars:)


Qed.
sub_trunc is defined



Theorem substitution :
(forall Γ M N , Γ M : N -> forall Δ a A Γ' n, Δ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ -> Γ' M [ n a ] : N [ n a ] ) /\
(forall Γ H M N , Γ H:M = N -> forall Δ a A Γ' n, Δ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ -> Γ' H[nh a]:M [ n a ] = N [ n a ] ) /\
(forall Γ , Γ -> forall Δ a A Γ' n, Δ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ).
1 subgoals, subgoal 1 (ID 5634)
  
  ============================
   (forall (Γ : Env) (M N : Term),
    Γ ⊢ M : N ->
    forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
    Δ ⊢ a : A ->
    sub_in_env Δ a A n Γ Γ' -> Γ ⊣ -> Γ' ⊢ M [n ←  a] : N [n ←  a]) /\
   (forall (Γ : Env) (H : Prf) (M N : Term),
    Γ ⊢ H : M = N ->
    forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
    Δ ⊢ a : A ->
    sub_in_env Δ a A n Γ Γ' ->
    Γ ⊣ -> Γ' ⊢ H [n ←h a] : M [n ←  a] = N [n ←  a]) /\
   (forall Γ : Env,
    Γ ⊣ ->
    forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
    Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣)

(dependent evars:)


apply typ_induc; simpl in *; intros;try (econstructor;eauto;fail).
7 subgoals, subgoal 1 (ID 5694)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  i : A ↓ v ⊂ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  ============================
   Γ'
   ⊢ match lt_eq_lt_dec v n with
     | inleft (left _) => #v
     | inleft (right _) => a ↑  n
     | inright _ => #(v - 1)
     end : A [n ←  a]

subgoal 2 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 3 (ID 5779) is:
 Γ' ⊣
subgoal 4 (ID 5791) is:
 Γ' ⊣
subgoal 5 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 6 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 7 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using ,)


destruct lt_eq_lt_dec as [ [] | ].
9 subgoals, subgoal 1 (ID 8865)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  i : A ↓ v ⊂ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : v < n
  ============================
   Γ' ⊢ #v : A [n ←  a]

subgoal 2 (ID 8866) is:
 Γ' ⊢ a ↑  n : A [n ←  a]
subgoal 3 (ID 8867) is:
 Γ' ⊢ #(v - 1) : A [n ←  a]
subgoal 4 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 5 (ID 5779) is:
 Γ' ⊣
subgoal 6 (ID 5791) is:
 Γ' ⊣
subgoal 7 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 8 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 9 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using ,)


constructor.
10 subgoals, subgoal 1 (ID 8870)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  i : A ↓ v ⊂ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : v < n
  ============================
   Γ' ⊣

subgoal 2 (ID 8871) is:
 A [n ←  a] ↓ v ⊂ Γ'
subgoal 3 (ID 8866) is:
 Γ' ⊢ a ↑  n : A [n ←  a]
subgoal 4 (ID 8867) is:
 Γ' ⊢ #(v - 1) : A [n ←  a]
subgoal 5 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 6 (ID 5779) is:
 Γ' ⊣
subgoal 7 (ID 5791) is:
 Γ' ⊣
subgoal 8 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 9 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 10 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using ,)

eapply H; eauto.
9 subgoals, subgoal 1 (ID 8871)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  i : A ↓ v ⊂ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : v < n
  ============================
   A [n ←  a] ↓ v ⊂ Γ'

subgoal 2 (ID 8866) is:
 Γ' ⊢ a ↑  n : A [n ←  a]
subgoal 3 (ID 8867) is:
 Γ' ⊢ #(v - 1) : A [n ←  a]
subgoal 4 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 5 (ID 5779) is:
 Γ' ⊣
subgoal 6 (ID 5791) is:
 Γ' ⊣
subgoal 7 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 8 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 9 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using ,)

eapply nth_sub_item_inf.
11 subgoals, subgoal 1 (ID 8936)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  i : A ↓ v ⊂ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : v < n
  ============================
   sub_in_env ?8934 a ?8933 n ?8935 Γ'

subgoal 2 (ID 8937) is:
 n > v
subgoal 3 (ID 8938) is:
 A ↓ v ⊂ ?8935
subgoal 4 (ID 8866) is:
 Γ' ⊢ a ↑  n : A [n ←  a]
subgoal 5 (ID 8867) is:
 Γ' ⊢ #(v - 1) : A [n ←  a]
subgoal 6 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 7 (ID 5779) is:
 Γ' ⊣
subgoal 8 (ID 5791) is:
 Γ' ⊣
subgoal 9 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 10 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 11 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 open, ?8934 open, ?8935 open,)

apply H1.
10 subgoals, subgoal 1 (ID 8937)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  i : A ↓ v ⊂ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : v < n
  ============================
   n > v

subgoal 2 (ID 8938) is:
 A ↓ v ⊂ Γ
subgoal 3 (ID 8866) is:
 Γ' ⊢ a ↑  n : A [n ←  a]
subgoal 4 (ID 8867) is:
 Γ' ⊢ #(v - 1) : A [n ←  a]
subgoal 5 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 6 (ID 5779) is:
 Γ' ⊣
subgoal 7 (ID 5791) is:
 Γ' ⊣
subgoal 8 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 9 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 10 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using ,)

intuition.
9 subgoals, subgoal 1 (ID 8938)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  i : A ↓ v ⊂ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : v < n
  ============================
   A ↓ v ⊂ Γ

subgoal 2 (ID 8866) is:
 Γ' ⊢ a ↑  n : A [n ←  a]
subgoal 3 (ID 8867) is:
 Γ' ⊢ #(v - 1) : A [n ←  a]
subgoal 4 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 5 (ID 5779) is:
 Γ' ⊣
subgoal 6 (ID 5791) is:
 Γ' ⊣
subgoal 7 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 8 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 9 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using ,)

trivial.
8 subgoals, subgoal 1 (ID 8866)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  i : A ↓ v ⊂ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  e : v = n
  ============================
   Γ' ⊢ a ↑  n : A [n ←  a]

subgoal 2 (ID 8867) is:
 Γ' ⊢ #(v - 1) : A [n ←  a]
subgoal 3 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 4 (ID 5779) is:
 Γ' ⊣
subgoal 5 (ID 5791) is:
 Γ' ⊣
subgoal 6 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 7 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 8 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using ,)


destruct i as (AA & ?& ?).
8 subgoals, subgoal 1 (ID 8949)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  H3 : A = AA ↑  (S v)
  H4 : AA ↓ v ∈ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  e : v = n
  ============================
   Γ' ⊢ a ↑  n : A [n ←  a]

subgoal 2 (ID 8867) is:
 Γ' ⊢ #(v - 1) : A [n ←  a]
subgoal 3 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 4 (ID 5779) is:
 Γ' ⊣
subgoal 5 (ID 5791) is:
 Γ' ⊣
subgoal 6 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 7 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 8 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using ,)

subst.
8 subgoals, subgoal 1 (ID 8958)
  
  Γ : Env
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  H4 : AA ↓ n ∈ Γ
  ============================
   Γ' ⊢ a ↑  n : AA ↑  (S n) [n ←  a]

subgoal 2 (ID 8867) is:
 Γ' ⊢ #(v - 1) : A [n ←  a]
subgoal 3 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 4 (ID 5779) is:
 Γ' ⊣
subgoal 5 (ID 5791) is:
 Γ' ⊣
subgoal 6 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 7 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 8 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using ,)

rewrite_l substP3; intuition.
8 subgoals, subgoal 1 (ID 8962)
  
  Γ : Env
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  H4 : AA ↓ n ∈ Γ
  ============================
   Γ' ⊢ a ↑  n : AA ↑  n

subgoal 2 (ID 8867) is:
 Γ' ⊢ #(v - 1) : A [n ←  a]
subgoal 3 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 4 (ID 5779) is:
 Γ' ⊣
subgoal 5 (ID 5791) is:
 Γ' ⊣
subgoal 6 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 7 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 8 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using ,)


set (subst_item H1).
8 subgoals, subgoal 1 (ID 9014)
  
  Γ : Env
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  H4 : AA ↓ n ∈ Γ
  i := subst_item H1 : A0 ↓ n ∈ Γ
  ============================
   Γ' ⊢ a ↑  n : AA ↑  n

subgoal 2 (ID 8867) is:
 Γ' ⊢ #(v - 1) : A [n ←  a]
subgoal 3 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 4 (ID 5779) is:
 Γ' ⊣
subgoal 5 (ID 5791) is:
 Γ' ⊣
subgoal 6 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 7 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 8 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using ,)


rewrite <- (fun_item i H4).
8 subgoals, subgoal 1 (ID 9020)
  
  Γ : Env
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  H4 : AA ↓ n ∈ Γ
  i := subst_item H1 : A0 ↓ n ∈ Γ
  ============================
   Γ' ⊢ a ↑  n : A0 ↑  n

subgoal 2 (ID 8867) is:
 Γ' ⊢ #(v - 1) : A [n ←  a]
subgoal 3 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 4 (ID 5779) is:
 Γ' ⊣
subgoal 5 (ID 5791) is:
 Γ' ⊣
subgoal 6 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 7 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 8 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using ,)

eapply thinning_n.
10 subgoals, subgoal 1 (ID 9022)
  
  Γ : Env
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  H4 : AA ↓ n ∈ Γ
  i := subst_item H1 : A0 ↓ n ∈ Γ
  ============================
   trunc n Γ' ?9021

subgoal 2 (ID 9023) is:
 ?9021 ⊢ a : A0
subgoal 3 (ID 9024) is:
 Γ' ⊣
subgoal 4 (ID 8867) is:
 Γ' ⊢ #(v - 1) : A [n ←  a]
subgoal 5 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 6 (ID 5779) is:
 Γ' ⊣
subgoal 7 (ID 5791) is:
 Γ' ⊣
subgoal 8 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 9 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 10 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 open,)

eapply sub_trunc.
10 subgoals, subgoal 1 (ID 9028)
  
  Γ : Env
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  H4 : AA ↓ n ∈ Γ
  i := subst_item H1 : A0 ↓ n ∈ Γ
  ============================
   sub_in_env ?9021 ?9025 ?9026 n ?9027 Γ'

subgoal 2 (ID 9023) is:
 ?9021 ⊢ a : A0
subgoal 3 (ID 9024) is:
 Γ' ⊣
subgoal 4 (ID 8867) is:
 Γ' ⊢ #(v - 1) : A [n ←  a]
subgoal 5 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 6 (ID 5779) is:
 Γ' ⊣
subgoal 7 (ID 5791) is:
 Γ' ⊣
subgoal 8 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 9 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 10 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 open, ?9025 open, ?9026 open, ?9027 open,)

apply H1.
9 subgoals, subgoal 1 (ID 9023)
  
  Γ : Env
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  H4 : AA ↓ n ∈ Γ
  i := subst_item H1 : A0 ↓ n ∈ Γ
  ============================
   Δ ⊢ a : A0

subgoal 2 (ID 9024) is:
 Γ' ⊣
subgoal 3 (ID 8867) is:
 Γ' ⊢ #(v - 1) : A [n ←  a]
subgoal 4 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 5 (ID 5779) is:
 Γ' ⊣
subgoal 6 (ID 5791) is:
 Γ' ⊣
subgoal 7 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 8 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 9 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using ,)

trivial.
8 subgoals, subgoal 1 (ID 9024)
  
  Γ : Env
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  H4 : AA ↓ n ∈ Γ
  i := subst_item H1 : A0 ↓ n ∈ Γ
  ============================
   Γ' ⊣

subgoal 2 (ID 8867) is:
 Γ' ⊢ #(v - 1) : A [n ←  a]
subgoal 3 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 4 (ID 5779) is:
 Γ' ⊣
subgoal 5 (ID 5791) is:
 Γ' ⊣
subgoal 6 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 7 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 8 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using ,)


eapply H; eauto.
7 subgoals, subgoal 1 (ID 8867)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  i : A ↓ v ⊂ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < v
  ============================
   Γ' ⊢ #(v - 1) : A [n ←  a]

subgoal 2 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 3 (ID 5779) is:
 Γ' ⊣
subgoal 4 (ID 5791) is:
 Γ' ⊣
subgoal 5 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 6 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 7 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using ,)

constructor.
8 subgoals, subgoal 1 (ID 9092)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  i : A ↓ v ⊂ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < v
  ============================
   Γ' ⊣

subgoal 2 (ID 9093) is:
 A [n ←  a] ↓ v - 1 ⊂ Γ'
subgoal 3 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 4 (ID 5779) is:
 Γ' ⊣
subgoal 5 (ID 5791) is:
 Γ' ⊣
subgoal 6 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 7 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 8 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using ,)

eapply H; eauto.
7 subgoals, subgoal 1 (ID 9093)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  i : A ↓ v ⊂ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < v
  ============================
   A [n ←  a] ↓ v - 1 ⊂ Γ'

subgoal 2 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 3 (ID 5779) is:
 Γ' ⊣
subgoal 4 (ID 5791) is:
 Γ' ⊣
subgoal 5 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 6 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 7 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using ,)

destruct i as (AA & ? &?).
7 subgoals, subgoal 1 (ID 9165)
  
  Γ : Env
  A : Term
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  H3 : A = AA ↑  (S v)
  H4 : AA ↓ v ∈ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < v
  ============================
   A [n ←  a] ↓ v - 1 ⊂ Γ'

subgoal 2 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 3 (ID 5779) is:
 Γ' ⊣
subgoal 4 (ID 5791) is:
 Γ' ⊣
subgoal 5 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 6 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 7 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using ,)

subst.
7 subgoals, subgoal 1 (ID 9168)
  
  Γ : Env
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  H4 : AA ↓ v ∈ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < v
  ============================
   AA ↑  (S v) [n ←  a] ↓ v - 1 ⊂ Γ'

subgoal 2 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 3 (ID 5779) is:
 Γ' ⊣
subgoal 4 (ID 5791) is:
 Γ' ⊣
subgoal 5 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 6 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 7 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using ,)


rewrite_l substP3; intuition.
7 subgoals, subgoal 1 (ID 9172)
  
  Γ : Env
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  H4 : AA ↓ v ∈ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < v
  ============================
   AA ↑  v ↓ v - 1 ⊂ Γ'

subgoal 2 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 3 (ID 5779) is:
 Γ' ⊣
subgoal 4 (ID 5791) is:
 Γ' ⊣
subgoal 5 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 6 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 7 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using ,)

exists AA; split.
8 subgoals, subgoal 1 (ID 9236)
  
  Γ : Env
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  H4 : AA ↓ v ∈ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < v
  ============================
   AA ↑  v = AA ↑  (S (v - 1))

subgoal 2 (ID 9237) is:
 AA ↓ v - 1 ∈ Γ'
subgoal 3 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 4 (ID 5779) is:
 Γ' ⊣
subgoal 5 (ID 5791) is:
 Γ' ⊣
subgoal 6 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 7 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 8 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using ,)

replace (S (v-1)) with v.
9 subgoals, subgoal 1 (ID 9241)
  
  Γ : Env
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  H4 : AA ↓ v ∈ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < v
  ============================
   AA ↑  v = AA ↑  v

subgoal 2 (ID 9238) is:
 v = S (v - 1)
subgoal 3 (ID 9237) is:
 AA ↓ v - 1 ∈ Γ'
subgoal 4 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 5 (ID 5779) is:
 Γ' ⊣
subgoal 6 (ID 5791) is:
 Γ' ⊣
subgoal 7 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 8 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 9 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using ,)

trivial.
8 subgoals, subgoal 1 (ID 9238)
  
  Γ : Env
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  H4 : AA ↓ v ∈ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < v
  ============================
   v = S (v - 1)

subgoal 2 (ID 9237) is:
 AA ↓ v - 1 ∈ Γ'
subgoal 3 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 4 (ID 5779) is:
 Γ' ⊣
subgoal 5 (ID 5791) is:
 Γ' ⊣
subgoal 6 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 7 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 8 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using ,)


rewrite minus_Sn_m.
9 subgoals, subgoal 1 (ID 9243)
  
  Γ : Env
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  H4 : AA ↓ v ∈ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < v
  ============================
   v = S v - 1

subgoal 2 (ID 9244) is:
 1 <= v
subgoal 3 (ID 9237) is:
 AA ↓ v - 1 ∈ Γ'
subgoal 4 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 5 (ID 5779) is:
 Γ' ⊣
subgoal 6 (ID 5791) is:
 Γ' ⊣
subgoal 7 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 8 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 9 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using ,)

intuition.
8 subgoals, subgoal 1 (ID 9244)
  
  Γ : Env
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  H4 : AA ↓ v ∈ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < v
  ============================
   1 <= v

subgoal 2 (ID 9237) is:
 AA ↓ v - 1 ∈ Γ'
subgoal 3 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 4 (ID 5779) is:
 Γ' ⊣
subgoal 5 (ID 5791) is:
 Γ' ⊣
subgoal 6 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 7 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 8 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using ,)

destruct v.
9 subgoals, subgoal 1 (ID 9271)
  
  Γ : Env
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  H4 : AA ↓ 0 ∈ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < 0
  ============================
   1 <= 0

subgoal 2 (ID 9276) is:
 1 <= S v
subgoal 3 (ID 9237) is:
 AA ↓ v - 1 ∈ Γ'
subgoal 4 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 5 (ID 5779) is:
 Γ' ⊣
subgoal 6 (ID 5791) is:
 Γ' ⊣
subgoal 7 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 8 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 9 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using ,)

apply lt_n_O in l; elim l.
8 subgoals, subgoal 1 (ID 9276)
  
  Γ : Env
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  H4 : AA ↓ S v ∈ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < S v
  ============================
   1 <= S v

subgoal 2 (ID 9237) is:
 AA ↓ v - 1 ∈ Γ'
subgoal 3 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 4 (ID 5779) is:
 Γ' ⊣
subgoal 5 (ID 5791) is:
 Γ' ⊣
subgoal 6 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 7 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 8 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using ,)

intuition.
7 subgoals, subgoal 1 (ID 9237)
  
  Γ : Env
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  H4 : AA ↓ v ∈ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < v
  ============================
   AA ↓ v - 1 ∈ Γ'

subgoal 2 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 3 (ID 5779) is:
 Γ' ⊣
subgoal 4 (ID 5791) is:
 Γ' ⊣
subgoal 5 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 6 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 7 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using ,)


eapply nth_sub_sup.
9 subgoals, subgoal 1 (ID 9301)
  
  Γ : Env
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  H4 : AA ↓ v ∈ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < v
  ============================
   sub_in_env ?9297 ?9299 ?9300 ?9296 ?9298 Γ'

subgoal 2 (ID 9302) is:
 ?9296 <= v - 1
subgoal 3 (ID 9303) is:
 AA ↓ S (v - 1) ∈ ?9298
subgoal 4 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 5 (ID 5779) is:
 Γ' ⊣
subgoal 6 (ID 5791) is:
 Γ' ⊣
subgoal 7 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 8 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 9 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 open, ?9297 open, ?9298 open, ?9299 open, ?9300 open,)

apply H1.
8 subgoals, subgoal 1 (ID 9302)
  
  Γ : Env
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  H4 : AA ↓ v ∈ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < v
  ============================
   n <= v - 1

subgoal 2 (ID 9303) is:
 AA ↓ S (v - 1) ∈ Γ
subgoal 3 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 4 (ID 5779) is:
 Γ' ⊣
subgoal 5 (ID 5791) is:
 Γ' ⊣
subgoal 6 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 7 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 8 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using ,)

destruct v.
9 subgoals, subgoal 1 (ID 9312)
  
  Γ : Env
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  H4 : AA ↓ 0 ∈ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < 0
  ============================
   n <= 0 - 1

subgoal 2 (ID 9317) is:
 n <= S v - 1
subgoal 3 (ID 9303) is:
 AA ↓ S (v - 1) ∈ Γ
subgoal 4 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 5 (ID 5779) is:
 Γ' ⊣
subgoal 6 (ID 5791) is:
 Γ' ⊣
subgoal 7 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 8 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 9 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using ,)

apply lt_n_O in l; elim l.
8 subgoals, subgoal 1 (ID 9317)
  
  Γ : Env
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  H4 : AA ↓ S v ∈ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < S v
  ============================
   n <= S v - 1

subgoal 2 (ID 9303) is:
 AA ↓ S (v - 1) ∈ Γ
subgoal 3 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 4 (ID 5779) is:
 Γ' ⊣
subgoal 5 (ID 5791) is:
 Γ' ⊣
subgoal 6 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 7 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 8 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using ,)

simpl.
8 subgoals, subgoal 1 (ID 9320)
  
  Γ : Env
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  H4 : AA ↓ S v ∈ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < S v
  ============================
   n <= v - 0

subgoal 2 (ID 9303) is:
 AA ↓ S (v - 1) ∈ Γ
subgoal 3 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 4 (ID 5779) is:
 Γ' ⊣
subgoal 5 (ID 5791) is:
 Γ' ⊣
subgoal 6 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 7 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 8 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using ,)

rewrite <- minus_n_O.
8 subgoals, subgoal 1 (ID 9321)
  
  Γ : Env
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  H4 : AA ↓ S v ∈ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < S v
  ============================
   n <= v

subgoal 2 (ID 9303) is:
 AA ↓ S (v - 1) ∈ Γ
subgoal 3 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 4 (ID 5779) is:
 Γ' ⊣
subgoal 5 (ID 5791) is:
 Γ' ⊣
subgoal 6 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 7 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 8 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using ,)


intuition.
7 subgoals, subgoal 1 (ID 9303)
  
  Γ : Env
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  H4 : AA ↓ v ∈ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < v
  ============================
   AA ↓ S (v - 1) ∈ Γ

subgoal 2 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 3 (ID 5779) is:
 Γ' ⊣
subgoal 4 (ID 5791) is:
 Γ' ⊣
subgoal 5 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 6 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 7 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using ,)

rewrite <- pred_of_minus.
7 subgoals, subgoal 1 (ID 9339)
  
  Γ : Env
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  H4 : AA ↓ v ∈ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < v
  ============================
   AA ↓ S (pred v) ∈ Γ

subgoal 2 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 3 (ID 5779) is:
 Γ' ⊣
subgoal 4 (ID 5791) is:
 Γ' ⊣
subgoal 5 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 6 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 7 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using ,)

rewrite <- (S_pred v n l).
7 subgoals, subgoal 1 (ID 9340)
  
  Γ : Env
  v : nat
  w : Γ ⊣
  H : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ' ⊣
  AA : Term
  H4 : AA ↓ v ∈ Γ
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n Γ Γ'
  H2 : Γ ⊣
  l : n < v
  ============================
   AA ↓ v ∈ Γ

subgoal 2 (ID 5752) is:
 Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]
subgoal 3 (ID 5779) is:
 Γ' ⊣
subgoal 4 (ID 5791) is:
 Γ' ⊣
subgoal 5 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 6 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 7 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using ,)

trivial.
6 subgoals, subgoal 1 (ID 5752)
  
  Γ : Env
  F : Term
  a : Term
  A : Term
  B : Term
  t : Γ ⊢ F : Π (A), B
  H : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A0 ->
      sub_in_env Δ a A0 n Γ Γ' ->
      Γ ⊣ -> Γ' ⊢ F [n ←  a] : Π (A [n ←  a]), B [(S n) ←  a]
  t0 : Γ ⊢ a : A
  H0 : forall (Δ : Env) (a0 A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a0 : A0 ->
       sub_in_env Δ a0 A0 n Γ Γ' -> Γ ⊣ -> Γ' ⊢ a [n ←  a0] : A [n ←  a0]
  Δ : Env
  a0 : Term
  A0 : Term
  Γ' : Env
  n : nat
  H1 : Δ ⊢ a0 : A0
  H2 : sub_in_env Δ a0 A0 n Γ Γ'
  H3 : Γ ⊣
  ============================
   Γ' ⊢ F [n ←  a0] · a [n ←  a0] : B [ ← a] [n ←  a0]

subgoal 2 (ID 5779) is:
 Γ' ⊣
subgoal 3 (ID 5791) is:
 Γ' ⊣
subgoal 4 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 5 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 6 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using ,)


rewrite_l subst_travers.
6 subgoals, subgoal 1 (ID 9344)
  
  Γ : Env
  F : Term
  a : Term
  A : Term
  B : Term
  t : Γ ⊢ F : Π (A), B
  H : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A0 ->
      sub_in_env Δ a A0 n Γ Γ' ->
      Γ ⊣ -> Γ' ⊢ F [n ←  a] : Π (A [n ←  a]), B [(S n) ←  a]
  t0 : Γ ⊢ a : A
  H0 : forall (Δ : Env) (a0 A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a0 : A0 ->
       sub_in_env Δ a0 A0 n Γ Γ' -> Γ ⊣ -> Γ' ⊢ a [n ←  a0] : A [n ←  a0]
  Δ : Env
  a0 : Term
  A0 : Term
  Γ' : Env
  n : nat
  H1 : Δ ⊢ a0 : A0
  H2 : sub_in_env Δ a0 A0 n Γ Γ'
  H3 : Γ ⊣
  ============================
   Γ' ⊢ F [n ←  a0] · a [n ←  a0] : (B [(n + 1) ←  a0]) [ ← a [n ←  a0]]

subgoal 2 (ID 5779) is:
 Γ' ⊣
subgoal 3 (ID 5791) is:
 Γ' ⊣
subgoal 4 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 5 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 6 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using ,)

replace (n+1) with (S n) by (rewrite plus_comm; trivial); eauto.
5 subgoals, subgoal 1 (ID 5779)
  
  Δ : Env
  a : Term
  A : Term
  Γ' : Env
  n : nat
  H : Δ ⊢ a : A
  H0 : sub_in_env Δ a A n nil Γ'
  ============================
   Γ' ⊣

subgoal 2 (ID 5791) is:
 Γ' ⊣
subgoal 3 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 4 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 5 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using , ?9351 using , ?9354 using , ?9355 using , ?9362 using , ?9363 using ,)


inversion H0.
4 subgoals, subgoal 1 (ID 5791)
  
  Γ : Env
  A : Term
  s : Sorts
  t : Γ ⊢ A : !s
  H : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A0 -> sub_in_env Δ a A0 n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A [n ←  a] : !s
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H0 : Δ ⊢ a : A0
  H1 : sub_in_env Δ a A0 n (A :: Γ) Γ'
  ============================
   Γ' ⊣

subgoal 2 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 3 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 4 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using , ?9351 using , ?9354 using , ?9355 using , ?9362 using , ?9363 using ,)


inversion H1; subst.
5 subgoals, subgoal 1 (ID 9509)
  
  A : Term
  s : Sorts
  a : Term
  Γ' : Env
  t : Γ' ⊢ A : !s
  H : forall (Δ : Env) (a A0 : Term) (Γ'0 : Env) (n : nat),
      Δ ⊢ a : A0 ->
      sub_in_env Δ a A0 n Γ' Γ'0 -> Γ' ⊣ -> Γ'0 ⊢ A [n ←  a] : !s
  H0 : Γ' ⊢ a : A
  H1 : sub_in_env Γ' a A 0 (A :: Γ') Γ'
  ============================
   Γ' ⊣

subgoal 2 (ID 9521) is:
 A [n0 ←  a] :: Δ' ⊣
subgoal 3 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 4 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 5 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using , ?9351 using , ?9354 using , ?9355 using , ?9362 using , ?9363 using ,)

eauto.
4 subgoals, subgoal 1 (ID 9521)
  
  Γ : Env
  A : Term
  s : Sorts
  t : Γ ⊢ A : !s
  H : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A0 -> sub_in_env Δ a A0 n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A [n ←  a] : !s
  Δ : Env
  a : Term
  A0 : Term
  H0 : Δ ⊢ a : A0
  Δ' : Env
  n0 : nat
  H6 : sub_in_env Δ a A0 n0 Γ Δ'
  H1 : sub_in_env Δ a A0 (S n0) (A :: Γ) (A [n0 ←  a] :: Δ')
  ============================
   A [n0 ←  a] :: Δ' ⊣

subgoal 2 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 3 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 4 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using , ?9351 using , ?9354 using , ?9355 using , ?9362 using , ?9363 using , ?9522 using , ?9523 using ,)


econstructor.
4 subgoals, subgoal 1 (ID 9593)
  
  Γ : Env
  A : Term
  s : Sorts
  t : Γ ⊢ A : !s
  H : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A0 -> sub_in_env Δ a A0 n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A [n ←  a] : !s
  Δ : Env
  a : Term
  A0 : Term
  H0 : Δ ⊢ a : A0
  Δ' : Env
  n0 : nat
  H6 : sub_in_env Δ a A0 n0 Γ Δ'
  H1 : sub_in_env Δ a A0 (S n0) (A :: Γ) (A [n0 ←  a] :: Δ')
  ============================
   Δ' ⊢ A [n0 ←  a] : !?9592

subgoal 2 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 3 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 4 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using , ?9351 using , ?9354 using , ?9355 using , ?9362 using , ?9363 using , ?9522 using , ?9523 using , ?9592 open,)

eapply H.
6 subgoals, subgoal 1 (ID 9596)
  
  Γ : Env
  A : Term
  s : Sorts
  t : Γ ⊢ A : !s
  H : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A0 -> sub_in_env Δ a A0 n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A [n ←  a] : !s
  Δ : Env
  a : Term
  A0 : Term
  H0 : Δ ⊢ a : A0
  Δ' : Env
  n0 : nat
  H6 : sub_in_env Δ a A0 n0 Γ Δ'
  H1 : sub_in_env Δ a A0 (S n0) (A :: Γ) (A [n0 ←  a] :: Δ')
  ============================
   ?9594 ⊢ a : ?9595

subgoal 2 (ID 9597) is:
 sub_in_env ?9594 a ?9595 n0 Γ Δ'
subgoal 3 (ID 9598) is:
 Γ ⊣
subgoal 4 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 5 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 6 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using , ?9351 using , ?9354 using , ?9355 using , ?9362 using , ?9363 using , ?9522 using , ?9523 using , ?9592 using , ?9594 open, ?9595 open,)

apply H0.
5 subgoals, subgoal 1 (ID 9597)
  
  Γ : Env
  A : Term
  s : Sorts
  t : Γ ⊢ A : !s
  H : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A0 -> sub_in_env Δ a A0 n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A [n ←  a] : !s
  Δ : Env
  a : Term
  A0 : Term
  H0 : Δ ⊢ a : A0
  Δ' : Env
  n0 : nat
  H6 : sub_in_env Δ a A0 n0 Γ Δ'
  H1 : sub_in_env Δ a A0 (S n0) (A :: Γ) (A [n0 ←  a] :: Δ')
  ============================
   sub_in_env Δ a A0 n0 Γ Δ'

subgoal 2 (ID 9598) is:
 Γ ⊣
subgoal 3 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 4 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 5 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using , ?9351 using , ?9354 using , ?9355 using , ?9362 using , ?9363 using , ?9522 using , ?9523 using , ?9592 using , ?9594 using , ?9595 using ,)

trivial.
4 subgoals, subgoal 1 (ID 9598)
  
  Γ : Env
  A : Term
  s : Sorts
  t : Γ ⊢ A : !s
  H : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a : A0 -> sub_in_env Δ a A0 n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A [n ←  a] : !s
  Δ : Env
  a : Term
  A0 : Term
  H0 : Δ ⊢ a : A0
  Δ' : Env
  n0 : nat
  H6 : sub_in_env Δ a A0 n0 Γ Δ'
  H1 : sub_in_env Δ a A0 (S n0) (A :: Γ) (A [n0 ←  a] :: Δ')
  ============================
   Γ ⊣

subgoal 2 (ID 5861) is:
 Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
 : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
 b [ ← a] [n ←  a0]
subgoal 3 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 4 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using , ?9351 using , ?9354 using , ?9355 using , ?9362 using , ?9363 using , ?9522 using , ?9523 using , ?9592 using , ?9594 using , ?9595 using ,)

eauto.
3 subgoals, subgoal 1 (ID 5861)
  
  Γ : Env
  a : Term
  A : Term
  b : Term
  B : Term
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  r : Rel s1 s2 s3
  t : Γ ⊢ a : A
  H : forall (Δ : Env) (a0 A0 : Term) (Γ' : Env) (n : nat),
      Δ ⊢ a0 : A0 ->
      sub_in_env Δ a0 A0 n Γ Γ' -> Γ ⊣ -> Γ' ⊢ a [n ←  a0] : A [n ←  a0]
  t0 : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 -> sub_in_env Δ a A0 n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A [n ←  a] : !s1
  t1 : A :: Γ ⊢ b : B
  H1 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' ->
       A :: Γ ⊣ -> Γ' ⊢ b [n ←  a] : B [n ←  a]
  t2 : A :: Γ ⊢ B : !s2
  H2 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' -> A :: Γ ⊣ -> Γ' ⊢ B [n ←  a] : !s2
  Δ : Env
  a0 : Term
  A0 : Term
  Γ' : Env
  n : nat
  H3 : Δ ⊢ a0 : A0
  H4 : sub_in_env Δ a0 A0 n Γ Γ'
  H5 : Γ ⊣
  ============================
   Γ' ⊢ β((λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0])
   : (λ [A [n ←  a0]], b [(S n) ←  a0]) · a [n ←  a0] = 
   b [ ← a] [n ←  a0]

subgoal 2 (ID 5896) is:
 Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
 : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]
subgoal 3 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using , ?9351 using , ?9354 using , ?9355 using , ?9362 using , ?9363 using , ?9522 using , ?9523 using , ?9592 using , ?9594 using , ?9595 using , ?9599 using , ?9600 using ,)


rewrite_l subst_travers;replace (n+1) with (S n) by (rewrite plus_comm; trivial);econstructor;eauto.
2 subgoals, subgoal 1 (ID 5896)
  
  Γ : Env
  A : Term
  A' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 -> sub_in_env Δ a A0 n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A [n ←  a] : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A' [n ←  a] : !s1'
  t1 : A :: Γ ⊢ B : !s2
  H2 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' -> A :: Γ ⊣ -> Γ' ⊢ B [n ←  a] : !s2
  t2 : A' :: Γ ⊢ B' : !s2'
  H3 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A ->
       sub_in_env Δ a A n (A' :: Γ) Γ' ->
       A' :: Γ ⊣ -> Γ' ⊢ B' [n ←  a] : !s2'
  t3 : Γ ⊢ H : A = A'
  H4 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n Γ Γ' ->
       Γ ⊣ -> Γ' ⊢ H [n ←h a] : A [n ←  a] = A' [n ←  a]
  t4 : A :: Γ ⊢ K : B = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H5 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' ->
       A :: Γ ⊣ ->
       Γ' ⊢ K [n ←h a] : B [n ←  a] = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] [n ←  a]
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H6 : Δ ⊢ a : A0
  H7 : sub_in_env Δ a A0 n Γ Γ'
  H8 : Γ ⊣
  ============================
   Γ' ⊢ {H [n ←h a], [A [n ←  a]]K [(S n) ←h a]}
   : Π (A [n ←  a]), B [(S n) ←  a] = Π (A' [n ←  a]), B' [(S n) ←  a]

subgoal 2 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using , ?9351 using , ?9354 using , ?9355 using , ?9362 using , ?9363 using , ?9522 using , ?9523 using , ?9592 using , ?9594 using , ?9595 using , ?9599 using , ?9600 using , ?9681 using , ?9682 using , ?9683 using , ?9684 using , ?9690 using , ?9691 using , ?9698 using , ?9699 using , ?9706 using , ?9707 using , ?9712 using , ?9717 using , ?9718 using , ?9723 using ,)


econstructor;[exact r|exact r0|eauto..].
2 subgoals, subgoal 1 (ID 9746)
  
  Γ : Env
  A : Term
  A' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 -> sub_in_env Δ a A0 n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A [n ←  a] : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A' [n ←  a] : !s1'
  t1 : A :: Γ ⊢ B : !s2
  H2 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' -> A :: Γ ⊣ -> Γ' ⊢ B [n ←  a] : !s2
  t2 : A' :: Γ ⊢ B' : !s2'
  H3 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A ->
       sub_in_env Δ a A n (A' :: Γ) Γ' ->
       A' :: Γ ⊣ -> Γ' ⊢ B' [n ←  a] : !s2'
  t3 : Γ ⊢ H : A = A'
  H4 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n Γ Γ' ->
       Γ ⊣ -> Γ' ⊢ H [n ←h a] : A [n ←  a] = A' [n ←  a]
  t4 : A :: Γ ⊢ K : B = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H5 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' ->
       A :: Γ ⊣ ->
       Γ' ⊢ K [n ←h a] : B [n ←  a] = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] [n ←  a]
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H6 : Δ ⊢ a : A0
  H7 : sub_in_env Δ a A0 n Γ Γ'
  H8 : Γ ⊣
  ============================
   A [n ←  a] :: Γ' ⊢ K [(S n) ←h a] : B [(S n) ←  a] =
   (B' [(S n) ←  a] ↑  1 # 1) [ ← #0 ∽ H [n ←h a] ↑h 1]

subgoal 2 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using , ?9351 using , ?9354 using , ?9355 using , ?9362 using , ?9363 using , ?9522 using , ?9523 using , ?9592 using , ?9594 using , ?9595 using , ?9599 using , ?9600 using , ?9681 using , ?9682 using , ?9683 using , ?9684 using , ?9690 using , ?9691 using , ?9698 using , ?9699 using , ?9706 using , ?9707 using , ?9712 using , ?9717 using , ?9718 using , ?9723 using , ?9733 using , ?9734 using , ?9735 using , ?9736 using , ?9737 using , ?9738 using , ?9747 using , ?9748 using , ?9755 using , ?9756 using , ?9763 using , ?9764 using , ?9769 using , ?9774 using , ?9775 using , ?9780 using , ?9785 using , ?9786 using ,)


rewrite_l_rev substP2;intuition;rewrite_r_rev substP2;intuition.
2 subgoals, subgoal 1 (ID 9874)
  
  Γ : Env
  A : Term
  A' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 -> sub_in_env Δ a A0 n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A [n ←  a] : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A' [n ←  a] : !s1'
  t1 : A :: Γ ⊢ B : !s2
  H2 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' -> A :: Γ ⊣ -> Γ' ⊢ B [n ←  a] : !s2
  t2 : A' :: Γ ⊢ B' : !s2'
  H3 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A ->
       sub_in_env Δ a A n (A' :: Γ) Γ' ->
       A' :: Γ ⊣ -> Γ' ⊢ B' [n ←  a] : !s2'
  t3 : Γ ⊢ H : A = A'
  H4 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n Γ Γ' ->
       Γ ⊣ -> Γ' ⊢ H [n ←h a] : A [n ←  a] = A' [n ←  a]
  t4 : A :: Γ ⊢ K : B = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H5 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' ->
       A :: Γ ⊣ ->
       Γ' ⊢ K [n ←h a] : B [n ←  a] = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] [n ←  a]
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H6 : Δ ⊢ a : A0
  H7 : sub_in_env Δ a A0 n Γ Γ'
  H8 : Γ ⊣
  ============================
   A [n ←  a] :: Γ' ⊢ K [(S n) ←h a] : B [(S n) ←  a] =
   (B' ↑  1 # 1 [(1 + S n) ←  a]) [ ← #0 ∽ H ↑h 1 [(1 + n) ←h a]]

subgoal 2 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using , ?9351 using , ?9354 using , ?9355 using , ?9362 using , ?9363 using , ?9522 using , ?9523 using , ?9592 using , ?9594 using , ?9595 using , ?9599 using , ?9600 using , ?9681 using , ?9682 using , ?9683 using , ?9684 using , ?9690 using , ?9691 using , ?9698 using , ?9699 using , ?9706 using , ?9707 using , ?9712 using , ?9717 using , ?9718 using , ?9723 using , ?9733 using , ?9734 using , ?9735 using , ?9736 using , ?9737 using , ?9738 using , ?9747 using , ?9748 using , ?9755 using , ?9756 using , ?9763 using , ?9764 using , ?9769 using , ?9774 using , ?9775 using , ?9780 using , ?9785 using , ?9786 using ,)


change (1+S n) with (S(0+S n)).
2 subgoals, subgoal 1 (ID 9949)
  
  Γ : Env
  A : Term
  A' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 -> sub_in_env Δ a A0 n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A [n ←  a] : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A' [n ←  a] : !s1'
  t1 : A :: Γ ⊢ B : !s2
  H2 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' -> A :: Γ ⊣ -> Γ' ⊢ B [n ←  a] : !s2
  t2 : A' :: Γ ⊢ B' : !s2'
  H3 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A ->
       sub_in_env Δ a A n (A' :: Γ) Γ' ->
       A' :: Γ ⊣ -> Γ' ⊢ B' [n ←  a] : !s2'
  t3 : Γ ⊢ H : A = A'
  H4 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n Γ Γ' ->
       Γ ⊣ -> Γ' ⊢ H [n ←h a] : A [n ←  a] = A' [n ←  a]
  t4 : A :: Γ ⊢ K : B = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H5 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' ->
       A :: Γ ⊣ ->
       Γ' ⊢ K [n ←h a] : B [n ←  a] = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] [n ←  a]
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H6 : Δ ⊢ a : A0
  H7 : sub_in_env Δ a A0 n Γ Γ'
  H8 : Γ ⊣
  ============================
   A [n ←  a] :: Γ' ⊢ K [(S n) ←h a] : B [(S n) ←  a] =
   (B' ↑  1 # 1 [(S (0 + S n)) ←  a]) [ ← #0 ∽ H ↑h 1 [(1 + n) ←h a]]

subgoal 2 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using , ?9351 using , ?9354 using , ?9355 using , ?9362 using , ?9363 using , ?9522 using , ?9523 using , ?9592 using , ?9594 using , ?9595 using , ?9599 using , ?9600 using , ?9681 using , ?9682 using , ?9683 using , ?9684 using , ?9690 using , ?9691 using , ?9698 using , ?9699 using , ?9706 using , ?9707 using , ?9712 using , ?9717 using , ?9718 using , ?9723 using , ?9733 using , ?9734 using , ?9735 using , ?9736 using , ?9737 using , ?9738 using , ?9747 using , ?9748 using , ?9755 using , ?9756 using , ?9763 using , ?9764 using , ?9769 using , ?9774 using , ?9775 using , ?9780 using , ?9785 using , ?9786 using ,)


change (#0 H h 1 [(1 + n) h a]) with ((#0 H h 1) [(S n) a]).
2 subgoals, subgoal 1 (ID 9951)
  
  Γ : Env
  A : Term
  A' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 -> sub_in_env Δ a A0 n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A [n ←  a] : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A' [n ←  a] : !s1'
  t1 : A :: Γ ⊢ B : !s2
  H2 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' -> A :: Γ ⊣ -> Γ' ⊢ B [n ←  a] : !s2
  t2 : A' :: Γ ⊢ B' : !s2'
  H3 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A ->
       sub_in_env Δ a A n (A' :: Γ) Γ' ->
       A' :: Γ ⊣ -> Γ' ⊢ B' [n ←  a] : !s2'
  t3 : Γ ⊢ H : A = A'
  H4 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n Γ Γ' ->
       Γ ⊣ -> Γ' ⊢ H [n ←h a] : A [n ←  a] = A' [n ←  a]
  t4 : A :: Γ ⊢ K : B = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H5 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' ->
       A :: Γ ⊣ ->
       Γ' ⊢ K [n ←h a] : B [n ←  a] = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] [n ←  a]
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H6 : Δ ⊢ a : A0
  H7 : sub_in_env Δ a A0 n Γ Γ'
  H8 : Γ ⊣
  ============================
   A [n ←  a] :: Γ' ⊢ K [(S n) ←h a] : B [(S n) ←  a] =
   (B' ↑  1 # 1 [(S (0 + S n)) ←  a]) [ ← (#0 ∽ H ↑h 1) [(S n) ←  a]]

subgoal 2 (ID 5937) is:
 Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
 : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using , ?9351 using , ?9354 using , ?9355 using , ?9362 using , ?9363 using , ?9522 using , ?9523 using , ?9592 using , ?9594 using , ?9595 using , ?9599 using , ?9600 using , ?9681 using , ?9682 using , ?9683 using , ?9684 using , ?9690 using , ?9691 using , ?9698 using , ?9699 using , ?9706 using , ?9707 using , ?9712 using , ?9717 using , ?9718 using , ?9723 using , ?9733 using , ?9734 using , ?9735 using , ?9736 using , ?9737 using , ?9738 using , ?9747 using , ?9748 using , ?9755 using , ?9756 using , ?9763 using , ?9764 using , ?9769 using , ?9774 using , ?9775 using , ?9780 using , ?9785 using , ?9786 using ,)


rewrite_l_rev substP4;simpl;eauto.
1 subgoals, subgoal 1 (ID 5937)
  
  Γ : Env
  A : Term
  A' : Term
  b : Term
  b' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 -> sub_in_env Δ a A0 n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A [n ←  a] : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A' [n ←  a] : !s1'
  t1 : A :: Γ ⊢ b : B
  H2 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' ->
       A :: Γ ⊣ -> Γ' ⊢ b [n ←  a] : B [n ←  a]
  t2 : A' :: Γ ⊢ b' : B'
  H3 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A ->
       sub_in_env Δ a A n (A' :: Γ) Γ' ->
       A' :: Γ ⊣ -> Γ' ⊢ b' [n ←  a] : B' [n ←  a]
  t3 : A :: Γ ⊢ B : !s2
  H4 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' -> A :: Γ ⊣ -> Γ' ⊢ B [n ←  a] : !s2
  t4 : A' :: Γ ⊢ B' : !s2'
  H5 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A ->
       sub_in_env Δ a A n (A' :: Γ) Γ' ->
       A' :: Γ ⊣ -> Γ' ⊢ B' [n ←  a] : !s2'
  t5 : Γ ⊢ H : A = A'
  H6 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n Γ Γ' ->
       Γ ⊣ -> Γ' ⊢ H [n ←h a] : A [n ←  a] = A' [n ←  a]
  t6 : A :: Γ ⊢ K : b = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H7 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' ->
       A :: Γ ⊣ ->
       Γ' ⊢ K [n ←h a] : b [n ←  a] = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] [n ←  a]
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H8 : Δ ⊢ a : A0
  H9 : sub_in_env Δ a A0 n Γ Γ'
  H10 : Γ ⊣
  ============================
   Γ' ⊢ ⟨H [n ←h a], [A [n ←  a]]K [(S n) ←h a] ⟩
   : λ [A [n ←  a]], b [(S n) ←  a] = λ [A' [n ←  a]], b' [(S n) ←  a]

(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using , ?9351 using , ?9354 using , ?9355 using , ?9362 using , ?9363 using , ?9522 using , ?9523 using , ?9592 using , ?9594 using , ?9595 using , ?9599 using , ?9600 using , ?9681 using , ?9682 using , ?9683 using , ?9684 using , ?9690 using , ?9691 using , ?9698 using , ?9699 using , ?9706 using , ?9707 using , ?9712 using , ?9717 using , ?9718 using , ?9723 using , ?9733 using , ?9734 using , ?9735 using , ?9736 using , ?9737 using , ?9738 using , ?9747 using , ?9748 using , ?9755 using , ?9756 using , ?9763 using , ?9764 using , ?9769 using , ?9774 using , ?9775 using , ?9780 using , ?9785 using , ?9786 using , ?9957 using , ?9958 using , ?9963 using ,)


econstructor;[exact r|exact r0|eauto..].
1 subgoals, subgoal 1 (ID 9991)
  
  Γ : Env
  A : Term
  A' : Term
  b : Term
  b' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 -> sub_in_env Δ a A0 n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A [n ←  a] : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A' [n ←  a] : !s1'
  t1 : A :: Γ ⊢ b : B
  H2 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' ->
       A :: Γ ⊣ -> Γ' ⊢ b [n ←  a] : B [n ←  a]
  t2 : A' :: Γ ⊢ b' : B'
  H3 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A ->
       sub_in_env Δ a A n (A' :: Γ) Γ' ->
       A' :: Γ ⊣ -> Γ' ⊢ b' [n ←  a] : B' [n ←  a]
  t3 : A :: Γ ⊢ B : !s2
  H4 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' -> A :: Γ ⊣ -> Γ' ⊢ B [n ←  a] : !s2
  t4 : A' :: Γ ⊢ B' : !s2'
  H5 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A ->
       sub_in_env Δ a A n (A' :: Γ) Γ' ->
       A' :: Γ ⊣ -> Γ' ⊢ B' [n ←  a] : !s2'
  t5 : Γ ⊢ H : A = A'
  H6 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n Γ Γ' ->
       Γ ⊣ -> Γ' ⊢ H [n ←h a] : A [n ←  a] = A' [n ←  a]
  t6 : A :: Γ ⊢ K : b = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H7 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' ->
       A :: Γ ⊣ ->
       Γ' ⊢ K [n ←h a] : b [n ←  a] = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] [n ←  a]
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H8 : Δ ⊢ a : A0
  H9 : sub_in_env Δ a A0 n Γ Γ'
  H10 : Γ ⊣
  ============================
   A [n ←  a] :: Γ' ⊢ K [(S n) ←h a] : b [(S n) ←  a] =
   (b' [(S n) ←  a] ↑  1 # 1) [ ← #0 ∽ H [n ←h a] ↑h 1]

(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using , ?9351 using , ?9354 using , ?9355 using , ?9362 using , ?9363 using , ?9522 using , ?9523 using , ?9592 using , ?9594 using , ?9595 using , ?9599 using , ?9600 using , ?9681 using , ?9682 using , ?9683 using , ?9684 using , ?9690 using , ?9691 using , ?9698 using , ?9699 using , ?9706 using , ?9707 using , ?9712 using , ?9717 using , ?9718 using , ?9723 using , ?9733 using , ?9734 using , ?9735 using , ?9736 using , ?9737 using , ?9738 using , ?9747 using , ?9748 using , ?9755 using , ?9756 using , ?9763 using , ?9764 using , ?9769 using , ?9774 using , ?9775 using , ?9780 using , ?9785 using , ?9786 using , ?9957 using , ?9958 using , ?9963 using , ?9974 using , ?9975 using , ?9976 using , ?9977 using , ?9978 using , ?9979 using , ?9980 using , ?9981 using , ?9992 using , ?9993 using , ?10000 using , ?10001 using , ?10008 using , ?10009 using , ?10014 using , ?10019 using , ?10020 using , ?10025 using , ?10030 using , ?10031 using , ?10036 using , ?10041 using , ?10042 using , ?10047 using , ?10052 using , ?10053 using ,)


rewrite_l_rev substP2;intuition;rewrite_r_rev substP2;intuition.
1 subgoals, subgoal 1 (ID 10153)
  
  Γ : Env
  A : Term
  A' : Term
  b : Term
  b' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 -> sub_in_env Δ a A0 n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A [n ←  a] : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A' [n ←  a] : !s1'
  t1 : A :: Γ ⊢ b : B
  H2 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' ->
       A :: Γ ⊣ -> Γ' ⊢ b [n ←  a] : B [n ←  a]
  t2 : A' :: Γ ⊢ b' : B'
  H3 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A ->
       sub_in_env Δ a A n (A' :: Γ) Γ' ->
       A' :: Γ ⊣ -> Γ' ⊢ b' [n ←  a] : B' [n ←  a]
  t3 : A :: Γ ⊢ B : !s2
  H4 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' -> A :: Γ ⊣ -> Γ' ⊢ B [n ←  a] : !s2
  t4 : A' :: Γ ⊢ B' : !s2'
  H5 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A ->
       sub_in_env Δ a A n (A' :: Γ) Γ' ->
       A' :: Γ ⊣ -> Γ' ⊢ B' [n ←  a] : !s2'
  t5 : Γ ⊢ H : A = A'
  H6 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n Γ Γ' ->
       Γ ⊣ -> Γ' ⊢ H [n ←h a] : A [n ←  a] = A' [n ←  a]
  t6 : A :: Γ ⊢ K : b = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H7 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' ->
       A :: Γ ⊣ ->
       Γ' ⊢ K [n ←h a] : b [n ←  a] = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] [n ←  a]
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H8 : Δ ⊢ a : A0
  H9 : sub_in_env Δ a A0 n Γ Γ'
  H10 : Γ ⊣
  ============================
   A [n ←  a] :: Γ' ⊢ K [(S n) ←h a] : b [(S n) ←  a] =
   (b' ↑  1 # 1 [(1 + S n) ←  a]) [ ← #0 ∽ H ↑h 1 [(1 + n) ←h a]]

(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using , ?9351 using , ?9354 using , ?9355 using , ?9362 using , ?9363 using , ?9522 using , ?9523 using , ?9592 using , ?9594 using , ?9595 using , ?9599 using , ?9600 using , ?9681 using , ?9682 using , ?9683 using , ?9684 using , ?9690 using , ?9691 using , ?9698 using , ?9699 using , ?9706 using , ?9707 using , ?9712 using , ?9717 using , ?9718 using , ?9723 using , ?9733 using , ?9734 using , ?9735 using , ?9736 using , ?9737 using , ?9738 using , ?9747 using , ?9748 using , ?9755 using , ?9756 using , ?9763 using , ?9764 using , ?9769 using , ?9774 using , ?9775 using , ?9780 using , ?9785 using , ?9786 using , ?9957 using , ?9958 using , ?9963 using , ?9974 using , ?9975 using , ?9976 using , ?9977 using , ?9978 using , ?9979 using , ?9980 using , ?9981 using , ?9992 using , ?9993 using , ?10000 using , ?10001 using , ?10008 using , ?10009 using , ?10014 using , ?10019 using , ?10020 using , ?10025 using , ?10030 using , ?10031 using , ?10036 using , ?10041 using , ?10042 using , ?10047 using , ?10052 using , ?10053 using ,)


change (1+S n) with (S(0+S n)).
1 subgoals, subgoal 1 (ID 10240)
  
  Γ : Env
  A : Term
  A' : Term
  b : Term
  b' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 -> sub_in_env Δ a A0 n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A [n ←  a] : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A' [n ←  a] : !s1'
  t1 : A :: Γ ⊢ b : B
  H2 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' ->
       A :: Γ ⊣ -> Γ' ⊢ b [n ←  a] : B [n ←  a]
  t2 : A' :: Γ ⊢ b' : B'
  H3 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A ->
       sub_in_env Δ a A n (A' :: Γ) Γ' ->
       A' :: Γ ⊣ -> Γ' ⊢ b' [n ←  a] : B' [n ←  a]
  t3 : A :: Γ ⊢ B : !s2
  H4 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' -> A :: Γ ⊣ -> Γ' ⊢ B [n ←  a] : !s2
  t4 : A' :: Γ ⊢ B' : !s2'
  H5 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A ->
       sub_in_env Δ a A n (A' :: Γ) Γ' ->
       A' :: Γ ⊣ -> Γ' ⊢ B' [n ←  a] : !s2'
  t5 : Γ ⊢ H : A = A'
  H6 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n Γ Γ' ->
       Γ ⊣ -> Γ' ⊢ H [n ←h a] : A [n ←  a] = A' [n ←  a]
  t6 : A :: Γ ⊢ K : b = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H7 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' ->
       A :: Γ ⊣ ->
       Γ' ⊢ K [n ←h a] : b [n ←  a] = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] [n ←  a]
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H8 : Δ ⊢ a : A0
  H9 : sub_in_env Δ a A0 n Γ Γ'
  H10 : Γ ⊣
  ============================
   A [n ←  a] :: Γ' ⊢ K [(S n) ←h a] : b [(S n) ←  a] =
   (b' ↑  1 # 1 [(S (0 + S n)) ←  a]) [ ← #0 ∽ H ↑h 1 [(1 + n) ←h a]]

(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using , ?9351 using , ?9354 using , ?9355 using , ?9362 using , ?9363 using , ?9522 using , ?9523 using , ?9592 using , ?9594 using , ?9595 using , ?9599 using , ?9600 using , ?9681 using , ?9682 using , ?9683 using , ?9684 using , ?9690 using , ?9691 using , ?9698 using , ?9699 using , ?9706 using , ?9707 using , ?9712 using , ?9717 using , ?9718 using , ?9723 using , ?9733 using , ?9734 using , ?9735 using , ?9736 using , ?9737 using , ?9738 using , ?9747 using , ?9748 using , ?9755 using , ?9756 using , ?9763 using , ?9764 using , ?9769 using , ?9774 using , ?9775 using , ?9780 using , ?9785 using , ?9786 using , ?9957 using , ?9958 using , ?9963 using , ?9974 using , ?9975 using , ?9976 using , ?9977 using , ?9978 using , ?9979 using , ?9980 using , ?9981 using , ?9992 using , ?9993 using , ?10000 using , ?10001 using , ?10008 using , ?10009 using , ?10014 using , ?10019 using , ?10020 using , ?10025 using , ?10030 using , ?10031 using , ?10036 using , ?10041 using , ?10042 using , ?10047 using , ?10052 using , ?10053 using ,)


change (#0 H h 1 [(1 + n) h a]) with ((#0 H h 1) [(S n) a]).
1 subgoals, subgoal 1 (ID 10242)
  
  Γ : Env
  A : Term
  A' : Term
  b : Term
  b' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 -> sub_in_env Δ a A0 n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A [n ←  a] : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A -> sub_in_env Δ a A n Γ Γ' -> Γ ⊣ -> Γ' ⊢ A' [n ←  a] : !s1'
  t1 : A :: Γ ⊢ b : B
  H2 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' ->
       A :: Γ ⊣ -> Γ' ⊢ b [n ←  a] : B [n ←  a]
  t2 : A' :: Γ ⊢ b' : B'
  H3 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A ->
       sub_in_env Δ a A n (A' :: Γ) Γ' ->
       A' :: Γ ⊣ -> Γ' ⊢ b' [n ←  a] : B' [n ←  a]
  t3 : A :: Γ ⊢ B : !s2
  H4 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' -> A :: Γ ⊣ -> Γ' ⊢ B [n ←  a] : !s2
  t4 : A' :: Γ ⊢ B' : !s2'
  H5 : forall (Δ : Env) (a A : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A ->
       sub_in_env Δ a A n (A' :: Γ) Γ' ->
       A' :: Γ ⊣ -> Γ' ⊢ B' [n ←  a] : !s2'
  t5 : Γ ⊢ H : A = A'
  H6 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n Γ Γ' ->
       Γ ⊣ -> Γ' ⊢ H [n ←h a] : A [n ←  a] = A' [n ←  a]
  t6 : A :: Γ ⊢ K : b = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H7 : forall (Δ : Env) (a A0 : Term) (Γ' : Env) (n : nat),
       Δ ⊢ a : A0 ->
       sub_in_env Δ a A0 n (A :: Γ) Γ' ->
       A :: Γ ⊣ ->
       Γ' ⊢ K [n ←h a] : b [n ←  a] = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] [n ←  a]
  Δ : Env
  a : Term
  A0 : Term
  Γ' : Env
  n : nat
  H8 : Δ ⊢ a : A0
  H9 : sub_in_env Δ a A0 n Γ Γ'
  H10 : Γ ⊣
  ============================
   A [n ←  a] :: Γ' ⊢ K [(S n) ←h a] : b [(S n) ←  a] =
   (b' ↑  1 # 1 [(S (0 + S n)) ←  a]) [ ← (#0 ∽ H ↑h 1) [(S n) ←  a]]

(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using , ?9351 using , ?9354 using , ?9355 using , ?9362 using , ?9363 using , ?9522 using , ?9523 using , ?9592 using , ?9594 using , ?9595 using , ?9599 using , ?9600 using , ?9681 using , ?9682 using , ?9683 using , ?9684 using , ?9690 using , ?9691 using , ?9698 using , ?9699 using , ?9706 using , ?9707 using , ?9712 using , ?9717 using , ?9718 using , ?9723 using , ?9733 using , ?9734 using , ?9735 using , ?9736 using , ?9737 using , ?9738 using , ?9747 using , ?9748 using , ?9755 using , ?9756 using , ?9763 using , ?9764 using , ?9769 using , ?9774 using , ?9775 using , ?9780 using , ?9785 using , ?9786 using , ?9957 using , ?9958 using , ?9963 using , ?9974 using , ?9975 using , ?9976 using , ?9977 using , ?9978 using , ?9979 using , ?9980 using , ?9981 using , ?9992 using , ?9993 using , ?10000 using , ?10001 using , ?10008 using , ?10009 using , ?10014 using , ?10019 using , ?10020 using , ?10025 using , ?10030 using , ?10031 using , ?10036 using , ?10041 using , ?10042 using , ?10047 using , ?10052 using , ?10053 using ,)


rewrite_l_rev substP4;simpl;eauto.
No more subgoals.
(dependent evars: ?5998 using ?6005 , ?5999 using ?6004 , ?6004 using , ?6005 using , ?6403 using , ?6404 using , ?6405 using , ?6406 using , ?6627 using , ?6628 using , ?6632 using , ?6633 using , ?6640 using , ?6641 using , ?6646 using , ?6655 using , ?6656 using , ?6657 using , ?6662 using , ?6663 using , ?6670 using , ?6671 using , ?6676 using , ?6681 using , ?6682 using , ?6687 using , ?6704 using , ?6705 using , ?6709 using , ?6710 using , ?6717 using , ?6718 using , ?6725 using , ?6726 using , ?6738 using , ?6740 using , ?6741 using , ?6751 using , ?6752 using , ?6762 using , ?6765 using , ?6766 using , ?6773 using , ?6774 using , ?6915 using , ?6916 using , ?6917 using , ?6918 using , ?6925 using , ?6926 using , ?6933 using , ?6934 using , ?6941 using , ?6942 using , ?6949 using , ?6950 using , ?6957 using , ?6958 using , ?6965 using , ?6966 using , ?6981 using , ?6982 using ?6999 ?6998 ?6997 , ?6983 using , ?6987 using , ?6988 using , ?6997 using , ?6998 using , ?6999 using , ?7000 using , ?7001 using , ?8844 using , ?8845 using , ?8872 using , ?8873 using , ?8874 using , ?8875 using , ?8933 using , ?8934 using , ?8935 using , ?9021 using , ?9025 using , ?9026 using , ?9027 using , ?9029 using , ?9030 using , ?9031 using , ?9032 using , ?9094 using , ?9095 using , ?9096 using , ?9097 using , ?9296 using , ?9297 using , ?9298 using , ?9299 using , ?9300 using , ?9351 using , ?9354 using , ?9355 using , ?9362 using , ?9363 using , ?9522 using , ?9523 using , ?9592 using , ?9594 using , ?9595 using , ?9599 using , ?9600 using , ?9681 using , ?9682 using , ?9683 using , ?9684 using , ?9690 using , ?9691 using , ?9698 using , ?9699 using , ?9706 using , ?9707 using , ?9712 using , ?9717 using , ?9718 using , ?9723 using , ?9733 using , ?9734 using , ?9735 using , ?9736 using , ?9737 using , ?9738 using , ?9747 using , ?9748 using , ?9755 using , ?9756 using , ?9763 using , ?9764 using , ?9769 using , ?9774 using , ?9775 using , ?9780 using , ?9785 using , ?9786 using , ?9957 using , ?9958 using , ?9963 using , ?9974 using , ?9975 using , ?9976 using , ?9977 using , ?9978 using , ?9979 using , ?9980 using , ?9981 using , ?9992 using , ?9993 using , ?10000 using , ?10001 using , ?10008 using , ?10009 using , ?10014 using , ?10019 using , ?10020 using , ?10025 using , ?10030 using , ?10031 using , ?10036 using , ?10041 using , ?10042 using , ?10047 using , ?10052 using , ?10053 using , ?10248 using , ?10249 using , ?10254 using ,)


Qed.
substitution is defined



Well-formation of contexts: if a context is valid, every term inside is well-typed by a sort.
Lemma wf_item : forall Γ A n, A n Γ -> forall Γ', Γ -> trunc (S n) Γ Γ' -> exists s, Γ' A : !s.
1 subgoals, subgoal 1 (ID 10268)
  
  ============================
   forall (Γ : list Term) (A : Term) (n : nat),
   A ↓ n ∈ Γ ->
   forall Γ' : list Term,
   Γ ⊣ -> trunc (S n) Γ Γ' -> exists s : Sorts, Γ' ⊢ A : !s

(dependent evars:)


induction 1; intros;inversion H0; subst.
2 subgoals, subgoal 1 (ID 10410)
  
  A : Term
  Γ : list Term
  Γ' : list Term
  H : A :: Γ ⊣
  H0 : trunc 1 (A :: Γ) Γ'
  H5 : trunc 0 Γ Γ'
  ============================
   exists s : Sorts, Γ' ⊢ A : !s

subgoal 2 (ID 10412) is:
 exists s0 : Sorts, Γ' ⊢ A : !s0
(dependent evars:)


inversion H5; subst;inversion H; subst.
2 subgoals, subgoal 1 (ID 10517)
  
  A : Term
  Γ' : list Term
  H : A :: Γ' ⊣
  H0 : trunc 1 (A :: Γ') Γ'
  H5 : trunc 0 Γ' Γ'
  s : Sorts
  H2 : Γ' ⊢ A : !s
  ============================
   exists s0 : Sorts, Γ' ⊢ A : !s0

subgoal 2 (ID 10412) is:
 exists s0 : Sorts, Γ' ⊢ A : !s0
(dependent evars:)

exists s; trivial.
1 subgoals, subgoal 1 (ID 10412)
  
  A : Term
  Γ : list Term
  n : nat
  y : Term
  H : A ↓ n ∈ Γ
  IHitem : forall Γ' : list Term,
           Γ ⊣ -> trunc (S n) Γ Γ' -> exists s : Sorts, Γ' ⊢ A : !s
  Γ' : list Term
  H0 : y :: Γ ⊣
  H1 : trunc (S (S n)) (y :: Γ) Γ'
  s : Sorts
  H3 : Γ ⊢ y : !s
  ============================
   exists s0 : Sorts, Γ' ⊢ A : !s0

(dependent evars:)


inversion H1; subst.
1 subgoals, subgoal 1 (ID 10591)
  
  A : Term
  Γ : list Term
  n : nat
  y : Term
  H : A ↓ n ∈ Γ
  IHitem : forall Γ' : list Term,
           Γ ⊣ -> trunc (S n) Γ Γ' -> exists s : Sorts, Γ' ⊢ A : !s
  Γ' : list Term
  H0 : y :: Γ ⊣
  H1 : trunc (S (S n)) (y :: Γ) Γ'
  s : Sorts
  H3 : Γ ⊢ y : !s
  H7 : trunc (S n) Γ Γ'
  ============================
   exists s0 : Sorts, Γ' ⊢ A : !s0

(dependent evars:)

apply IHitem;eauto.
No more subgoals.
(dependent evars: ?10594 using , ?10595 using ,)


Qed.
wf_item is defined



Lemma wf_item_lift : forall Γ A n ,Γ -> A n Γ -> exists s, Γ A : !s.
1 subgoals, subgoal 1 (ID 10664)
  
  ============================
   forall (Γ : Env) (A : Term) (n : nat),
   Γ ⊣ -> A ↓ n ⊂ Γ -> exists s : Sorts, Γ ⊢ A : !s

(dependent evars:)


destruct 2 as (u & ? & ?);subst.
1 subgoals, subgoal 1 (ID 10680)
  
  Γ : Env
  n : nat
  H : Γ ⊣
  u : Term
  H1 : u ↓ n ∈ Γ
  ============================
   exists s : Sorts, Γ ⊢ u ↑  (S n) : !s

(dependent evars:)


assert (exists Γ' , trunc (S n) Γ Γ') by (apply item_trunc with u; trivial).
1 subgoals, subgoal 1 (ID 10684)
  
  Γ : Env
  n : nat
  H : Γ ⊣
  u : Term
  H1 : u ↓ n ∈ Γ
  H0 : exists Γ' : list Term, trunc (S n) Γ Γ'
  ============================
   exists s : Sorts, Γ ⊢ u ↑  (S n) : !s

(dependent evars:)


destruct H0 as (Γ' & ?).
1 subgoals, subgoal 1 (ID 10689)
  
  Γ : Env
  n : nat
  H : Γ ⊣
  u : Term
  H1 : u ↓ n ∈ Γ
  Γ' : list Term
  H0 : trunc (S n) Γ Γ'
  ============================
   exists s : Sorts, Γ ⊢ u ↑  (S n) : !s

(dependent evars:)


destruct (wf_item Γ u n H1 Γ' H H0) as (t & ?).
1 subgoals, subgoal 1 (ID 10696)
  
  Γ : Env
  n : nat
  H : Γ ⊣
  u : Term
  H1 : u ↓ n ∈ Γ
  Γ' : list Term
  H0 : trunc (S n) Γ Γ'
  t : Sorts
  H2 : Γ' ⊢ u : !t
  ============================
   exists s : Sorts, Γ ⊢ u ↑  (S n) : !s

(dependent evars:)


exists t.
1 subgoals, subgoal 1 (ID 10698)
  
  Γ : Env
  n : nat
  H : Γ ⊣
  u : Term
  H1 : u ↓ n ∈ Γ
  Γ' : list Term
  H0 : trunc (S n) Γ Γ'
  t : Sorts
  H2 : Γ' ⊢ u : !t
  ============================
   Γ ⊢ u ↑  (S n) : !t

(dependent evars:)

change !t with (!t ↑(S n)).
1 subgoals, subgoal 1 (ID 10700)
  
  Γ : Env
  n : nat
  H : Γ ⊣
  u : Term
  H1 : u ↓ n ∈ Γ
  Γ' : list Term
  H0 : trunc (S n) Γ Γ'
  t : Sorts
  H2 : Γ' ⊢ u : !t
  ============================
   Γ ⊢ u ↑  (S n) : !t ↑  (S n)

(dependent evars:)


eapply thinning_n;eauto.
No more subgoals.
(dependent evars: ?10701 using ,)


Qed.
wf_item_lift is defined



Properties of equalities
Lemma conv_inj : (forall Y H X n, (X 1 # (S n)) [n #0 H] = (Y 1 # (S n)) [n #0 H]->X=Y)/\
                  (forall Y H X n, (X h 1 # (S n)) [n h #0 H] = (Y h 1 # (S n)) [n h #0 H]->X=Y).
1 subgoals, subgoal 1 (ID 10726)
  
  ============================
   (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
    X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
   (forall (Y H X : Prf) (n : nat),
    X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)

(dependent evars:)


assert (forall X v H n, (X 1 # (S n)) [n #0 H] = #v->X=#v) as HH1.
2 subgoals, subgoal 1 (ID 10733)
  
  ============================
   forall (X : Term) (v : Vars) (H : Prf) (n : nat),
   X ↑  1 # (S n) [n ←  #0 ∽ H] = #v -> X = #v

subgoal 2 (ID 10734) is:
 (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
  X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
 (forall (Y H X : Prf) (n : nat),
  X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)
(dependent evars:)


intros;destruct X;[|simpl in H0..];try discriminate;
unfold lift_rec in H0;destruct le_gt_dec;unfold subst_rec in H0;destruct lt_eq_lt_dec as [[]|];try discriminate;try discriminate;injection H0;intros;subst.
5 subgoals, subgoal 1 (ID 10909)
  
  v0 : Vars
  H : Prf
  n : nat
  l : S n <= v0
  l0 : 1 + v0 < n
  H0 : #(1 + v0) = #(S v0)
  ============================
   #v0 = #(S v0)

subgoal 2 (ID 10914) is:
 #v0 = #(v0 - 0)
subgoal 3 (ID 10921) is:
 #v = #v
subgoal 4 (ID 10926) is:
 #v0 = #(v0 - 1)
subgoal 5 (ID 10734) is:
 (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
  X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
 (forall (Y H X : Prf) (n : nat),
  X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)
(dependent evars:)


simpl in *.
5 subgoals, subgoal 1 (ID 10933)
  
  v0 : Vars
  H : Prf
  n : nat
  l : S n <= v0
  l0 : S v0 < n
  H0 : #(S v0) = #(S v0)
  ============================
   #v0 = #(S v0)

subgoal 2 (ID 10914) is:
 #v0 = #(v0 - 0)
subgoal 3 (ID 10921) is:
 #v = #v
subgoal 4 (ID 10926) is:
 #v0 = #(v0 - 1)
subgoal 5 (ID 10734) is:
 (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
  X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
 (forall (Y H X : Prf) (n : nat),
  X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)
(dependent evars:)


destruct (lt_irrefl n);apply lt_trans with (S v0);[constructor|];assumption.
4 subgoals, subgoal 1 (ID 10914)
  
  v0 : Vars
  H : Prf
  n : nat
  l : S n <= v0
  l0 : n < 1 + v0
  H0 : #(1 + v0 - 1) = #(v0 - 0)
  ============================
   #v0 = #(v0 - 0)

subgoal 2 (ID 10921) is:
 #v = #v
subgoal 3 (ID 10926) is:
 #v0 = #(v0 - 1)
subgoal 4 (ID 10734) is:
 (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
  X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
 (forall (Y H X : Prf) (n : nat),
  X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)
(dependent evars:)


rewrite <- minus_n_O;reflexivity.
3 subgoals, subgoal 1 (ID 10921)
  
  v : Vars
  H : Prf
  n : nat
  g : S n > v
  l : v < n
  H0 : #v = #v
  ============================
   #v = #v

subgoal 2 (ID 10926) is:
 #v0 = #(v0 - 1)
subgoal 3 (ID 10734) is:
 (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
  X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
 (forall (Y H X : Prf) (n : nat),
  X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)
(dependent evars:)


reflexivity.
2 subgoals, subgoal 1 (ID 10926)
  
  v0 : Vars
  H : Prf
  n : nat
  g : S n > v0
  l : n < v0
  H0 : #(v0 - 1) = #(v0 - 1)
  ============================
   #v0 = #(v0 - 1)

subgoal 2 (ID 10734) is:
 (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
  X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
 (forall (Y H X : Prf) (n : nat),
  X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)
(dependent evars:)


destruct (lt_irrefl v0);apply le_lt_trans with (n);[apply le_S_n|];assumption.
1 subgoals, subgoal 1 (ID 10734)
  
  HH1 : forall (X : Term) (v : Vars) (H : Prf) (n : nat),
        X ↑  1 # (S n) [n ←  #0 ∽ H] = #v -> X = #v
  ============================
   (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
    X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
   (forall (Y H X : Prf) (n : nat),
    X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)

(dependent evars:)



assert (forall X v H n, (X 1 # (S n)) [n #0 H] = (#v 1 # (S n)) [n #0 H]->X=#v) as HH0.
2 subgoals, subgoal 1 (ID 10961)
  
  HH1 : forall (X : Term) (v : Vars) (H : Prf) (n : nat),
        X ↑  1 # (S n) [n ←  #0 ∽ H] = #v -> X = #v
  ============================
   forall (X : Term) (v : Vars) (H : Prf) (n : nat),
   X ↑  1 # (S n) [n ←  #0 ∽ H] = #v ↑  1 # (S n) [n ←  #0 ∽ H] -> X = #v

subgoal 2 (ID 10962) is:
 (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
  X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
 (forall (Y H X : Prf) (n : nat),
  X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)
(dependent evars:)


intros;unfold lift_rec in H0 at 2;destruct le_gt_dec;unfold subst_rec in H0 at 2;destruct lt_eq_lt_dec as [[]|];subst.
7 subgoals, subgoal 1 (ID 11005)
  
  HH1 : forall (X : Term) (v : Vars) (H : Prf) (n : nat),
        X ↑  1 # (S n) [n ←  #0 ∽ H] = #v -> X = #v
  X : Term
  v : Vars
  H : Prf
  n : nat
  l : S n <= v
  l0 : 1 + v < n
  H0 : X ↑  1 # (S n) [n ←  #0 ∽ H] = #(1 + v)
  ============================
   X = #v

subgoal 2 (ID 11038) is:
 X = #v
subgoal 3 (ID 11009) is:
 X = #v
subgoal 4 (ID 11028) is:
 X = #v
subgoal 5 (ID 11043) is:
 X = #n
subgoal 6 (ID 11032) is:
 X = #v
subgoal 7 (ID 10962) is:
 (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
  X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
 (forall (Y H X : Prf) (n : nat),
  X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)
(dependent evars:)


destruct (lt_irrefl v);apply lt_trans with n;[apply lt_trans with (S v);[constructor|]|];assumption.
6 subgoals, subgoal 1 (ID 11038)
  
  HH1 : forall (X : Term) (v : Vars) (H : Prf) (n : nat),
        X ↑  1 # (S n) [n ←  #0 ∽ H] = #v -> X = #v
  X : Term
  v : Vars
  H : Prf
  l : S (1 + v) <= v
  H0 : X ↑  1 # (S (1 + v)) [(1 + v) ←  #0 ∽ H] = (#0 ∽ H) ↑  (1 + v)
  ============================
   X = #v

subgoal 2 (ID 11009) is:
 X = #v
subgoal 3 (ID 11028) is:
 X = #v
subgoal 4 (ID 11043) is:
 X = #n
subgoal 5 (ID 11032) is:
 X = #v
subgoal 6 (ID 10962) is:
 (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
  X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
 (forall (Y H X : Prf) (n : nat),
  X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)
(dependent evars:)


destruct (lt_irrefl v);apply lt_trans with (S v);[constructor|assumption].
5 subgoals, subgoal 1 (ID 11009)
  
  HH1 : forall (X : Term) (v : Vars) (H : Prf) (n : nat),
        X ↑  1 # (S n) [n ←  #0 ∽ H] = #v -> X = #v
  X : Term
  v : Vars
  H : Prf
  n : nat
  l : S n <= v
  l0 : n < 1 + v
  H0 : X ↑  1 # (S n) [n ←  #0 ∽ H] = #(1 + v - 1)
  ============================
   X = #v

subgoal 2 (ID 11028) is:
 X = #v
subgoal 3 (ID 11043) is:
 X = #n
subgoal 4 (ID 11032) is:
 X = #v
subgoal 5 (ID 10962) is:
 (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
  X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
 (forall (Y H X : Prf) (n : nat),
  X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)
(dependent evars:)


eapply HH1;rewrite minus_plus in H0;eassumption.
4 subgoals, subgoal 1 (ID 11028)
  
  HH1 : forall (X : Term) (v : Vars) (H : Prf) (n : nat),
        X ↑  1 # (S n) [n ←  #0 ∽ H] = #v -> X = #v
  X : Term
  v : Vars
  H : Prf
  n : nat
  g : S n > v
  l : v < n
  H0 : X ↑  1 # (S n) [n ←  #0 ∽ H] = #v
  ============================
   X = #v

subgoal 2 (ID 11043) is:
 X = #n
subgoal 3 (ID 11032) is:
 X = #v
subgoal 4 (ID 10962) is:
 (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
  X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
 (forall (Y H X : Prf) (n : nat),
  X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)
(dependent evars: ?11062 using ?11066 , ?11063 using ?11067 , ?11066 using , ?11067 using ,)


eapply HH1;eassumption.
3 subgoals, subgoal 1 (ID 11043)
  
  HH1 : forall (X : Term) (v : Vars) (H : Prf) (n : nat),
        X ↑  1 # (S n) [n ←  #0 ∽ H] = #v -> X = #v
  X : Term
  H : Prf
  n : nat
  H0 : X ↑  1 # (S n) [n ←  #0 ∽ H] = (#0 ∽ H) ↑  n
  g : S n > n
  ============================
   X = #n

subgoal 2 (ID 11032) is:
 X = #v
subgoal 3 (ID 10962) is:
 (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
  X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
 (forall (Y H X : Prf) (n : nat),
  X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)
(dependent evars: ?11062 using ?11066 , ?11063 using ?11067 , ?11066 using , ?11067 using , ?11069 using , ?11070 using ,)


simpl in H0;destruct X;[|simpl in H0..];try discriminate.
4 subgoals, subgoal 1 (ID 11090)
  
  HH1 : forall (X : Term) (v : Vars) (H : Prf) (n : nat),
        X ↑  1 # (S n) [n ←  #0 ∽ H] = #v -> X = #v
  v : Vars
  H : Prf
  n : nat
  H0 : #v ↑  1 # (S n) [n ←  #0 ∽ H] = #(n + 0) ∽ H ↑h n
  g : S n > n
  ============================
   #v = #n

subgoal 2 (ID 11123) is:
 X ∽ p = #n
subgoal 3 (ID 11032) is:
 X = #v
subgoal 4 (ID 10962) is:
 (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
  X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
 (forall (Y H X : Prf) (n : nat),
  X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)
(dependent evars: ?11062 using ?11066 , ?11063 using ?11067 , ?11066 using , ?11067 using , ?11069 using , ?11070 using ,)


unfold lift_rec in H0;destruct le_gt_dec;unfold subst_rec in H0;destruct lt_eq_lt_dec as [[]|];try discriminate;subst.
5 subgoals, subgoal 1 (ID 11257)
  
  HH1 : forall (X : Term) (v : Vars) (H : Prf) (n : nat),
        X ↑  1 # (S n) [n ←  #0 ∽ H] = #v -> X = #v
  v : Vars
  H : Prf
  l : S (1 + v) <= v
  H0 : (#0 ∽ H) ↑  (1 + v) = #(1 + v + 0) ∽ H ↑h (1 + v)
  g : S (1 + v) > 1 + v
  ============================
   #v = #(1 + v)

subgoal 2 (ID 11262) is:
 #n = #n
subgoal 3 (ID 11123) is:
 X ∽ p = #n
subgoal 4 (ID 11032) is:
 X = #v
subgoal 5 (ID 10962) is:
 (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
  X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
 (forall (Y H X : Prf) (n : nat),
  X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)
(dependent evars: ?11062 using ?11066 , ?11063 using ?11067 , ?11066 using , ?11067 using , ?11069 using , ?11070 using ,)


destruct (lt_irrefl v);apply lt_trans with (S v);[constructor|assumption].
4 subgoals, subgoal 1 (ID 11262)
  
  HH1 : forall (X : Term) (v : Vars) (H : Prf) (n : nat),
        X ↑  1 # (S n) [n ←  #0 ∽ H] = #v -> X = #v
  H : Prf
  n : nat
  H0 : (#0 ∽ H) ↑  n = #(n + 0) ∽ H ↑h n
  g : S n > n
  g0 : S n > n
  ============================
   #n = #n

subgoal 2 (ID 11123) is:
 X ∽ p = #n
subgoal 3 (ID 11032) is:
 X = #v
subgoal 4 (ID 10962) is:
 (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
  X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
 (forall (Y H X : Prf) (n : nat),
  X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)
(dependent evars: ?11062 using ?11066 , ?11063 using ?11067 , ?11066 using , ?11067 using , ?11069 using , ?11070 using ,)


reflexivity.
3 subgoals, subgoal 1 (ID 11123)
  
  HH1 : forall (X : Term) (v : Vars) (H : Prf) (n : nat),
        X ↑  1 # (S n) [n ←  #0 ∽ H] = #v -> X = #v
  X : Term
  p : Prf
  H : Prf
  n : nat
  H0 : X ↑  1 # (S n) [n ←  #0 ∽ H] ∽ p ↑h 1 # (S n) [n ←h #0 ∽ H] =
       #(n + 0) ∽ H ↑h n
  g : S n > n
  ============================
   X ∽ p = #n

subgoal 2 (ID 11032) is:
 X = #v
subgoal 3 (ID 10962) is:
 (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
  X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
 (forall (Y H X : Prf) (n : nat),
  X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)
(dependent evars: ?11062 using ?11066 , ?11063 using ?11067 , ?11066 using , ?11067 using , ?11069 using , ?11070 using ,)


injection H0;intros.
3 subgoals, subgoal 1 (ID 11281)
  
  HH1 : forall (X : Term) (v : Vars) (H : Prf) (n : nat),
        X ↑  1 # (S n) [n ←  #0 ∽ H] = #v -> X = #v
  X : Term
  p : Prf
  H : Prf
  n : nat
  H0 : X ↑  1 # (S n) [n ←  #0 ∽ H] ∽ p ↑h 1 # (S n) [n ←h #0 ∽ H] =
       #(n + 0) ∽ H ↑h n
  g : S n > n
  H1 : p ↑h 1 # (S n) [n ←h #0 ∽ H] = H ↑h n
  H2 : X ↑  1 # (S n) [n ←  #0 ∽ H] = #(n + 0)
  ============================
   X ∽ p = #n

subgoal 2 (ID 11032) is:
 X = #v
subgoal 3 (ID 10962) is:
 (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
  X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
 (forall (Y H X : Prf) (n : nat),
  X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)
(dependent evars: ?11062 using ?11066 , ?11063 using ?11067 , ?11066 using , ?11067 using , ?11069 using , ?11070 using ,)


apply HH1 in H2;rewrite <- plus_n_O in *;subst.
3 subgoals, subgoal 1 (ID 11292)
  
  HH1 : forall (X : Term) (v : Vars) (H : Prf) (n : nat),
        X ↑  1 # (S n) [n ←  #0 ∽ H] = #v -> X = #v
  p : Prf
  H : Prf
  n : nat
  g : S n > n
  H1 : p ↑h 1 # (S n) [n ←h #0 ∽ H] = H ↑h n
  H0 : #n ↑  1 # (S n) [n ←  #0 ∽ H] ∽ p ↑h 1 # (S n) [n ←h #0 ∽ H] =
       #n ∽ H ↑h n
  ============================
   #n ∽ p = #n

subgoal 2 (ID 11032) is:
 X = #v
subgoal 3 (ID 10962) is:
 (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
  X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
 (forall (Y H X : Prf) (n : nat),
  X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)
(dependent evars: ?11062 using ?11066 , ?11063 using ?11067 , ?11066 using , ?11067 using , ?11069 using , ?11070 using ,)


unfold lift_rec in H0;destruct le_gt_dec.
4 subgoals, subgoal 1 (ID 11307)
  
  HH1 : forall (X : Term) (v : Vars) (H : Prf) (n : nat),
        X ↑  1 # (S n) [n ←  #0 ∽ H] = #v -> X = #v
  p : Prf
  H : Prf
  n : nat
  g : S n > n
  H1 : p ↑h 1 # (S n) [n ←h #0 ∽ H] = H ↑h n
  l : S n <= n
  H0 : #(1 + n) [n ←  #0 ∽ H] ∽ p ↑h 1 # (S n) [n ←h #0 ∽ H] = #n ∽ H ↑h n
  ============================
   #n ∽ p = #n

subgoal 2 (ID 11309) is:
 #n ∽ p = #n
subgoal 3 (ID 11032) is:
 X = #v
subgoal 4 (ID 10962) is:
 (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
  X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
 (forall (Y H X : Prf) (n : nat),
  X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)
(dependent evars: ?11062 using ?11066 , ?11063 using ?11067 , ?11066 using , ?11067 using , ?11069 using , ?11070 using ,)


destruct le_Sn_n with n;assumption.
3 subgoals, subgoal 1 (ID 11309)
  
  HH1 : forall (X : Term) (v : Vars) (H : Prf) (n : nat),
        X ↑  1 # (S n) [n ←  #0 ∽ H] = #v -> X = #v
  p : Prf
  H : Prf
  n : nat
  g : S n > n
  H1 : p ↑h 1 # (S n) [n ←h #0 ∽ H] = H ↑h n
  g0 : S n > n
  H0 : #n [n ←  #0 ∽ H] ∽ p ↑h 1 # (S n) [n ←h #0 ∽ H] = #n ∽ H ↑h n
  ============================
   #n ∽ p = #n

subgoal 2 (ID 11032) is:
 X = #v
subgoal 3 (ID 10962) is:
 (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
  X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
 (forall (Y H X : Prf) (n : nat),
  X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)
(dependent evars: ?11062 using ?11066 , ?11063 using ?11067 , ?11066 using , ?11067 using , ?11069 using , ?11070 using ,)


unfold subst_rec in H0;destruct lt_eq_lt_dec as [[]|];try (destruct lt_irrefl with n;assumption).
3 subgoals, subgoal 1 (ID 11336)
  
  HH1 : forall (X : Term) (v : Vars) (H : Prf) (n : nat),
        X ↑  1 # (S n) [n ←  #0 ∽ H] = #v -> X = #v
  p : Prf
  H : Prf
  n : nat
  g : S n > n
  H1 : p ↑h 1 # (S n) [n ←h #0 ∽ H] = H ↑h n
  g0 : S n > n
  e : n = n
  H0 : (#0 ∽ H) ↑  n ∽ p ↑h 1 # (S n) [n ←h #0 ∽ H] = #n ∽ H ↑h n
  ============================
   #n ∽ p = #n

subgoal 2 (ID 11032) is:
 X = #v
subgoal 3 (ID 10962) is:
 (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
  X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
 (forall (Y H X : Prf) (n : nat),
  X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)
(dependent evars: ?11062 using ?11066 , ?11063 using ?11067 , ?11066 using , ?11067 using , ?11069 using , ?11070 using ,)


discriminate.
2 subgoals, subgoal 1 (ID 11032)
  
  HH1 : forall (X : Term) (v : Vars) (H : Prf) (n : nat),
        X ↑  1 # (S n) [n ←  #0 ∽ H] = #v -> X = #v
  X : Term
  v : Vars
  H : Prf
  n : nat
  g : S n > v
  l : n < v
  H0 : X ↑  1 # (S n) [n ←  #0 ∽ H] = #(v - 1)
  ============================
   X = #v

subgoal 2 (ID 10962) is:
 (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
  X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
 (forall (Y H X : Prf) (n : nat),
  X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)
(dependent evars: ?11062 using ?11066 , ?11063 using ?11067 , ?11066 using , ?11067 using , ?11069 using , ?11070 using ,)


destruct (lt_irrefl v);apply le_lt_trans with n;[apply le_S_n|];assumption.
1 subgoals, subgoal 1 (ID 10962)
  
  HH1 : forall (X : Term) (v : Vars) (H : Prf) (n : nat),
        X ↑  1 # (S n) [n ←  #0 ∽ H] = #v -> X = #v
  HH0 : forall (X : Term) (v : Vars) (H : Prf) (n : nat),
        X ↑  1 # (S n) [n ←  #0 ∽ H] = #v ↑  1 # (S n) [n ←  #0 ∽ H] ->
        X = #v
  ============================
   (forall (Y : Term) (H : Prf) (X : Term) (n : nat),
    X ↑  1 # (S n) [n ←  #0 ∽ H] = Y ↑  1 # (S n) [n ←  #0 ∽ H] -> X = Y) /\
   (forall (Y H X : Prf) (n : nat),
    X ↑h 1 # (S n) [n ←h #0 ∽ H] = Y ↑h 1 # (S n) [n ←h #0 ∽ H] -> X = Y)

(dependent evars: ?11062 using ?11066 , ?11063 using ?11067 , ?11066 using , ?11067 using , ?11069 using , ?11070 using ,)



apply Term_induc;intros;[eapply HH0;eassumption|..];(destruct X;[try (symmetry;eapply HH0;symmetry;eassumption;fail)|..]);
simpl in H0;try discriminate;try injection H0;try injection H1;try injection H2;try injection H3;
intros;f_equal;try eapply H;try eapply H0;try eapply H1;try eassumption.
No more subgoals.
(dependent evars: ?11062 using ?11066 , ?11063 using ?11067 , ?11066 using , ?11067 using , ?11069 using , ?11070 using , ?11483 using , ?11484 using , ?11528 using , ?11529 using , ?11575 using , ?11576 using , ?11622 using , ?11623 using , ?11669 using , ?11670 using , ?11716 using , ?11717 using , ?12956 using , ?12957 using , ?12959 using , ?12960 using , ?12962 using , ?12963 using , ?12965 using , ?12966 using , ?12968 using , ?12969 using , ?12971 using , ?12972 using , ?12974 using , ?12975 using , ?12977 using , ?12978 using , ?12980 using , ?12981 using , ?12983 using , ?12984 using , ?12986 using , ?12987 using , ?12989 using , ?12990 using , ?12992 using , ?12993 using , ?12995 using , ?12996 using , ?12998 using , ?12999 using , ?13001 using , ?13002 using , ?13004 using , ?13005 using , ?13007 using , ?13008 using , ?13010 using , ?13011 using , ?13013 using , ?13014 using , ?13016 using , ?13017 using , ?13019 using , ?13020 using ,)


Qed.
conv_inj is defined



Lemma equality_unique : forall Γ H A B C D, Γ H : A = B -> Γ H : C = D -> A = C /\ B = D.
1 subgoals, subgoal 1 (ID 13031)
  
  ============================
   forall (Γ : Env) (H : Prf) (A B C D : Term),
   Γ ⊢ H : A = B -> Γ ⊢ H : C = D -> A = C /\ B = D

(dependent evars:)


intros until 1;revert C D;induction H0;inversion 1;subst;try (split;reflexivity;fail).
5 subgoals, subgoal 1 (ID 15692)
  
  Γ : Env
  H : Prf
  A : Term
  B : Term
  H0 : Γ ⊢ H : A = B
  IHtyp_h : forall C D : Term, Γ ⊢ H : C = D -> A = C /\ B = D
  C : Term
  D : Term
  H1 : Γ ⊢ H † : C = D
  H5 : Γ ⊢ H : D = C
  ============================
   B = C /\ A = D

subgoal 2 (ID 15697) is:
 A = C0 /\ C = D
subgoal 3 (ID 15725) is:
 Π (A), B = Π (A), B0 /\ Π (A'), B' = Π (A'0), B'0
subgoal 4 (ID 15739) is:
 λ [A], b = λ [A], b0 /\ λ [A'], b' = λ [A'0], b'0
subgoal 5 (ID 15752) is:
 F · a = F0 · a0 /\ F' · a' = F'0 · a'0
(dependent evars:)


edestruct IHtyp_h;[eexact H5|];subst;split;reflexivity.
4 subgoals, subgoal 1 (ID 15697)
  
  Γ : Env
  H : Prf
  K : Prf
  A : Term
  B : Term
  C : Term
  H0_ : Γ ⊢ H : A = B
  H0_0 : Γ ⊢ K : B = C
  IHtyp_h1 : forall C D : Term, Γ ⊢ H : C = D -> A = C /\ B = D
  IHtyp_h2 : forall C0 D : Term, Γ ⊢ K : C0 = D -> B = C0 /\ C = D
  C0 : Term
  D : Term
  H0 : Γ ⊢ H • K : C0 = D
  B0 : Term
  H5 : Γ ⊢ H : C0 = B0
  H8 : Γ ⊢ K : B0 = D
  ============================
   A = C0 /\ C = D

subgoal 2 (ID 15725) is:
 Π (A), B = Π (A), B0 /\ Π (A'), B' = Π (A'0), B'0
subgoal 3 (ID 15739) is:
 λ [A], b = λ [A], b0 /\ λ [A'], b' = λ [A'0], b'0
subgoal 4 (ID 15752) is:
 F · a = F0 · a0 /\ F' · a' = F'0 · a'0
(dependent evars: ?15810 using , ?15811 using ,)


edestruct IHtyp_h1;[eexact H5|];edestruct IHtyp_h2;[eexact H8|];subst;split;reflexivity.
3 subgoals, subgoal 1 (ID 15725)
  
  Γ : Env
  A : Term
  A' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  H0 : Rel s1 s2 s3
  H1 : Rel s1' s2' s3'
  H2 : Γ ⊢ A : !s1
  H3 : Γ ⊢ A' : !s1'
  H4 : A :: Γ ⊢ B : !s2
  H5 : A' :: Γ ⊢ B' : !s2'
  H0_ : Γ ⊢ H : A = A'
  H0_0 : A :: Γ ⊢ K : B = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  IHtyp_h1 : forall C D : Term, Γ ⊢ H : C = D -> A = C /\ A' = D
  IHtyp_h2 : forall C D : Term,
             A :: Γ ⊢ K : C = D ->
             B = C /\ (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] = D
  A'0 : Term
  B0 : Term
  B'0 : Term
  s0 : Sorts
  s4 : Sorts
  s5 : Sorts
  s1'0 : Sorts
  s2'0 : Sorts
  s3'0 : Sorts
  H11 : Rel s0 s4 s5
  H12 : Rel s1'0 s2'0 s3'0
  H13 : Γ ⊢ A : !s0
  H14 : Γ ⊢ A'0 : !s1'0
  H15 : A :: Γ ⊢ B0 : !s4
  H17 : A'0 :: Γ ⊢ B'0 : !s2'0
  H20 : Γ ⊢ H : A = A'0
  H21 : A :: Γ ⊢ K : B0 = (B'0 ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H6 : Γ ⊢ {H, [A]K} : Π (A), B0 = Π (A'0), B'0
  ============================
   Π (A), B = Π (A), B0 /\ Π (A'), B' = Π (A'0), B'0

subgoal 2 (ID 15739) is:
 λ [A], b = λ [A], b0 /\ λ [A'], b' = λ [A'0], b'0
subgoal 3 (ID 15752) is:
 F · a = F0 · a0 /\ F' · a' = F'0 · a'0
(dependent evars: ?15810 using , ?15811 using , ?15839 using , ?15840 using , ?15856 using , ?15857 using ,)


edestruct IHtyp_h1;[eexact H20|];edestruct IHtyp_h2;[eexact H21|];subst;split;[reflexivity|f_equal;eapply conv_inj;eassumption].
2 subgoals, subgoal 1 (ID 15739)
  
  Γ : Env
  A : Term
  A' : Term
  b : Term
  b' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  H0 : Rel s1 s2 s3
  H1 : Rel s1' s2' s3'
  H2 : Γ ⊢ A : !s1
  H3 : Γ ⊢ A' : !s1'
  H4 : A :: Γ ⊢ b : B
  H5 : A' :: Γ ⊢ b' : B'
  H6 : A :: Γ ⊢ B : !s2
  H7 : A' :: Γ ⊢ B' : !s2'
  H0_ : Γ ⊢ H : A = A'
  H0_0 : A :: Γ ⊢ K : b = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  IHtyp_h1 : forall C D : Term, Γ ⊢ H : C = D -> A = C /\ A' = D
  IHtyp_h2 : forall C D : Term,
             A :: Γ ⊢ K : C = D ->
             b = C /\ (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] = D
  A'0 : Term
  b0 : Term
  b'0 : Term
  B0 : Term
  B'0 : Term
  s0 : Sorts
  s4 : Sorts
  s5 : Sorts
  s1'0 : Sorts
  s2'0 : Sorts
  s3'0 : Sorts
  H13 : Rel s0 s4 s5
  H14 : Rel s1'0 s2'0 s3'0
  H15 : Γ ⊢ A : !s0
  H16 : Γ ⊢ A'0 : !s1'0
  H17 : A :: Γ ⊢ b0 : B0
  H18 : A'0 :: Γ ⊢ b'0 : B'0
  H19 : A :: Γ ⊢ B0 : !s4
  H21 : A'0 :: Γ ⊢ B'0 : !s2'0
  H24 : Γ ⊢ H : A = A'0
  H25 : A :: Γ ⊢ K : b0 = (b'0 ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H8 : Γ ⊢ ⟨H, [A]K ⟩ : λ [A], b0 = λ [A'0], b'0
  ============================
   λ [A], b = λ [A], b0 /\ λ [A'], b' = λ [A'0], b'0

subgoal 2 (ID 15752) is:
 F · a = F0 · a0 /\ F' · a' = F'0 · a'0
(dependent evars: ?15810 using , ?15811 using , ?15839 using , ?15840 using , ?15856 using , ?15857 using , ?15896 using , ?15897 using , ?15913 using , ?15914 using , ?15962 using ?15965 , ?15963 using ?15966 , ?15965 using , ?15966 using ,)


edestruct IHtyp_h1;[eexact H24|];edestruct IHtyp_h2;[eexact H25|];subst;split;[reflexivity|f_equal;eapply conv_inj;eassumption].
1 subgoals, subgoal 1 (ID 15752)
  
  Γ : Env
  F : Term
  F' : Term
  a : Term
  a' : Term
  A : Term
  A' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  H0 : Γ ⊢ F : Π (A), B
  H1 : Γ ⊢ F' : Π (A'), B'
  H2 : Γ ⊢ a : A
  H3 : Γ ⊢ a' : A'
  H0_ : Γ ⊢ H : F = F'
  H0_0 : Γ ⊢ K : a = a'
  IHtyp_h1 : forall C D : Term, Γ ⊢ H : C = D -> F = C /\ F' = D
  IHtyp_h2 : forall C D : Term, Γ ⊢ K : C = D -> a = C /\ a' = D
  F0 : Term
  F'0 : Term
  a0 : Term
  a'0 : Term
  A0 : Term
  A'0 : Term
  B0 : Term
  B'0 : Term
  H8 : Γ ⊢ F0 : Π (A0), B0
  H9 : Γ ⊢ F'0 : Π (A'0), B'0
  H10 : Γ ⊢ a0 : A0
  H11 : Γ ⊢ a'0 : A'0
  H13 : Γ ⊢ H : F0 = F'0
  H16 : Γ ⊢ K : a0 = a'0
  H4 : Γ ⊢ H ·h K : F0 · a0 = F'0 · a'0
  ============================
   F · a = F0 · a0 /\ F' · a' = F'0 · a'0

(dependent evars: ?15810 using , ?15811 using , ?15839 using , ?15840 using , ?15856 using , ?15857 using , ?15896 using , ?15897 using , ?15913 using , ?15914 using , ?15962 using ?15965 , ?15963 using ?15966 , ?15965 using , ?15966 using , ?15970 using , ?15971 using , ?15987 using , ?15988 using , ?16037 using ?16040 , ?16038 using ?16041 , ?16040 using , ?16041 using ,)


edestruct IHtyp_h1;[eexact H13|];edestruct IHtyp_h2;[eexact H16|];subst;split;reflexivity.
No more subgoals.
(dependent evars: ?15810 using , ?15811 using , ?15839 using , ?15840 using , ?15856 using , ?15857 using , ?15896 using , ?15897 using , ?15913 using , ?15914 using , ?15962 using ?15965 , ?15963 using ?15966 , ?15965 using , ?15966 using , ?15970 using , ?15971 using , ?15987 using , ?15988 using , ?16037 using ?16040 , ?16038 using ?16041 , ?16040 using , ?16041 using , ?16045 using , ?16046 using , ?16062 using , ?16063 using ,)


Qed.
equality_unique is defined



Lemma beta_type_l : forall Γ a A b B s1 s2 s3, Rel s1 s2 s3 -> Γ a : A -> Γ A : !s1
                         -> A::Γ b : B -> A::Γ B : !s2 -> Γ ((λ[A], ba) : B[←a].
1 subgoals, subgoal 1 (ID 16126)
  
  ============================
   forall (Γ : Env) (a A b B : Term) (s1 s2 s3 : Sorts),
   Rel s1 s2 s3 ->
   Γ ⊢ a : A ->
   Γ ⊢ A : !s1 ->
   A :: Γ ⊢ b : B -> A :: Γ ⊢ B : !s2 -> Γ ⊢ (λ [A], b) · a : B [ ← a]

(dependent evars:)


intros;repeat econstructor;eauto.
No more subgoals.
(dependent evars: ?16145 using , ?16152 using , ?16153 using , ?16154 using ,)


Qed.
beta_type_l is defined



Lemma beta_type_r : forall Γ a A b B, Γ a : A -> A::Γ b : B -> Γ b[←a] : B[←a].
1 subgoals, subgoal 1 (ID 16203)
  
  ============================
   forall (Γ : Env) (a A b B : Term),
   Γ ⊢ a : A -> A :: Γ ⊢ b : B -> Γ ⊢ b [ ← a] : B [ ← a]

(dependent evars:)


intros;eapply substitution;eauto.
No more subgoals.
(dependent evars: ?16219 using ?16226 , ?16220 using ?16228 , ?16221 using ?16229 , ?16226 using , ?16228 using , ?16229 using , ?16235 using , ?16236 using ,)


Qed.
beta_type_r is defined



Lemma equality_typing : forall Γ H A B, Γ H : A = B -> has_type A Γ /\ has_type B Γ.
1 subgoals, subgoal 1 (ID 16305)
  
  ============================
   forall (Γ : Env) (H : Prf) (A B : Term),
   Γ ⊢ H : A = B -> has_type A Γ /\ has_type B Γ

(dependent evars:)


unfold has_type;induction 1;eauto;intuition;[exists B[←a];eapply beta_type_l;eauto|exists B[←a];eapply beta_type_r;eauto|
try (repeat econstructor;eauto;fail)..].
3 subgoals, subgoal 1 (ID 16677)
  
  Γ : Env
  A : Term
  A' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  H0 : Rel s1 s2 s3
  H1 : Rel s1' s2' s3'
  H2 : Γ ⊢ A : !s1
  H3 : Γ ⊢ A' : !s1'
  H4 : A :: Γ ⊢ B : !s2
  H5 : A' :: Γ ⊢ B' : !s2'
  H0_ : Γ ⊢ H : A = A'
  H0_0 : A :: Γ ⊢ K : B = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H6 : exists B : Term, Γ ⊢ A : B
  H7 : exists B : Term, Γ ⊢ A' : B
  H8 : exists B0 : Term, A :: Γ ⊢ B : B0
  H9 : exists B : Term, A :: Γ ⊢ (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] : B
  ============================
   exists B0 : Term, Γ ⊢ Π (A), B : B0

subgoal 2 (ID 16740) is:
 exists B0 : Term, Γ ⊢ λ [A], b : B0
subgoal 3 (ID 16741) is:
 exists B0 : Term, Γ ⊢ λ [A'], b' : B0
(dependent evars: ?16478 using , ?16480 using , ?16586 using , ?16588 using , ?16590 using , ?16591 using , ?16859 using , ?16860 using , ?16861 using , ?16869 using , ?16897 using ?16902 , ?16902 using , ?16903 using , ?16904 using , ?17005 using ?17012 , ?17012 using , ?17013 using , ?17029 using ?17036 , ?17036 using , ?17037 using ,)


econstructor;econstructor;[exact H0|eauto..].
2 subgoals, subgoal 1 (ID 16740)
  
  Γ : Env
  A : Term
  A' : Term
  b : Term
  b' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  H0 : Rel s1 s2 s3
  H1 : Rel s1' s2' s3'
  H2 : Γ ⊢ A : !s1
  H3 : Γ ⊢ A' : !s1'
  H4 : A :: Γ ⊢ b : B
  H5 : A' :: Γ ⊢ b' : B'
  H6 : A :: Γ ⊢ B : !s2
  H7 : A' :: Γ ⊢ B' : !s2'
  H0_ : Γ ⊢ H : A = A'
  H0_0 : A :: Γ ⊢ K : b = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H8 : exists B : Term, Γ ⊢ A : B
  H9 : exists B : Term, Γ ⊢ A' : B
  H10 : exists B : Term, A :: Γ ⊢ b : B
  H11 : exists B : Term, A :: Γ ⊢ (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] : B
  ============================
   exists B0 : Term, Γ ⊢ λ [A], b : B0

subgoal 2 (ID 16741) is:
 exists B0 : Term, Γ ⊢ λ [A'], b' : B0
(dependent evars: ?16478 using , ?16480 using , ?16586 using , ?16588 using , ?16590 using , ?16591 using , ?16859 using , ?16860 using , ?16861 using , ?16869 using , ?16897 using ?16902 , ?16902 using , ?16903 using , ?16904 using , ?17005 using ?17012 , ?17012 using , ?17013 using , ?17029 using ?17036 , ?17036 using , ?17037 using , ?17053 using ?17058 , ?17058 using , ?17059 using , ?17060 using ,)


econstructor;econstructor;[exact H0|eauto..].
1 subgoals, subgoal 1 (ID 16741)
  
  Γ : Env
  A : Term
  A' : Term
  b : Term
  b' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  H0 : Rel s1 s2 s3
  H1 : Rel s1' s2' s3'
  H2 : Γ ⊢ A : !s1
  H3 : Γ ⊢ A' : !s1'
  H4 : A :: Γ ⊢ b : B
  H5 : A' :: Γ ⊢ b' : B'
  H6 : A :: Γ ⊢ B : !s2
  H7 : A' :: Γ ⊢ B' : !s2'
  H0_ : Γ ⊢ H : A = A'
  H0_0 : A :: Γ ⊢ K : b = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H8 : exists B : Term, Γ ⊢ A : B
  H9 : exists B : Term, Γ ⊢ A' : B
  H10 : exists B : Term, A :: Γ ⊢ b : B
  H11 : exists B : Term, A :: Γ ⊢ (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1] : B
  ============================
   exists B0 : Term, Γ ⊢ λ [A'], b' : B0

(dependent evars: ?16478 using , ?16480 using , ?16586 using , ?16588 using , ?16590 using , ?16591 using , ?16859 using , ?16860 using , ?16861 using , ?16869 using , ?16897 using ?16902 , ?16902 using , ?16903 using , ?16904 using , ?17005 using ?17012 , ?17012 using , ?17013 using , ?17029 using ?17036 , ?17036 using , ?17037 using , ?17053 using ?17058 , ?17058 using , ?17059 using , ?17060 using , ?17065 using ?17072 ?17071 , ?17071 using , ?17072 using , ?17073 using , ?17074 using , ?17075 using ,)


econstructor;econstructor;[exact H1|eauto..].
No more subgoals.
(dependent evars: ?16478 using , ?16480 using , ?16586 using , ?16588 using , ?16590 using , ?16591 using , ?16859 using , ?16860 using , ?16861 using , ?16869 using , ?16897 using ?16902 , ?16902 using , ?16903 using , ?16904 using , ?17005 using ?17012 , ?17012 using , ?17013 using , ?17029 using ?17036 , ?17036 using , ?17037 using , ?17053 using ?17058 , ?17058 using , ?17059 using , ?17060 using , ?17065 using ?17072 ?17071 , ?17071 using , ?17072 using , ?17073 using , ?17074 using , ?17075 using , ?17081 using ?17088 ?17087 , ?17087 using , ?17088 using , ?17089 using , ?17090 using , ?17091 using ,)


Qed.
equality_typing is defined



Type Correction: if a judgment is valid, the type is either welltyped itself, or syntacticaly a sort. This distinction comes from the fact that we abstracted the typing of sorts with Ax and that they may be some untyped sorts (also called top-sorts).
Theorem TypeCorrect : forall Γ M N, Γ M : N -> semitype N Γ.
1 subgoals, subgoal 1 (ID 17105)
  
  ============================
   forall (Γ : Env) (M N : Term), Γ ⊢ M : N -> semitype N Γ

(dependent evars:)


intros; induction H;unfold semitype;eauto.
2 subgoals, subgoal 1 (ID 17202)
  
  Γ : Env
  A : Term
  v : nat
  H : Γ ⊣
  H0 : A ↓ v ⊂ Γ
  ============================
   (exists s : Sorts, A = !s) \/ (exists s : Sorts, Γ ⊢ A : !s)

subgoal 2 (ID 17205) is:
 (exists s : Sorts, B [ ← a] = !s) \/ (exists s : Sorts, Γ ⊢ B [ ← a] : !s)
(dependent evars: ?17213 using , ?17229 using , ?17234 using , ?17236 using , ?17237 using , ?17250 using ,)


apply wf_item_lift in H0; auto.
1 subgoals, subgoal 1 (ID 17205)
  
  Γ : Env
  F : Term
  a : Term
  A : Term
  B : Term
  H : Γ ⊢ F : Π (A), B
  H0 : Γ ⊢ a : A
  IHtyp1 : semitype (Π (A), B) Γ
  IHtyp2 : semitype A Γ
  ============================
   (exists s : Sorts, B [ ← a] = !s) \/ (exists s : Sorts, Γ ⊢ B [ ← a] : !s)

(dependent evars: ?17213 using , ?17229 using , ?17234 using , ?17236 using , ?17237 using , ?17250 using ,)


destruct IHtyp1 as [[]|[]]; try discriminate;
apply gen_pi in H1 as (?&s&?&?&?&?&?);subst.
1 subgoals, subgoal 1 (ID 17304)
  
  Γ : Env
  F : Term
  a : Term
  A : Term
  B : Term
  H : Γ ⊢ F : Π (A), B
  H0 : Γ ⊢ a : A
  x : Sorts
  IHtyp2 : semitype A Γ
  x0 : Sorts
  s : Sorts
  x1 : Sorts
  H1 : !x = !x1
  H2 : Rel x0 s x1
  H3 : Γ ⊢ A : !x0
  H4 : A :: Γ ⊢ B : !s
  ============================
   (exists s0 : Sorts, B [ ← a] = !s0) \/
   (exists s0 : Sorts, Γ ⊢ B [ ← a] : !s0)

(dependent evars: ?17213 using , ?17229 using , ?17234 using , ?17236 using , ?17237 using , ?17250 using ,)


right;exists s.
1 subgoals, subgoal 1 (ID 17308)
  
  Γ : Env
  F : Term
  a : Term
  A : Term
  B : Term
  H : Γ ⊢ F : Π (A), B
  H0 : Γ ⊢ a : A
  x : Sorts
  IHtyp2 : semitype A Γ
  x0 : Sorts
  s : Sorts
  x1 : Sorts
  H1 : !x = !x1
  H2 : Rel x0 s x1
  H3 : Γ ⊢ A : !x0
  H4 : A :: Γ ⊢ B : !s
  ============================
   Γ ⊢ B [ ← a] : !s

(dependent evars: ?17213 using , ?17229 using , ?17234 using , ?17236 using , ?17237 using , ?17250 using ,)


change (!s) with (!s [← a]);eapply substitution;eauto.
No more subgoals.
(dependent evars: ?17213 using , ?17229 using , ?17234 using , ?17236 using , ?17237 using , ?17250 using , ?17319 using ?17326 , ?17320 using ?17328 , ?17321 using ?17329 , ?17326 using , ?17328 using , ?17329 using , ?17333 using ,)


Qed.
TypeCorrect is defined



Equivalence with presentation of PTS in the paper
Reserved Notation "Γ ⊢' M : N" (at level 80, M, N at level 30, no associativity).

Reserved Notation "Γ ⊣' " (at level 80, no associativity).

Reserved Notation "Γ ⊢' H : M = N" (at level 80, H, M, N at level 30, no associativity).


Inductive simple_wf : Env -> Prop :=
 | lwf_nil : nil ⊣'
 | lwf_cons : forall Γ A s, Γ ⊢' A : !s -> A::Γ ⊣'
where "Γ ⊣'" := (simple_wf Γ) : F_scope
with simple_typ : Env -> Term -> Term -> Prop :=
 | lcSort : forall Γ s t, Ax s t -> Γ ⊣' -> Γ ⊢' !s : !t
 | lcVar : forall Γ A v, Γ ⊣' -> A v Γ -> Γ ⊢' #v : A
 | lcProd : forall Γ A B s1 s2 s3, Rel s1 s2 s3 -> Γ ⊢' A : !s1 -> A::Γ ⊢' B : !s2 -> Γ ⊢' Π(A), B : !s3
 | lcAbs : forall Γ A B b s, A::Γ ⊢' b : B -> Γ ⊢' Π(A), B : !s -> Γ ⊢' λ[A], b : Π(A), B
 | lcApp : forall Γ F a A B , Γ ⊢' F : Π(A), B -> Γ ⊢' a : A -> Γ ⊢' F · a : B[←a]
 | lcConv : forall Γ a A B s H, Γ ⊢' a : A -> Γ ⊢' B : !s -> Γ ⊢' H : A = B -> Γ ⊢' a H : B
where "Γ ⊢' t : T" := (simple_typ Γ t T) : F_scope
with simple_typ_h : Env -> Prf -> Term -> Term -> Prop :=
 | lcRefl : forall Γ a A, Γ ⊢' a : A -> Γ ⊢' ρ a : a = a
 | lcSym : forall Γ H A B, Γ ⊢' H : A = B -> Γ ⊢' H : B = A
 | lcTrans : forall Γ H K A B C, Γ ⊢' H : A = B -> Γ ⊢' K : B = C -> Γ ⊢' HK : A = C
 | lcBeta : forall Γ a A b B, Γ ⊢' (λ[A], ba : B -> Γ ⊢' β((λ[A], ba) : (λ[A], ba = b[←a]
 | lcProdEq : forall Γ A A' B B' H K s s', Γ ⊢' Π(A), B : !s -> Γ ⊢' Π(A'), B' : !s'
            -> Γ ⊢' H : A = A' -> A::Γ ⊢' K : B = (B'1#1)[←#0Hh1] -> Γ ⊢' {H,[A]K} : Π(A), B = Π(A'), B'
 | lcAbsEq : forall Γ A A' b b' B B' H K, Γ ⊢' λ[A], b : Π(A), B -> Γ ⊢' λ[A'], b' : Π(A'), B'
            -> Γ ⊢' H : A = A' -> A::Γ ⊢' K : b = (b'1#1)[←#0Hh1] -> Γ ⊢' H,[A]K : λ[A], b = λ[A'], b'
 | lcAppEq : forall Γ F F' a a' B B' H K, Γ ⊢' F · a : B -> Γ ⊢' F' · a' : B'
            -> Γ ⊢' H : F = F' -> Γ ⊢' K : a = a' -> Γ ⊢' H ·h K : F · a = F' · a'
 | lcIota : forall Γ a B H, Γ ⊢' a H : B -> Γ ⊢' ι(aH) : a = aH
where "Γ ⊢' H : A = B" := (simple_typ_h Γ H A B) : F_scope.
simple_wf, simple_typ, simple_typ_h are defined
simple_wf_ind is defined
simple_typ_ind is defined
simple_typ_h_ind is defined



Local Hint Constructors simple_typ simple_typ_h simple_wf.
Warning: the hint: eapply lcProd will only be used by eauto
Warning: the hint: eapply lcAbs will only be used by eauto
Warning: the hint: eapply lcApp will only be used by eauto
Warning: the hint: eapply lcConv will only be used by eauto
Warning: the hint: eapply lcRefl will only be used by eauto
Warning: the hint: eapply lcTrans will only be used by eauto
Warning: the hint: eapply lcBeta will only be used by eauto
Warning: the hint: eapply lcProdEq will only be used by eauto
Warning: the hint: eapply lcAbsEq will only be used by eauto
Warning: the hint: eapply lcAppEq will only be used by eauto
Warning: the hint: eapply lcIota will only be used by eauto
Warning: the hint: eapply lwf_cons will only be used by eauto



Scheme ltyp_ind' := Induction for simple_typ Sort Prop
  with lwf_ind' := Induction for simple_wf Sort Prop
  with ltyph_ind' := Induction for simple_typ_h Sort Prop.
ltyph_ind' is defined
lwf_ind' is defined
ltyp_ind' is defined
ltyp_ind', lwf_ind', ltyph_ind' are recursively defined


Combined Scheme ltyp_induc from ltyp_ind', ltyph_ind',lwf_ind'.
ltyp_induc is defined
ltyp_induc is recursively defined



Lemma simple2normal : (forall Γ M N, Γ ⊢' M : N -> Γ M : N)/\
                      (forall Γ H M N, Γ ⊢' H : M = N -> Γ H : M = N)/\
                      (forall Γ , Γ ⊣' -> Γ ).
1 subgoals, subgoal 1 (ID 17449)
  
  ============================
   (forall (Γ : Env) (M N : Term), Γ ⊢'     M : N -> Γ ⊢ M : N) /\
   (forall (Γ : Env) (H : Prf) (M N : Term), Γ ⊢' H : M = N -> Γ ⊢ H : M = N) /\
   (forall Γ : Env, Γ ⊣' -> Γ ⊣)

(dependent evars:)


Proof.
1 subgoals, subgoal 1 (ID 17449)
  
  ============================
   (forall (Γ : Env) (M N : Term), Γ ⊢'     M : N -> Γ ⊢ M : N) /\
   (forall (Γ : Env) (H : Prf) (M N : Term), Γ ⊢' H : M = N -> Γ ⊢ H : M = N) /\
   (forall Γ : Env, Γ ⊣' -> Γ ⊣)

(dependent evars:)


apply ltyp_induc;intros;eauto.
6 subgoals, subgoal 1 (ID 17497)
  
  Γ : list Term
  A : Term
  B : Term
  b : Term
  s : Sorts
  s0 : A :: Γ ⊢'     b : B
  H : A :: Γ ⊢ b : B
  s1 : Γ ⊢'     Π (A), B : !s
  H0 : Γ ⊢ Π (A), B : !s
  ============================
   Γ ⊢ λ [A], b : Π (A), B

subgoal 2 (ID 17551) is:
 Γ ⊢ β((λ [A], b) · a) : (λ [A], b) · a = b [ ← a]
subgoal 3 (ID 17568) is:
 Γ ⊢ {H, [A]K} : Π (A), B = Π (A'), B'
subgoal 4 (ID 17585) is:
 Γ ⊢ ⟨H, [A]K ⟩ : λ [A], b = λ [A'], b'
subgoal 5 (ID 17602) is:
 Γ ⊢ H ·h K : F · a = F' · a'
subgoal 6 (ID 17608) is:
 Γ ⊢ ι(a ∽ H) : a = a ∽ H
(dependent evars: ?17620 using , ?17621 using , ?17632 using , ?17635 using , ?17636 using , ?17643 using , ?17648 using , ?17651 using ,)


inversion H0;subst;econstructor;eassumption.
5 subgoals, subgoal 1 (ID 17551)
  
  Γ : Env
  a : Term
  A : Term
  b : Term
  B : Term
  s : Γ ⊢'     (λ [A], b) · a : B
  H : Γ ⊢ (λ [A], b) · a : B
  ============================
   Γ ⊢ β((λ [A], b) · a) : (λ [A], b) · a = b [ ← a]

subgoal 2 (ID 17568) is:
 Γ ⊢ {H, [A]K} : Π (A), B = Π (A'), B'
subgoal 3 (ID 17585) is:
 Γ ⊢ ⟨H, [A]K ⟩ : λ [A], b = λ [A'], b'
subgoal 4 (ID 17602) is:
 Γ ⊢ H ·h K : F · a = F' · a'
subgoal 5 (ID 17608) is:
 Γ ⊢ ι(a ∽ H) : a = a ∽ H
(dependent evars: ?17620 using , ?17621 using , ?17632 using , ?17635 using , ?17636 using , ?17643 using , ?17648 using , ?17651 using , ?17918 using , ?17919 using , ?17920 using ,)


inversion H;inversion H3;subst;econstructor;eassumption.
4 subgoals, subgoal 1 (ID 17568)
  
  Γ : Env
  A : Term
  A' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s : Sorts
  s' : Sorts
  s0 : Γ ⊢'     Π (A), B : !s
  H0 : Γ ⊢ Π (A), B : !s
  s1 : Γ ⊢'     Π (A'), B' : !s'
  H1 : Γ ⊢ Π (A'), B' : !s'
  s2 : Γ ⊢' H : A = A'
  H2 : Γ ⊢ H : A = A'
  s3 : A :: Γ ⊢' K : B = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H3 : A :: Γ ⊢ K : B = (B' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  ============================
   Γ ⊢ {H, [A]K} : Π (A), B = Π (A'), B'

subgoal 2 (ID 17585) is:
 Γ ⊢ ⟨H, [A]K ⟩ : λ [A], b = λ [A'], b'
subgoal 3 (ID 17602) is:
 Γ ⊢ H ·h K : F · a = F' · a'
subgoal 4 (ID 17608) is:
 Γ ⊢ ι(a ∽ H) : a = a ∽ H
(dependent evars: ?17620 using , ?17621 using , ?17632 using , ?17635 using , ?17636 using , ?17643 using , ?17648 using , ?17651 using , ?17918 using , ?17919 using , ?17920 using , ?18355 using , ?18356 using , ?18357 using , ?18358 using ,)


inversion H0;inversion H1;subst;econstructor;[eexact H8|..];eassumption.
3 subgoals, subgoal 1 (ID 17585)
  
  Γ : Env
  A : Term
  A' : Term
  b : Term
  b' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s : Γ ⊢'     λ [A], b : Π (A), B
  H0 : Γ ⊢ λ [A], b : Π (A), B
  s0 : Γ ⊢'     λ [A'], b' : Π (A'), B'
  H1 : Γ ⊢ λ [A'], b' : Π (A'), B'
  s1 : Γ ⊢' H : A = A'
  H2 : Γ ⊢ H : A = A'
  s2 : A :: Γ ⊢' K : b = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H3 : A :: Γ ⊢ K : b = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  ============================
   Γ ⊢ ⟨H, [A]K ⟩ : λ [A], b = λ [A'], b'

subgoal 2 (ID 17602) is:
 Γ ⊢ H ·h K : F · a = F' · a'
subgoal 3 (ID 17608) is:
 Γ ⊢ ι(a ∽ H) : a = a ∽ H
(dependent evars: ?17620 using , ?17621 using , ?17632 using , ?17635 using , ?17636 using , ?17643 using , ?17648 using , ?17651 using , ?17918 using , ?17919 using , ?17920 using , ?18355 using , ?18356 using , ?18357 using , ?18358 using , ?18775 using , ?18776 using , ?18777 using , ?18778 using , ?18779 using , ?18780 using ,)


inversion H0;inversion H1;subst;econstructor;[eexact H7|..];eassumption.
2 subgoals, subgoal 1 (ID 17602)
  
  Γ : Env
  F : Term
  F' : Term
  a : Term
  a' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s : Γ ⊢'     F · a : B
  H0 : Γ ⊢ F · a : B
  s0 : Γ ⊢'     F' · a' : B'
  H1 : Γ ⊢ F' · a' : B'
  s1 : Γ ⊢' H : F = F'
  H2 : Γ ⊢ H : F = F'
  s2 : Γ ⊢' K : a = a'
  H3 : Γ ⊢ K : a = a'
  ============================
   Γ ⊢ H ·h K : F · a = F' · a'

subgoal 2 (ID 17608) is:
 Γ ⊢ ι(a ∽ H) : a = a ∽ H
(dependent evars: ?17620 using , ?17621 using , ?17632 using , ?17635 using , ?17636 using , ?17643 using , ?17648 using , ?17651 using , ?17918 using , ?17919 using , ?17920 using , ?18355 using , ?18356 using , ?18357 using , ?18358 using , ?18775 using , ?18776 using , ?18777 using , ?18778 using , ?18779 using , ?18780 using , ?19205 using , ?19206 using , ?19207 using , ?19208 using , ?19209 using , ?19210 using , ?19211 using , ?19212 using ,)


inversion H0;inversion H1;subst;econstructor;eassumption.
1 subgoals, subgoal 1 (ID 17608)
  
  Γ : Env
  a : Term
  B : Term
  H : Prf
  s : Γ ⊢'     a ∽ H : B
  H0 : Γ ⊢ a ∽ H : B
  ============================
   Γ ⊢ ι(a ∽ H) : a = a ∽ H

(dependent evars: ?17620 using , ?17621 using , ?17632 using , ?17635 using , ?17636 using , ?17643 using , ?17648 using , ?17651 using , ?17918 using , ?17919 using , ?17920 using , ?18355 using , ?18356 using , ?18357 using , ?18358 using , ?18775 using , ?18776 using , ?18777 using , ?18778 using , ?18779 using , ?18780 using , ?19205 using , ?19206 using , ?19207 using , ?19208 using , ?19209 using , ?19210 using , ?19211 using , ?19212 using , ?19622 using , ?19623 using , ?19624 using , ?19625 using ,)


inversion H0;subst;econstructor;eassumption.
No more subgoals.
(dependent evars: ?17620 using , ?17621 using , ?17632 using , ?17635 using , ?17636 using , ?17643 using , ?17648 using , ?17651 using , ?17918 using , ?17919 using , ?17920 using , ?18355 using , ?18356 using , ?18357 using , ?18358 using , ?18775 using , ?18776 using , ?18777 using , ?18778 using , ?18779 using , ?18780 using , ?19205 using , ?19206 using , ?19207 using , ?19208 using , ?19209 using , ?19210 using , ?19211 using , ?19212 using , ?19622 using , ?19623 using , ?19624 using , ?19625 using , ?19837 using , ?19838 using , ?19839 using ,)


Qed.
simple2normal is defined



Lemma normal2simple : (forall Γ M N, Γ M : N -> Γ ⊢' M : N)/\
                      (forall Γ H M N, Γ H : M = N -> Γ ⊢' H : M = N)/\
                      (forall Γ, Γ -> Γ ⊣').
1 subgoals, subgoal 1 (ID 19852)
  
  ============================
   (forall (Γ : Env) (M N : Term), Γ ⊢ M : N -> Γ ⊢'     M : N) /\
   (forall (Γ : Env) (H : Prf) (M N : Term), Γ ⊢ H : M = N -> Γ ⊢' H : M = N) /\
   (forall Γ : Env, Γ ⊣ -> Γ ⊣')

(dependent evars:)


Proof.
1 subgoals, subgoal 1 (ID 19852)
  
  ============================
   (forall (Γ : Env) (M N : Term), Γ ⊢ M : N -> Γ ⊢'     M : N) /\
   (forall (Γ : Env) (H : Prf) (M N : Term), Γ ⊢ H : M = N -> Γ ⊢' H : M = N) /\
   (forall Γ : Env, Γ ⊣ -> Γ ⊣')

(dependent evars:)


apply typ_induc;intros;eauto.
1 subgoals, subgoal 1 (ID 20029)
  
  Γ : Env
  A : Term
  A' : Term
  b : Term
  b' : Term
  B : Term
  B' : Term
  H : Prf
  K : Prf
  s1 : Sorts
  s2 : Sorts
  s3 : Sorts
  s1' : Sorts
  s2' : Sorts
  s3' : Sorts
  r : Rel s1 s2 s3
  r0 : Rel s1' s2' s3'
  t : Γ ⊢ A : !s1
  H0 : Γ ⊢'     A : !s1
  t0 : Γ ⊢ A' : !s1'
  H1 : Γ ⊢'     A' : !s1'
  t1 : A :: Γ ⊢ b : B
  H2 : A :: Γ ⊢'     b : B
  t2 : A' :: Γ ⊢ b' : B'
  H3 : A' :: Γ ⊢'     b' : B'
  t3 : A :: Γ ⊢ B : !s2
  H4 : A :: Γ ⊢'     B : !s2
  t4 : A' :: Γ ⊢ B' : !s2'
  H5 : A' :: Γ ⊢'     B' : !s2'
  t5 : Γ ⊢ H : A = A'
  H6 : Γ ⊢' H : A = A'
  t6 : A :: Γ ⊢ K : b = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  H7 : A :: Γ ⊢' K : b = (b' ↑  1 # 1) [ ← #0 ∽ H ↑h 1]
  ============================
   Γ ⊢' ⟨H, [A]K ⟩ : λ [A], b = λ [A'], b'

(dependent evars: ?20070 using , ?20071 using , ?20075 using , ?20078 using , ?20079 using , ?20083 using , ?20086 using , ?20087 using , ?20091 using , ?20093 using , ?20096 using , ?20099 using ?20106 ?20105 ?20104 , ?20104 using , ?20105 using , ?20106 using , ?20107 using , ?20110 using , ?20113 using , ?20114 using , ?20118 using , ?20119 using , ?20124 using , ?20125 using , ?20129 using , ?20130 using , ?20156 using ?20167 ?20166 ?20165 , ?20157 using ?20176 ?20175 ?20174 , ?20165 using , ?20166 using , ?20167 using , ?20168 using , ?20174 using , ?20175 using , ?20176 using , ?20177 using , ?20180 using , ?20182 using , ?20183 using ,)


econstructor;eassumption||econstructor;eassumption||econstructor;[eexact r|..];eassumption.
No more subgoals.
(dependent evars: ?20070 using , ?20071 using , ?20075 using , ?20078 using , ?20079 using , ?20083 using , ?20086 using , ?20087 using , ?20091 using , ?20093 using , ?20096 using , ?20099 using ?20106 ?20105 ?20104 , ?20104 using , ?20105 using , ?20106 using , ?20107 using , ?20110 using , ?20113 using , ?20114 using , ?20118 using , ?20119 using , ?20124 using , ?20125 using , ?20129 using , ?20130 using , ?20156 using ?20167 ?20166 ?20165 , ?20157 using ?20176 ?20175 ?20174 , ?20165 using , ?20166 using , ?20167 using , ?20168 using , ?20174 using , ?20175 using , ?20176 using , ?20177 using , ?20180 using , ?20182 using , ?20183 using , ?20217 using , ?20218 using , ?20227 using , ?20234 using , ?20240 using , ?20241 using , ?20248 using , ?20249 using ,)


Qed.
normal2simple is defined



Lemma normal_equiv_simple : (forall Γ M N, Γ M : N <-> Γ ⊢' M : N)/\
                            (forall Γ H M N, Γ H : M = N <-> Γ ⊢' H : M = N)/\
                            (forall Γ , Γ <-> Γ ⊣').
1 subgoals, subgoal 1 (ID 20262)
  
  ============================
   (forall (Γ : Env) (M N : Term), Γ ⊢ M : N <-> Γ ⊢'     M : N) /\
   (forall (Γ : Env) (H : Prf) (M N : Term), Γ ⊢ H : M = N <-> Γ ⊢' H : M = N) /\
   (forall Γ : Env, Γ ⊣ <-> Γ ⊣')

(dependent evars:)


repeat split;apply simple2normal||apply normal2simple.
No more subgoals.
(dependent evars:)


Qed.
normal_equiv_simple is defined



End f_typ_mod.
Module f_typ_mod is defined



Index
This page has been generated by coqdoc