doc-src/Logics/CTT-rules.txt
author paulson
Fri Feb 16 18:00:47 1996 +0100 (1996-02-16)
changeset 1512 ce37c64244c0
parent 104 d8205bb279a7
permissions -rw-r--r--
Elimination of fully-functorial style.
Type tactic changed to a type abbrevation (from a datatype).
Constructor tactic and function apply deleted.
lcp@104
     1
\idx{refl_type}         A type ==> A = A), 
lcp@104
     2
\idx{refl_elem}         a : A ==> a = a : A
lcp@104
     3
lcp@104
     4
\idx{sym_type}          A = B ==> B = A
lcp@104
     5
\idx{sym_elem}          a = b : A ==> b = a : A
lcp@104
     6
lcp@104
     7
\idx{trans_type}        [| A = B;  B = C |] ==> A = C
lcp@104
     8
\idx{trans_elem}        [| a = b : A;  b = c : A |] ==> a = c : A
lcp@104
     9
lcp@104
    10
\idx{equal_types}       [| a : A;  A = B |] ==> a : B
lcp@104
    11
\idx{equal_typesL}      [| a = b : A;  A = B |] ==> a = b : B
lcp@104
    12
lcp@104
    13
\idx{subst_type}        [| a : A;  !!z. z:A ==> B(z) type |] ==> B(a) type
lcp@104
    14
lcp@104
    15
\idx{subst_typeL}       [| a = c : A;  !!z. z:A ==> B(z) = D(z) 
lcp@104
    16
                  |] ==> B(a) = D(c)
lcp@104
    17
\idx{subst_elem}        [| a : A;  !!z. z:A ==> b(z):B(z) |] ==> b(a):B(a)
lcp@104
    18
lcp@104
    19
\idx{subst_elemL}       [| a = c : A;  !!z. z:A ==> b(z) = d(z) : B(z) 
lcp@104
    20
                  |] ==> b(a) = d(c) : B(a)
lcp@104
    21
lcp@104
    22
\idx{refl_red}          Reduce(a,a)
lcp@104
    23
\idx{red_if_equal}      a = b : A ==> Reduce(a,b)
lcp@104
    24
\idx{trans_red}         [| a = b : A;  Reduce(b,c) |] ==> a = c : A
lcp@104
    25
lcp@104
    26
lcp@104
    27
\idx{NF}        N type
lcp@104
    28
lcp@104
    29
\idx{NI0}       0 : N
lcp@104
    30
\idx{NI_succ}   a : N ==> succ(a) : N
lcp@104
    31
\idx{NI_succL}  a = b : N ==> succ(a) = succ(b) : N
lcp@104
    32
lcp@104
    33
\idx{NE}        [| p: N;  a: C(0);  
lcp@104
    34
             !!u v. [| u: N; v: C(u) |] ==> b(u,v): C(succ(u)) 
lcp@104
    35
          |] ==> rec(p, a, %u v.b(u,v)) : C(p)
lcp@104
    36
lcp@104
    37
\idx{NEL}       [| p = q : N;  a = c : C(0);  
lcp@104
    38
             !!u v. [| u: N; v: C(u) |] ==> b(u,v) = d(u,v): C(succ(u))
lcp@104
    39
          |] ==> rec(p, a, %u v.b(u,v)) = rec(q,c,d) : C(p)
lcp@104
    40
lcp@104
    41
\idx{NC0}       [| a: C(0);  
lcp@104
    42
             !!u v. [| u: N; v: C(u) |] ==> b(u,v): C(succ(u))
lcp@104
    43
          |] ==> rec(0, a, %u v.b(u,v)) = a : C(0)
lcp@104
    44
lcp@104
    45
\idx{NC_succ}   [| p: N;  a: C(0);  
lcp@104
    46
             !!u v. [| u: N; v: C(u) |] ==> b(u,v): C(succ(u)) 
lcp@104
    47
          |] ==> rec(succ(p), a, %u v.b(u,v)) =
lcp@104
    48
                    b(p, rec(p, a, %u v.b(u,v))) : C(succ(p))
lcp@104
    49
lcp@104
    50
\idx{zero_ne_succ}      [| a: N;  0 = succ(a) : N |] ==> 0: F
lcp@104
    51
lcp@104
    52
lcp@104
    53
\idx{ProdF}     [| A type; !!x. x:A ==> B(x) type |] ==> PROD x:A.B(x) type
lcp@104
    54
\idx{ProdFL}    [| A = C;  !!x. x:A ==> B(x) = D(x) |] ==> 
lcp@104
    55
          PROD x:A.B(x) = PROD x:C.D(x)
lcp@104
    56
lcp@104
    57
\idx{ProdI}     [| A type;  !!x. x:A ==> b(x):B(x)
lcp@104
    58
          |] ==> lam x.b(x) : PROD x:A.B(x)
lcp@104
    59
\idx{ProdIL}    [| A type;  !!x. x:A ==> b(x) = c(x) : B(x)
lcp@104
    60
          |] ==> lam x.b(x) = lam x.c(x) : PROD x:A.B(x)
lcp@104
    61
lcp@104
    62
\idx{ProdE}     [| p : PROD x:A.B(x);  a : A |] ==> p`a : B(a)
lcp@104
    63
\idx{ProdEL}    [| p=q: PROD x:A.B(x);  a=b : A |] ==> p`a = q`b : B(a)
lcp@104
    64
lcp@104
    65
\idx{ProdC}     [| a : A;  !!x. x:A ==> b(x) : B(x)
lcp@104
    66
          |] ==> (lam x.b(x)) ` a = b(a) : B(a)
lcp@104
    67
lcp@104
    68
\idx{ProdC2}    p : PROD x:A.B(x) ==> (lam x. p`x) = p : PROD x:A.B(x)
lcp@104
    69
lcp@104
    70
lcp@104
    71
\idx{SumF}      [| A type;  !!x. x:A ==> B(x) type |] ==> SUM x:A.B(x) type
lcp@104
    72
\idx{SumFL}     [| A = C;  !!x. x:A ==> B(x) = D(x) 
lcp@104
    73
          |] ==> SUM x:A.B(x) = SUM x:C.D(x)
lcp@104
    74
lcp@104
    75
\idx{SumI}      [| a : A;  b : B(a) |] ==> <a,b> : SUM x:A.B(x)
lcp@104
    76
\idx{SumIL}     [| a=c:A;  b=d:B(a) |] ==> <a,b> = <c,d> : SUM x:A.B(x)
lcp@104
    77
lcp@104
    78
\idx{SumE}      [| p: SUM x:A.B(x);  
lcp@104
    79
             !!x y. [| x:A; y:B(x) |] ==> c(x,y): C(<x,y>) 
lcp@104
    80
          |] ==> split(p, %x y.c(x,y)) : C(p)
lcp@104
    81
lcp@104
    82
\idx{SumEL}     [| p=q : SUM x:A.B(x); 
lcp@104
    83
             !!x y. [| x:A; y:B(x) |] ==> c(x,y)=d(x,y): C(<x,y>)
lcp@104
    84
          |] ==> split(p, %x y.c(x,y)) = split(q, % x y.d(x,y)) : C(p)
lcp@104
    85
lcp@104
    86
\idx{SumC}      [| a: A;  b: B(a);
lcp@104
    87
             !!x y. [| x:A; y:B(x) |] ==> c(x,y): C(<x,y>)
lcp@104
    88
          |] ==> split(<a,b>, %x y.c(x,y)) = c(a,b) : C(<a,b>)
lcp@104
    89
lcp@104
    90
\idx{fst_def}   fst(a) == split(a, %x y.x)
lcp@104
    91
\idx{snd_def}   snd(a) == split(a, %x y.y)
lcp@104
    92
lcp@104
    93
lcp@104
    94
\idx{PlusF}     [| A type;  B type |] ==> A+B type
lcp@104
    95
\idx{PlusFL}    [| A = C;  B = D |] ==> A+B = C+D
lcp@104
    96
lcp@104
    97
\idx{PlusI_inl}   [| a : A;  B type |] ==> inl(a) : A+B
lcp@104
    98
\idx{PlusI_inlL}  [| a = c : A;  B type |] ==> inl(a) = inl(c) : A+B
lcp@104
    99
lcp@104
   100
\idx{PlusI_inr}   [| A type;  b : B |] ==> inr(b) : A+B
lcp@104
   101
\idx{PlusI_inrL}  [| A type;  b = d : B |] ==> inr(b) = inr(d) : A+B
lcp@104
   102
lcp@104
   103
\idx{PlusE}     [| p: A+B;
lcp@104
   104
             !!x. x:A ==> c(x): C(inl(x));  
lcp@104
   105
             !!y. y:B ==> d(y): C(inr(y))
lcp@104
   106
          |] ==> when(p, %x.c(x), %y.d(y)) : C(p)
lcp@104
   107
lcp@104
   108
\idx{PlusEL}    [| p = q : A+B;
lcp@104
   109
             !!x. x: A ==> c(x) = e(x) : C(inl(x));   
lcp@104
   110
             !!y. y: B ==> d(y) = f(y) : C(inr(y))
lcp@104
   111
          |] ==> when(p, %x.c(x), %y.d(y)) = when(q, %x.e(x), %y.f(y)) : C(p)
lcp@104
   112
lcp@104
   113
\idx{PlusC_inl} [| a: A;
lcp@104
   114
             !!x. x:A ==> c(x): C(inl(x));  
lcp@104
   115
             !!y. y:B ==> d(y): C(inr(y))
lcp@104
   116
          |] ==> when(inl(a), %x.c(x), %y.d(y)) = c(a) : C(inl(a))
lcp@104
   117
lcp@104
   118
\idx{PlusC_inr} [| b: B;
lcp@104
   119
             !!x. x:A ==> c(x): C(inl(x));  
lcp@104
   120
             !!y. y:B ==> d(y): C(inr(y))
lcp@104
   121
          |] ==> when(inr(b), %x.c(x), %y.d(y)) = d(b) : C(inr(b))
lcp@104
   122
lcp@104
   123
\idx{EqF}       [| A type;  a : A;  b : A |] ==> Eq(A,a,b) type
lcp@104
   124
\idx{EqFL}      [| A=B;  a=c: A;  b=d : A |] ==> Eq(A,a,b) = Eq(B,c,d)
lcp@104
   125
\idx{EqI}       a = b : A ==> eq : Eq(A,a,b)
lcp@104
   126
\idx{EqE}       p : Eq(A,a,b) ==> a = b : A
lcp@104
   127
\idx{EqC}       p : Eq(A,a,b) ==> p = eq : Eq(A,a,b)
lcp@104
   128
lcp@104
   129
\idx{FF}        F type
lcp@104
   130
\idx{FE}        [| p: F;  C type |] ==> contr(p) : C
lcp@104
   131
\idx{FEL}       [| p = q : F;  C type |] ==> contr(p) = contr(q) : C
lcp@104
   132
lcp@104
   133
\idx{TF}        T type
lcp@104
   134
\idx{TI}        tt : T
lcp@104
   135
\idx{TE}        [| p : T;  c : C(tt) |] ==> c : C(p)
lcp@104
   136
\idx{TEL}       [| p = q : T;  c = d : C(tt) |] ==> c = d : C(p)
lcp@104
   137
\idx{TC}        p : T ==> p = tt : T)
lcp@104
   138
lcp@104
   139
lcp@104
   140
\idx{replace_type}      [| B = A;  a : A |] ==> a : B
lcp@104
   141
\idx{subst_eqtyparg}    [| a=c : A;  !!z. z:A ==> B(z) type |] ==> B(a)=B(c)
lcp@104
   142
lcp@104
   143
\idx{subst_prodE}       [| p: Prod(A,B);  a: A;  !!z. z: B(a) ==> c(z): C(z)
lcp@104
   144
                  |] ==> c(p`a): C(p`a)
lcp@104
   145
lcp@104
   146
\idx{SumIL2}    [| c=a : A;  d=b : B(a) |] ==> <c,d> = <a,b> : Sum(A,B)
lcp@104
   147
lcp@104
   148
\idx{SumE_fst}  p : Sum(A,B) ==> fst(p) : A
lcp@104
   149
lcp@104
   150
\idx{SumE_snd}  [| p: Sum(A,B);  A type;  !!x. x:A ==> B(x) type
lcp@104
   151
          |] ==> snd(p) : B(fst(p))
lcp@104
   152
lcp@104
   153
lcp@104
   154
lcp@104
   155
\idx{add_def}		a#+b == rec(a, b, %u v.succ(v))  
lcp@104
   156
\idx{diff_def}		a-b == rec(b, a, %u v.rec(v, 0, %x y.x))  
lcp@104
   157
\idx{absdiff_def}	a|-|b == (a-b) #+ (b-a)  
lcp@104
   158
\idx{mult_def}		a#*b == rec(a, 0, %u v. b #+ v)  
lcp@104
   159
lcp@104
   160
\idx{mod_def}	a//b == rec(a, 0, %u v.   
lcp@104
   161
  			rec(succ(v) |-| b, 0, %x y.succ(v)))  
lcp@104
   162
lcp@104
   163
\idx{quo_def}	a/b == rec(a, 0, %u v.   
lcp@104
   164
  			rec(succ(u) // b, succ(v), %x y.v))
lcp@104
   165
lcp@104
   166
lcp@104
   167
\idx{add_typing}        [| a:N;  b:N |] ==> a #+ b : N
lcp@104
   168
\idx{add_typingL}       [| a=c:N;  b=d:N |] ==> a #+ b = c #+ d : N
lcp@104
   169
\idx{addC0}             b:N ==> 0 #+ b = b : N
lcp@104
   170
\idx{addC_succ}         [| a:N;  b:N |] ==> succ(a) #+ b = succ(a #+ b) : N
lcp@104
   171
\idx{mult_typing}       [| a:N;  b:N |] ==> a #* b : N
lcp@104
   172
\idx{mult_typingL}      [| a=c:N;  b=d:N |] ==> a #* b = c #* d : N
lcp@104
   173
\idx{multC0}            b:N ==> 0 #* b = 0 : N
lcp@104
   174
\idx{multC_succ}        [| a:N;  b:N |] ==> succ(a) #* b = b #+ (a #* b) : N
lcp@104
   175
\idx{diff_typing}       [| a:N;  b:N |] ==> a - b : N
lcp@104
   176
\idx{diff_typingL}      [| a=c:N;  b=d:N |] ==> a - b = c - d : N
lcp@104
   177
\idx{diffC0}            a:N ==> a - 0 = a : N
lcp@104
   178
\idx{diff_0_eq_0}       b:N ==> 0 - b = 0 : N
lcp@104
   179
lcp@104
   180
\idx{diff_succ_succ}    [| a:N;  b:N |] ==> succ(a) - succ(b) = a - b : N
lcp@104
   181
lcp@104
   182
\idx{add_assoc} [| a:N;  b:N;  c:N |] ==> (a #+ b) #+ c = a #+ (b #+ c) : N
lcp@104
   183
lcp@104
   184
\idx{add_commute}       [| a:N;  b:N |] ==> a #+ b = b #+ a : N
lcp@104
   185
lcp@104
   186
\idx{mult_right0}       a:N ==> a #* 0 = 0 : N
lcp@104
   187
lcp@104
   188
\idx{mult_right_succ}   [| a:N;  b:N |] ==> a #* succ(b) = a #+ (a #* b) : N
lcp@104
   189
lcp@104
   190
\idx{mult_commute}      [| a:N;  b:N |] ==> a #* b = b #* a : N
lcp@104
   191
lcp@104
   192
\idx{add_mult_dist}     [| a:N;  b:N;  c:N |] ==> (a #+ b) #* c = (a #* c) #+ (b #* c) : N
lcp@104
   193
lcp@104
   194
\idx{mult_assoc}        [| a:N;  b:N;  c:N |] ==> (a #* b) #* c = a #* (b #* c) : N
lcp@104
   195
lcp@104
   196
\idx{diff_self_eq_0}    a:N ==> a - a = 0 : N
lcp@104
   197
lcp@104
   198
\idx{add_inverse_diff_lemma}    
lcp@104
   199
    b:N ==> ?a : PROD x:N. Eq(N, b-x, 0) --> Eq(N, b #+ (x-b), x)
lcp@104
   200
lcp@104
   201
\idx{add_inverse_diff}  [| a:N;  b:N;  b-a = 0 : N |] ==> b #+ (a-b) = a : N
lcp@104
   202
lcp@104
   203
\idx{absdiff_typing}    [| a:N;  b:N |] ==> a |-| b : N
lcp@104
   204
\idx{absdiff_typingL}   [| a=c:N;  b=d:N |] ==> a |-| b = c |-| d : N
lcp@104
   205
\idx{absdiff_self_eq_0} a:N ==> a |-| a = 0 : N
lcp@104
   206
\idx{absdiffC0}         a:N ==> 0 |-| a = a : N
lcp@104
   207
lcp@104
   208
\idx{absdiff_succ_succ} [| a:N;  b:N |] ==> succ(a) |-| succ(b)  =  a |-| b : N
lcp@104
   209
\idx{absdiff_commute}   [| a:N;  b:N |] ==> a |-| b = b |-| a : N
lcp@104
   210
lcp@104
   211
\idx{add_eq0_lemma}     [| a:N;  b:N |] ==> ?c : PROD u: Eq(N,a#+b,0) .  Eq(N,a,0)
lcp@104
   212
lcp@104
   213
\idx{add_eq0}   [| a:N;  b:N;  a #+ b = 0 : N |] ==> a = 0 : N
lcp@104
   214
lcp@104
   215
\idx{absdiff_eq0_lem}   
lcp@104
   216
    [| a:N;  b:N;  a |-| b = 0 : N |] ==> 
lcp@104
   217
    ?a : SUM v: Eq(N, a-b, 0) . Eq(N, b-a, 0)
lcp@104
   218
lcp@104
   219
\idx{absdiff_eq0}       [| a |-| b = 0 : N;  a:N;  b:N |] ==> a = b : N
lcp@104
   220
lcp@104
   221
\idx{mod_typing}        [| a:N;  b:N |] ==> a//b : N
lcp@104
   222
\idx{mod_typingL}       [| a=c:N;  b=d:N |] ==> a//b = c//d : N
lcp@104
   223
\idx{modC0}             b:N ==> 0//b = 0 : N
lcp@104
   224
\idx{modC_succ} 
lcp@104
   225
[| a:N; b:N |] ==> succ(a)//b = rec(succ(a//b) |-| b, 0, %x y.succ(a//b)) : N
lcp@104
   226
lcp@104
   227
\idx{quo_typing}        [| a:N;  b:N |] ==> a / b : N
lcp@104
   228
\idx{quo_typingL}       [| a=c:N;  b=d:N |] ==> a / b = c / d : N
lcp@104
   229
\idx{quoC0}             b:N ==> 0 / b = 0 : N
lcp@104
   230
[| a:N;  b:N |] ==> succ(a) / b = 
lcp@104
   231
    rec(succ(a)//b, succ(a / b), %x y. a / b) : N
lcp@104
   232
\idx{quoC_succ2}        [| a:N;  b:N |] ==> 
lcp@104
   233
    succ(a) / b =rec(succ(a//b) |-| b, succ(a / b), %x y. a / b) : N
lcp@104
   234
lcp@104
   235
\idx{iszero_decidable}  
lcp@104
   236
    a:N ==> rec(a, inl(eq), %ka kb.inr(<ka, eq>)) : 
lcp@104
   237
                      Eq(N,a,0) + (SUM x:N. Eq(N,a, succ(x)))
lcp@104
   238
lcp@104
   239
\idx{mod_quo_equality}  [| a:N;  b:N |] ==> a//b  #+  (a/b) #* b = a : N
lcp@104
   240
lcp@104
   241