inductive red : T →T → Prop ≝
| rbeta: ∀P,M,N. red (App (Lambda P M) N) (M[0 ≝ N])
- | rdapp: ∀M,N. red (App (D M) N) (D (App M N))
- | rdlam: ∀M,N. red (Lambda M (D N)) (D (Lambda M N))
| rappl: ∀M,M1,N. red M M1 → red (App M N) (App M1 N)
| rappr: ∀M,N,N1. red N N1 → red (App M N) (App M N1)
| rlaml: ∀M,M1,N. red M M1 → red (Lambda M N) (Lambda M1 N)
]
qed.
-theorem type_of_type: ∀G,A,B. G ⊢ A : B → (∀i. B ≠ Sort i) →
- ∃i. G ⊢ B : Sort i.
-#G #A #B #t (elim t)
+theorem type_of_type: ∀P,G,A,B. G ⊢_{P} A : B → (∀i. B ≠ Sort i) →
+ ∃i. G ⊢_{P} B : Sort i.
+#Pts #G #A #B #t (elim t)
[#i #j #Aij #j @False_ind /2/
|#G1 #A #i #t1 #_ #P @(ex_intro … i) @(weak … t1 t1)
|#G1 #A #B #C #i #t1 #t2 #H1 #H2 #H3 (cases (H1 ?) )
]
qed.
-lemma prod_sort : ∀G,M,P,Q. G ⊢ M :Prod P Q →
- ∃i. P::G ⊢ Q : Sort i.
-#G #M #P #Q #t cases(type_of_type …t ?);
+lemma prod_sort : ∀Pts,G,M,P,Q. G ⊢_{Pts} M :Prod P Q →
+ ∃i. P::G ⊢_{Pts} Q : Sort i.
+#Pts #G #M #P #Q #t cases(type_of_type …t ?);
[#s #t2 cases(prod_inv … t2 …(refl …)) #s1 * #s2 * #s3 * *
#_ #_ #H @(ex_intro … s2) //
| #i % #H destruct
axiom red_lift: ∀M,N. red (lift M 0 1) N →
∃P. N = lift P 0 1 ∧ red M P.
-theorem tj_d : ∀G,M,N. G ⊢ D M : N → G ⊢ M : N.
-#G (cut (∀M,N. G ⊢ M : N → ∀P. M = D P → G ⊢ P : N)) [2: /2/]
+theorem tj_d : ∀P,G,M,N. G ⊢_{P} D M : N → G ⊢_{P} M : N.
+#Pts #G (cut (∀M,N. G ⊢_{Pts} M : N → ∀P. M = D P → G ⊢_{Pts} P : N)) [2: /2/]
#M #N #t (elim t)
[#i #j #Aij #P #H destruct
|#G1 #A #i #t1 #_ #P #H destruct
definition red0 ≝ λM,N. M = N ∨ red M N.
-axiom conv_lift: ∀i,M,N. conv M N →
- conv (lift M 0 i) (lift N 0 i).
-axiom red_to_conv : ∀M,N. red M N → conv M N.
-axiom refl_conv: ∀M. conv M M.
-axiom sym_conv: ∀M,N. conv M N → conv N M.
-axiom red0_to_conv : ∀M,N. red0 M N → conv M N.
-axiom conv_prod: ∀A,B,M,N. conv A B → conv M N →
- conv (Prod A M) (Prod B N).
-axiom conv_subst_1: ∀M,P,Q. red P Q → conv (M[0≝Q]) (M[0≝P]).
+axiom conv_lift: ∀P,i,M,N. Co P M N →
+ Co P (lift M 0 i) (lift N 0 i).
+axiom red_to_conv : ∀P,M,N. red M N → Co P M N.
+axiom red0_to_conv : ∀P,M,N. red0 M N → Co P M N.
+axiom conv_prod: ∀P,A,B,M,N. Co P A B → Co P M N →
+ Co P (Prod A M) (Prod B N).
+axiom conv_subst_1: ∀Pts,M,P,Q. red P Q → Co Pts (M[0≝Q]) (M[0≝P]).
inductive redG : list T → list T → Prop ≝
| rnil : redG (nil T) (nil T)
#A #B #G1 #G2 #r1 #r2 #_ #H destruct
qed.
-(*
-inductive redG : list T → list T → Prop ≝
- |redT : ∀A,B,G1,G2. red A B → redG G1 G2 →
- redG (A::G1) (B::G2)
- |redF : ∀A,G1,G2. redG G1 G2 → redG (A::G1) (A::G2).
-
-lemma redG_inv: ∀A,G,G1. redG (A::G) G1 →
- ∃B. ∃G2. red0 A B ∧ redG G G2 ∧ G1 = B::G2.
-#A #G #G1 #rg (inversion rg)
- [#H destruct
- |#A1 #B1 #G2 #G3 #r1 #r2 #_ #H destruct
- #H1 @(ex_intro … B1) @(ex_intro … G3) % // % //
- ]
-qed. *)
-
-axiom conv_prod_split: ∀A,A1,B,B1. conv (Prod A B) (Prod A1 B1) →
-conv A A1 ∧ conv B B1.
+axiom conv_prod_split: ∀P,A,A1,B,B1.
+ Co P(Prod A B) (Prod A1 B1) → Co P A A1 ∧ Co P B B1.
axiom red0_prod : ∀M,N,P. red0 (Prod M N) P →
(∃Q. P = Prod Q N ∧ red0 M Q) ∨
(∃Q. P = Prod M Q ∧ red0 N Q).
-
-axiom my_dummy: ∀G,M,N. G ⊢ M : N → G ⊢ D M : N.
-theorem subject_reduction: ∀G,M,N. TJ G M N → ∀M1. red0 M M1 →
-∀G1. redG G G1 → TJ G1 M1 N.
-#G #M #N #d (elim d)
+theorem subject_reduction: ∀P,G,M,N. G ⊢_{P} M:N →
+ ∀M1. red0 M M1 → ∀G1. redG G G1 → G1 ⊢_{P} M1:N.
+#Pts #G #M #N #d (elim d)
[#i #j #Aij #M1 *
[#eqM1 <eqM1 #G1 #H >(redG_nil …H) /2/
|#H @False_ind /2/
|#G1 #A #i #t1 #Hind #M1 *
[#eqM1 <eqM1 #G2 #H cases (redG_inv … H)
#P * #G3 * * #r1 #r2 #eqG2 >eqG2
- @(conv ?? (lift P O 1) ? i);
+ @(conv ??? (lift P O 1) ? i);
[@conv_lift @sym_conv @red0_to_conv //
|@(start … i) @Hind //
|@(weak … (Sort i) ? i); [@Hind /2/ | @Hind //]
|#reda (cases (red_app …reda))
[*
[*
- [* #M2 * #N1 * #eqA #eqM1 >eqM1 #G1 #rg
- cut (G1 ⊢ A: Prod B C); [@Hind1 /2/] #H1
+ #M2 * #N1 * #eqA #eqM1 >eqM1 #G1 #rg
+ cut (G1 ⊢_{Pts} A: Prod B C); [@Hind1 /2/] #H1
(cases (abs_inv … H1 … eqA)) #i * #N2 * *
#cProd #t3 #t4
- (cut (conv B M2 ∧ conv C N2) ) [/2/] * #convB #convC
+ (cut (Co Pts B M2 ∧ Co Pts C N2) ) [/2/] * #convB #convC
(cases (prod_inv … t3 … (refl …) )) #i * #j * #k * *
- #cik #t5 #t6 (cut (G1 ⊢ P:B))
+ #cik #t5 #t6 (cut (G1 ⊢_{Pts} P:B))
[@Hind2 /2/
- |#Hcut cut (G1 ⊢ N1[0:=P] : N2 [0:=P]);
+ |#Hcut cut (G1 ⊢_{Pts} N1[0:=P] : N2 [0:=P]);
[@(tj_subst_0 … M2) // @(conv … convB Hcut t5)
|#Hcut1 cases (prod_sort … H1) #s #Csort
@(conv … s … Hcut1);
[@conv_subst /2/ | @(tj_subst_0 … Csort) //]
]
]
- |* #M2 * #eqA #eqM1 >eqM1 #G1 #rg
- cut (G1 ⊢ A:Prod B C); [@Hind1 /2/] #t3
- cases (prod_sort …t3) #i #Csort @(dummy … i);
- [ @(app … B);
- [@tj_d @Hind1 /2/|@Hind2 /2/]
- | @(tj_subst_0 … B … (Sort i));
- [@Hind2 /2/
- |//
- ]
- ]
- (* @my_dummy @(app … B); [@tj_d @Hind1 /2/|@Hind2 /2/]
- *)
- ]
|* #M2 * #eqM1 >eqM1 #H #G1 #rg @(app … B);
[@Hind1 /2/ | @Hind2 /2/]
]
|* #M2 * #eqM1 >eqM1 #H #G1 #rg
- cut (G1 ⊢ A:Prod B C); [@Hind1 /2/] #t3
- cases (prod_sort …t3) #i #Csort @(conv ?? C[O≝ M2] … i);
+ cut (G1 ⊢_{Pts} A:Prod B C); [@Hind1 /2/] #t3
+ cases (prod_sort …t3) #i #Csort @(conv ??? C[O≝ M2] … i);
[@conv_subst_1 //
|@(app … B) // @Hind2 /2/
|@(tj_subst_0 … Csort) @Hind2 /2/
]
]
|#G #A #B #C #i #t1 #t2 #Hind1 #Hind2 #M2 #red0l #G1 #rg
- cut (A::G1⊢C:B); [@Hind1 /3/] #t3
- cut (G1 ⊢ Prod A B : Sort i); [@Hind2 /2/] #t4
+ cut (A::G1⊢_{Pts} C:B); [@Hind1 /3/] #t3
+ cut (G1 ⊢_{Pts} Prod A B : Sort i); [@Hind2 /2/] #t4
cases red0l;
[#eqM2 <eqM2 @(abs … t3 t4)
|#redl (cases (red_lambda … redl))
- [*
- [* #M3 * #eqM2 #redA >eqM2
- @(conv ?? (Prod M3 B) … t4);
+ [* #M3 * #eqM2 #redA >eqM2
+ @(conv ??? (Prod M3 B) … t4);
[@conv_prod /2/
|@(abs … i); [@Hind1 /3/ |@Hind2 /3/]
]
|* #M3 * #eqM3 #redC >eqM3
@(abs … t4) @Hind1 /3/
- ]
- |* #Q * #eqC #eqM2 >eqM2 @(dummy … t4)
- @(abs … t4) @tj_d @Hind1 /3/
]
]
|#G #A #B #C #i #convBC #t1 #t2 #Hind1 #Hind2 #M1 #redA