src/Cube/Example.thy
author blanchet
Mon, 18 Jun 2012 17:50:06 +0200
changeset 48104 d2173ff80c57
parent 45242 401f91ed8a93
child 58617 4f169d2cf6f3
permissions -rw-r--r--
less confusing error message
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
     1
header {* Lambda Cube Examples *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
     2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
     3
theory Example
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
     4
imports Cube
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
     5
begin
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
     6
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
     7
text {*
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
     8
  Examples taken from:
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
     9
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    10
  H. Barendregt. Introduction to Generalised Type Systems.
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    11
  J. Functional Programming.
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    12
*}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    13
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    14
method_setup depth_solve = {*
30549
d2d7874648bd simplified method setup;
wenzelm
parents: 30510
diff changeset
    15
  Attrib.thms >> (fn thms => K (METHOD (fn facts =>
42814
5af15f1e2ef6 simplified/unified method_setup/attribute_setup;
wenzelm
parents: 36319
diff changeset
    16
    (DEPTH_SOLVE (HEADGOAL (ares_tac (facts @ thms)))))))
5af15f1e2ef6 simplified/unified method_setup/attribute_setup;
wenzelm
parents: 36319
diff changeset
    17
*}
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    18
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    19
method_setup depth_solve1 = {*
30549
d2d7874648bd simplified method setup;
wenzelm
parents: 30510
diff changeset
    20
  Attrib.thms >> (fn thms => K (METHOD (fn facts =>
42814
5af15f1e2ef6 simplified/unified method_setup/attribute_setup;
wenzelm
parents: 36319
diff changeset
    21
    (DEPTH_SOLVE_1 (HEADGOAL (ares_tac (facts @ thms)))))))
5af15f1e2ef6 simplified/unified method_setup/attribute_setup;
wenzelm
parents: 36319
diff changeset
    22
*}
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    23
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    24
method_setup strip_asms =  {*
30549
d2d7874648bd simplified method setup;
wenzelm
parents: 30510
diff changeset
    25
  Attrib.thms >> (fn thms => K (METHOD (fn facts =>
d2d7874648bd simplified method setup;
wenzelm
parents: 30510
diff changeset
    26
    REPEAT (resolve_tac [@{thm strip_b}, @{thm strip_s}] 1 THEN
d2d7874648bd simplified method setup;
wenzelm
parents: 30510
diff changeset
    27
    DEPTH_SOLVE_1 (ares_tac (facts @ thms) 1)))))
42814
5af15f1e2ef6 simplified/unified method_setup/attribute_setup;
wenzelm
parents: 36319
diff changeset
    28
*}
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    29
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    30
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    31
subsection {* Simple types *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    32
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
    33
schematic_lemma "A:* \<turnstile> A\<rightarrow>A : ?T"
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    34
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    35
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
    36
schematic_lemma "A:* \<turnstile> \<Lambda> a:A. a : ?T"
17453
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
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
    39
schematic_lemma "A:* B:* b:B \<turnstile> \<Lambda> x:A. b : ?T"
17453
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
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
    42
schematic_lemma "A:* b:A \<turnstile> (\<Lambda> a:A. a)^b: ?T"
17453
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
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
    45
schematic_lemma "A:* B:* c:A b:B \<turnstile> (\<Lambda> x:A. b)^ c: ?T"
17453
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
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
    48
schematic_lemma "A:* B:* \<turnstile> \<Lambda> a:A. \<Lambda> b:B. a : ?T"
17453
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
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    52
subsection {* Second-order types *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    53
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
    54
schematic_lemma (in L2) "\<turnstile> \<Lambda> A:*. \<Lambda> a:A. a : ?T"
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    55
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    56
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
    57
schematic_lemma (in L2) "A:* \<turnstile> (\<Lambda> B:*.\<Lambda> b:B. b)^A : ?T"
17453
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
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
    60
schematic_lemma (in L2) "A:* b:A \<turnstile> (\<Lambda> B:*.\<Lambda> b:B. b) ^ A ^ b: ?T"
17453
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
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
    63
schematic_lemma (in L2) "\<turnstile> \<Lambda> B:*.\<Lambda> a:(\<Pi> A:*.A).a ^ ((\<Pi> A:*.A)\<rightarrow>B) ^ a: ?T"
17453
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
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    67
subsection {* Weakly higher-order propositional logic *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    68
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
    69
schematic_lemma (in Lomega) "\<turnstile> \<Lambda> A:*.A\<rightarrow>A : ?T"
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    70
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    71
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
    72
schematic_lemma (in Lomega) "B:* \<turnstile> (\<Lambda> A:*.A\<rightarrow>A) ^ B : ?T"
17453
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
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
    75
schematic_lemma (in Lomega) "B:* b:B \<turnstile> (\<Lambda> y:B. b): ?T"
17453
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
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
    78
schematic_lemma (in Lomega) "A:* F:*\<rightarrow>* \<turnstile> F^(F^A): ?T"
17453
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
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
    81
schematic_lemma (in Lomega) "A:* \<turnstile> \<Lambda> F:*\<rightarrow>*.F^(F^A): ?T"
17453
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
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    85
subsection {* LP *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    86
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
    87
schematic_lemma (in LP) "A:* \<turnstile> A \<rightarrow> * : ?T"
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    88
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    89
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
    90
schematic_lemma (in LP) "A:* P:A\<rightarrow>* a:A \<turnstile> P^a: ?T"
17453
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
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
    93
schematic_lemma (in LP) "A:* P:A\<rightarrow>A\<rightarrow>* a:A \<turnstile> \<Pi> a:A. P^a^a: ?T"
17453
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
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
    96
schematic_lemma (in LP) "A:* P:A\<rightarrow>* Q:A\<rightarrow>* \<turnstile> \<Pi> a:A. P^a \<rightarrow> Q^a: ?T"
17453
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
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
    99
schematic_lemma (in LP) "A:* P:A\<rightarrow>* \<turnstile> \<Pi> a:A. P^a \<rightarrow> P^a: ?T"
17453
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
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   102
schematic_lemma (in LP) "A:* P:A\<rightarrow>* \<turnstile> \<Lambda> a:A. \<Lambda> x:P^a. x: ?T"
17453
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
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   105
schematic_lemma (in LP) "A:* P:A\<rightarrow>* Q:* \<turnstile> (\<Pi> a:A. P^a\<rightarrow>Q) \<rightarrow> (\<Pi> a:A. P^a) \<rightarrow> Q : ?T"
17453
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
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   108
schematic_lemma (in LP) "A:* P:A\<rightarrow>* Q:* a0:A \<turnstile>
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   109
        \<Lambda> x:\<Pi> a:A. P^a\<rightarrow>Q. \<Lambda> y:\<Pi> a:A. P^a. x^a0^(y^a0): ?T"
17453
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
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   113
subsection {* Omega-order types *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   114
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   115
schematic_lemma (in L2) "A:* B:* \<turnstile> \<Pi> C:*.(A\<rightarrow>B\<rightarrow>C)\<rightarrow>C : ?T"
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   116
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   117
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   118
schematic_lemma (in Lomega2) "\<turnstile> \<Lambda> A:*.\<Lambda> B:*.\<Pi> C:*.(A\<rightarrow>B\<rightarrow>C)\<rightarrow>C : ?T"
17453
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
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   121
schematic_lemma (in Lomega2) "\<turnstile> \<Lambda> A:*.\<Lambda> B:*.\<Lambda> x:A. \<Lambda> y:B. x : ?T"
17453
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
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   124
schematic_lemma (in Lomega2) "A:* B:* \<turnstile> ?p : (A\<rightarrow>B) \<rightarrow> ((B\<rightarrow>\<Pi> P:*.P)\<rightarrow>(A\<rightarrow>\<Pi> P:*.P))"
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   125
  apply (strip_asms rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   126
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   127
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   128
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   129
   apply (depth_solve1 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 assumption
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 (erule pi_elim)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   139
   apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   140
  apply (erule pi_elim)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   141
   apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   142
  apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   143
  done
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   144
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   145
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   146
subsection {* Second-order Predicate Logic *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   147
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   148
schematic_lemma (in LP2) "A:* P:A\<rightarrow>* \<turnstile> \<Lambda> a:A. P^a\<rightarrow>(\<Pi> A:*.A) : ?T"
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   149
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   150
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   151
schematic_lemma (in LP2) "A:* P:A\<rightarrow>A\<rightarrow>* \<turnstile>
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   152
    (\<Pi> a:A. \<Pi> b:A. P^a^b\<rightarrow>P^b^a\<rightarrow>\<Pi> P:*.P) \<rightarrow> \<Pi> a:A. P^a^a\<rightarrow>\<Pi> P:*.P : ?T"
17453
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
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   155
schematic_lemma (in LP2) "A:* P:A\<rightarrow>A\<rightarrow>* \<turnstile>
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   156
    ?p: (\<Pi> a:A. \<Pi> b:A. P^a^b\<rightarrow>P^b^a\<rightarrow>\<Pi> P:*.P) \<rightarrow> \<Pi> a:A. P^a^a\<rightarrow>\<Pi> P:*.P"
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   157
  -- {* Antisymmetry implies irreflexivity: *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   158
  apply (strip_asms rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   159
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   160
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   161
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   162
   apply (depth_solve1 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 assumption
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 (depth_solve1 rules)
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 (erule pi_elim, assumption, assumption?)+
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   172
  done
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   173
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   174
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   175
subsection {* LPomega *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   176
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   177
schematic_lemma (in LPomega) "A:* \<turnstile> \<Lambda> P:A\<rightarrow>A\<rightarrow>*.\<Lambda> a:A. P^a^a : ?T"
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   178
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   179
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   180
schematic_lemma (in LPomega) "\<turnstile> \<Lambda> A:*.\<Lambda> P:A\<rightarrow>A\<rightarrow>*.\<Lambda> a:A. P^a^a : ?T"
17453
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
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   184
subsection {* Constructions *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   185
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   186
schematic_lemma (in CC) "\<turnstile> \<Lambda> A:*.\<Lambda> P:A\<rightarrow>*.\<Lambda> a:A. P^a\<rightarrow>\<Pi> P:*.P: ?T"
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   187
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   188
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   189
schematic_lemma (in CC) "\<turnstile> \<Lambda> A:*.\<Lambda> P:A\<rightarrow>*.\<Pi> a:A. P^a: ?T"
17453
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
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   192
schematic_lemma (in CC) "A:* P:A\<rightarrow>* a:A \<turnstile> ?p : (\<Pi> a:A. P^a)\<rightarrow>P^a"
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   193
  apply (strip_asms rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   194
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   195
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   196
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   197
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   198
  apply (erule pi_elim, assumption, assumption)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   199
  done
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   200
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   201
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   202
subsection {* Some random examples *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   203
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   204
schematic_lemma (in LP2) "A:* c:A f:A\<rightarrow>A \<turnstile>
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   205
    \<Lambda> a:A. \<Pi> P:A\<rightarrow>*.P^c \<rightarrow> (\<Pi> x:A. P^x\<rightarrow>P^(f^x)) \<rightarrow> P^a : ?T"
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   206
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   207
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   208
schematic_lemma (in CC) "\<Lambda> A:*.\<Lambda> c:A. \<Lambda> f:A\<rightarrow>A.
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   209
    \<Lambda> a:A. \<Pi> P:A\<rightarrow>*.P^c \<rightarrow> (\<Pi> x:A. P^x\<rightarrow>P^(f^x)) \<rightarrow> P^a : ?T"
17453
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
36319
8feb2c4bef1a mark schematic statements explicitly;
wenzelm
parents: 35762
diff changeset
   212
schematic_lemma (in LP2)
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   213
  "A:* a:A b:A \<turnstile> ?p: (\<Pi> P:A\<rightarrow>*.P^a\<rightarrow>P^b) \<rightarrow> (\<Pi> P:A\<rightarrow>*.P^b\<rightarrow>P^a)"
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   214
  -- {* Symmetry of Leibnitz equality *}
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   215
  apply (strip_asms rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   216
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   217
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   218
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   219
   apply (depth_solve1 rules)
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   220
  apply (erule_tac a = "\<Lambda> x:A. \<Pi> Q:A\<rightarrow>*.Q^x\<rightarrow>Q^a" in pi_elim)
17453
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
  apply (unfold beta)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   223
  apply (erule imp_elim)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   224
   apply (rule lam_bs)
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
    prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   227
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   228
   apply (rule lam_ss)
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 assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   233
  apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   234
  done
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   235
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   236
end