src/Cube/Example.thy
author wenzelm
Mon, 16 Mar 2009 18:24:30 +0100
changeset 30549 d2d7874648bd
parent 30510 4120fc59dd85
child 35762 af3ff2ba4c54
permissions -rw-r--r--
simplified method setup;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
     1
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
     2
(* $Id$ *)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
     3
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
     4
header {* Lambda Cube Examples *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
     5
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
     6
theory Example
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
     7
imports Cube
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
     8
begin
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
     9
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    10
text {*
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    11
  Examples taken from:
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    12
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    13
  H. Barendregt. Introduction to Generalised Type Systems.
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    14
  J. Functional Programming.
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    15
*}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    16
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    17
method_setup depth_solve = {*
30549
d2d7874648bd simplified method setup;
wenzelm
parents: 30510
diff changeset
    18
  Attrib.thms >> (fn thms => K (METHOD (fn facts =>
d2d7874648bd simplified method setup;
wenzelm
parents: 30510
diff changeset
    19
  (DEPTH_SOLVE (HEADGOAL (ares_tac (facts @ thms)))))))
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    20
*} ""
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    21
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    22
method_setup depth_solve1 = {*
30549
d2d7874648bd simplified method setup;
wenzelm
parents: 30510
diff changeset
    23
  Attrib.thms >> (fn thms => K (METHOD (fn facts =>
d2d7874648bd simplified method setup;
wenzelm
parents: 30510
diff changeset
    24
  (DEPTH_SOLVE_1 (HEADGOAL (ares_tac (facts @ thms)))))))
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    25
*} ""
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    26
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    27
method_setup strip_asms =  {*
30549
d2d7874648bd simplified method setup;
wenzelm
parents: 30510
diff changeset
    28
  Attrib.thms >> (fn thms => K (METHOD (fn facts =>
d2d7874648bd simplified method setup;
wenzelm
parents: 30510
diff changeset
    29
    REPEAT (resolve_tac [@{thm strip_b}, @{thm strip_s}] 1 THEN
d2d7874648bd simplified method setup;
wenzelm
parents: 30510
diff changeset
    30
    DEPTH_SOLVE_1 (ares_tac (facts @ thms) 1)))))
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    31
*} ""
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    32
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    33
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    34
subsection {* Simple types *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    35
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    36
lemma "A:* |- A->A : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    37
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    38
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    39
lemma "A:* |- Lam a:A. a : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    40
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    41
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    42
lemma "A:* B:* b:B |- Lam x:A. b : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    43
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    44
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    45
lemma "A:* b:A |- (Lam a:A. a)^b: ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    46
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    47
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    48
lemma "A:* B:* c:A b:B |- (Lam x:A. b)^ c: ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    49
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    50
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    51
lemma "A:* B:* |- Lam a:A. Lam b:B. a : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    52
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    53
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    54
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    55
subsection {* Second-order types *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    56
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    57
lemma (in L2) "|- Lam A:*. Lam a:A. a : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    58
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    59
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    60
lemma (in L2) "A:* |- (Lam B:*.Lam b:B. b)^A : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    61
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    62
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    63
lemma (in L2) "A:* b:A |- (Lam B:*.Lam b:B. b) ^ A ^ b: ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    64
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    65
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    66
lemma (in L2) "|- Lam B:*.Lam a:(Pi A:*.A).a ^ ((Pi A:*.A)->B) ^ a: ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    67
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    68
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    69
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    70
subsection {* Weakly higher-order propositional logic *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    71
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    72
lemma (in Lomega) "|- Lam A:*.A->A : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    73
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    74
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    75
lemma (in Lomega) "B:* |- (Lam A:*.A->A) ^ B : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    76
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    77
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    78
lemma (in Lomega) "B:* b:B |- (Lam y:B. b): ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    79
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    80
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    81
lemma (in Lomega) "A:* F:*->* |- F^(F^A): ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    82
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    83
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    84
lemma (in Lomega) "A:* |- Lam F:*->*.F^(F^A): ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    85
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    86
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    87
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    88
subsection {* LP *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    89
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    90
lemma (in LP) "A:* |- A -> * : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    91
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    92
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    93
lemma (in LP) "A:* P:A->* a:A |- P^a: ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    94
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    95
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    96
lemma (in LP) "A:* P:A->A->* a:A |- Pi a:A. P^a^a: ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    97
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    98
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    99
lemma (in LP) "A:* P:A->* Q:A->* |- Pi a:A. P^a -> Q^a: ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   100
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   101
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   102
lemma (in LP) "A:* P:A->* |- Pi a:A. P^a -> P^a: ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   103
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   104
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   105
lemma (in LP) "A:* P:A->* |- Lam a:A. Lam x:P^a. x: ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   106
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   107
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   108
lemma (in LP) "A:* P:A->* Q:* |- (Pi a:A. P^a->Q) -> (Pi a:A. P^a) -> Q : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   109
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   110
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   111
lemma (in LP) "A:* P:A->* Q:* a0:A |-
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   112
        Lam x:Pi a:A. P^a->Q. Lam y:Pi a:A. P^a. x^a0^(y^a0): ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   113
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   114
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   115
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   116
subsection {* Omega-order types *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   117
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   118
lemma (in L2) "A:* B:* |- Pi C:*.(A->B->C)->C : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   119
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   120
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   121
lemma (in Lomega2) "|- Lam A:*.Lam B:*.Pi C:*.(A->B->C)->C : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   122
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   123
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   124
lemma (in Lomega2) "|- Lam A:*.Lam B:*.Lam x:A. Lam y:B. x : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   125
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   126
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   127
lemma (in Lomega2) "A:* B:* |- ?p : (A->B) -> ((B->Pi P:*.P)->(A->Pi P:*.P))"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   128
  apply (strip_asms rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   129
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   130
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   131
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   132
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   133
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   134
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   135
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   136
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   137
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   138
    apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   139
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   140
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   141
  apply (erule pi_elim)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   142
   apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   143
  apply (erule pi_elim)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   144
   apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   145
  apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   146
  done
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   147
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   148
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   149
subsection {* Second-order Predicate Logic *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   150
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   151
lemma (in LP2) "A:* P:A->* |- Lam a:A. P^a->(Pi A:*.A) : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   152
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   153
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   154
lemma (in LP2) "A:* P:A->A->* |-
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   155
    (Pi a:A. Pi b:A. P^a^b->P^b^a->Pi P:*.P) -> Pi a:A. P^a^a->Pi P:*.P : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   156
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   157
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   158
lemma (in LP2) "A:* P:A->A->* |-
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   159
    ?p: (Pi a:A. Pi b:A. P^a^b->P^b^a->Pi P:*.P) -> Pi a:A. P^a^a->Pi P:*.P"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   160
  -- {* Antisymmetry implies irreflexivity: *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   161
  apply (strip_asms rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   162
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   163
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   164
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   165
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   166
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   167
    apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   168
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   169
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   170
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   171
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   172
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   173
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   174
  apply (erule pi_elim, assumption, assumption?)+
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   175
  done
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   176
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   177
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   178
subsection {* LPomega *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   179
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   180
lemma (in LPomega) "A:* |- Lam P:A->A->*.Lam a:A. P^a^a : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   181
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   182
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   183
lemma (in LPomega) "|- Lam A:*.Lam P:A->A->*.Lam a:A. P^a^a : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   184
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   185
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   186
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   187
subsection {* Constructions *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   188
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   189
lemma (in CC) "|- Lam A:*.Lam P:A->*.Lam a:A. P^a->Pi P:*.P: ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   190
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   191
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   192
lemma (in CC) "|- Lam A:*.Lam P:A->*.Pi a:A. P^a: ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   193
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   194
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   195
lemma (in CC) "A:* P:A->* a:A |- ?p : (Pi a:A. P^a)->P^a"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   196
  apply (strip_asms rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   197
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   198
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   199
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   200
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   201
  apply (erule pi_elim, assumption, assumption)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   202
  done
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   203
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   204
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   205
subsection {* Some random examples *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   206
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   207
lemma (in LP2) "A:* c:A f:A->A |-
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   208
    Lam a:A. Pi P:A->*.P^c -> (Pi x:A. P^x->P^(f^x)) -> P^a : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   209
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   210
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   211
lemma (in CC) "Lam A:*.Lam c:A. Lam f:A->A.
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   212
    Lam a:A. Pi P:A->*.P^c -> (Pi x:A. P^x->P^(f^x)) -> P^a : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   213
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   214
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   215
lemma (in LP2)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   216
  "A:* a:A b:A |- ?p: (Pi P:A->*.P^a->P^b) -> (Pi P:A->*.P^b->P^a)"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   217
  -- {* Symmetry of Leibnitz equality *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   218
  apply (strip_asms rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   219
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   220
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   221
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   222
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   223
  apply (erule_tac a = "Lam x:A. Pi Q:A->*.Q^x->Q^a" in pi_elim)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   224
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   225
  apply (unfold beta)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   226
  apply (erule imp_elim)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   227
   apply (rule lam_bs)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   228
     apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   229
    prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   230
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   231
   apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   232
     apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   233
    prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   234
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   235
   apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   236
  apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   237
  done
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   238
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   239
end