src/Cube/Example.thy
author wenzelm
Fri, 21 Sep 2007 22:51:08 +0200
changeset 24669 4579eac2c997
parent 19943 26b37721b357
child 30510 4120fc59dd85
permissions -rw-r--r--
proper signature constraint; minor tuning;
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 = {*
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    18
  Method.thms_args (fn thms => Method.METHOD (fn facts =>
19943
26b37721b357 Removed debugging code.
ballarin
parents: 19931
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 = {*
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    23
  Method.thms_args (fn thms => Method.METHOD (fn facts =>
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    24
  (DEPTH_SOLVE_1 (HEADGOAL (ares_tac (facts @ thms))))))
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 =  {*
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    28
  let val strip_b = thm "strip_b" and strip_s = thm "strip_s" in
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    29
    Method.thms_args (fn thms => Method.METHOD (fn facts =>
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    30
      REPEAT (resolve_tac [strip_b, strip_s] 1 THEN DEPTH_SOLVE_1 (ares_tac (facts @ thms) 1))))
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    31
  end
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
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    35
subsection {* Simple types *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    36
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    37
lemma "A:* |- A->A : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    38
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    39
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    40
lemma "A:* |- Lam a:A. a : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    41
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    42
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    43
lemma "A:* B:* b:B |- Lam x:A. b : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    44
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    45
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    46
lemma "A:* b:A |- (Lam a:A. a)^b: ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    47
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    48
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    49
lemma "A:* B:* c:A b:B |- (Lam x:A. b)^ c: ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    50
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    51
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    52
lemma "A:* B:* |- Lam a:A. Lam b:B. a : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    53
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    54
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    55
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    56
subsection {* Second-order types *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    57
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    58
lemma (in L2) "|- Lam A:*. Lam a:A. a : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    59
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    60
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    61
lemma (in L2) "A:* |- (Lam B:*.Lam b:B. b)^A : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    62
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    63
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    64
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
    65
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    66
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    67
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
    68
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    69
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    70
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    71
subsection {* Weakly higher-order propositional logic *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    72
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    73
lemma (in Lomega) "|- Lam A:*.A->A : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    74
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    75
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    76
lemma (in Lomega) "B:* |- (Lam A:*.A->A) ^ B : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    77
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    78
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    79
lemma (in Lomega) "B:* b:B |- (Lam y:B. b): ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    80
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    81
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    82
lemma (in Lomega) "A:* F:*->* |- F^(F^A): ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    83
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    84
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    85
lemma (in Lomega) "A:* |- Lam F:*->*.F^(F^A): ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    86
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    87
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    88
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    89
subsection {* LP *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    90
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    91
lemma (in LP) "A:* |- A -> * : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    92
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    93
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    94
lemma (in LP) "A:* P:A->* a:A |- P^a: ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    95
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    96
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    97
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
    98
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    99
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   100
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
   101
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   102
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   103
lemma (in LP) "A:* P:A->* |- Pi a:A. P^a -> P^a: ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   104
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   105
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   106
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
   107
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   108
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   109
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
   110
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   111
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   112
lemma (in LP) "A:* P:A->* Q:* a0:A |-
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   113
        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
   114
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   115
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   116
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   117
subsection {* Omega-order types *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   118
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   119
lemma (in L2) "A:* B:* |- Pi C:*.(A->B->C)->C : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   120
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   121
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   122
lemma (in Lomega2) "|- Lam A:*.Lam B:*.Pi C:*.(A->B->C)->C : ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   123
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   124
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   125
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
   126
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   127
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   128
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
   129
  apply (strip_asms rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   130
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   131
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   132
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   133
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   134
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   135
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   136
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   137
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   138
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   139
    apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   140
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   141
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   142
  apply (erule pi_elim)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   143
   apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   144
  apply (erule pi_elim)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   145
   apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   146
  apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   147
  done
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   148
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   149
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   150
subsection {* Second-order Predicate Logic *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   151
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   152
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
   153
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   154
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   155
lemma (in LP2) "A:* P:A->A->* |-
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   156
    (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
   157
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   158
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   159
lemma (in LP2) "A:* P:A->A->* |-
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   160
    ?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
   161
  -- {* Antisymmetry implies irreflexivity: *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   162
  apply (strip_asms rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   163
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   164
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   165
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   166
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   167
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   168
    apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   169
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   170
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   171
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   172
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   173
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   174
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   175
  apply (erule pi_elim, assumption, assumption?)+
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   176
  done
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   177
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   178
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   179
subsection {* LPomega *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   180
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   181
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
   182
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   183
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   184
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
   185
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   186
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   187
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   188
subsection {* Constructions *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   189
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   190
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
   191
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   192
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   193
lemma (in CC) "|- Lam A:*.Lam P:A->*.Pi a:A. P^a: ?T"
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   194
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   195
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   196
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
   197
  apply (strip_asms rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   198
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   199
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   200
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   201
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   202
  apply (erule pi_elim, assumption, assumption)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   203
  done
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   204
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   205
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   206
subsection {* Some random examples *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   207
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   208
lemma (in LP2) "A:* c:A f:A->A |-
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   209
    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
   210
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   211
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   212
lemma (in CC) "Lam A:*.Lam c:A. Lam f:A->A.
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   213
    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
   214
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   215
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   216
lemma (in LP2)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   217
  "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
   218
  -- {* Symmetry of Leibnitz equality *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   219
  apply (strip_asms rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   220
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   221
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   222
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   223
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   224
  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
   225
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   226
  apply (unfold beta)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   227
  apply (erule imp_elim)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   228
   apply (rule lam_bs)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   229
     apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   230
    prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   231
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   232
   apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   233
     apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   234
    prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   235
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   236
   apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   237
  apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   238
  done
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   239
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   240
end