src/Cube/Example.thy
author wenzelm
Tue, 06 Oct 2015 15:14:28 +0200
changeset 61337 4645502c3c64
parent 59499 14095f771781
child 61388 92e97b800d1e
permissions -rw-r--r--
fewer aliases for toplevel theorem statements;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
58889
5b7a9633cfa8 modernized header uniformly as section;
wenzelm
parents: 58617
diff changeset
     1
section \<open>Lambda Cube Examples\<close>
17453
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
58617
4f169d2cf6f3 more cartouches;
wenzelm
parents: 45242
diff changeset
     7
text \<open>Examples taken from:
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
     8
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
     9
  H. Barendregt. Introduction to Generalised Type Systems.
58617
4f169d2cf6f3 more cartouches;
wenzelm
parents: 45242
diff changeset
    10
  J. Functional Programming.\<close>
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    11
58617
4f169d2cf6f3 more cartouches;
wenzelm
parents: 45242
diff changeset
    12
method_setup depth_solve =
59499
14095f771781 misc tuning;
wenzelm
parents: 59498
diff changeset
    13
  \<open>Attrib.thms >> (fn thms => fn ctxt => METHOD (fn facts =>
14095f771781 misc tuning;
wenzelm
parents: 59498
diff changeset
    14
    (DEPTH_SOLVE (HEADGOAL (assume_tac ctxt ORELSE' resolve_tac ctxt (facts @ thms))))))\<close>
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    15
58617
4f169d2cf6f3 more cartouches;
wenzelm
parents: 45242
diff changeset
    16
method_setup depth_solve1 =
59499
14095f771781 misc tuning;
wenzelm
parents: 59498
diff changeset
    17
  \<open>Attrib.thms >> (fn thms => fn ctxt => METHOD (fn facts =>
14095f771781 misc tuning;
wenzelm
parents: 59498
diff changeset
    18
    (DEPTH_SOLVE_1 (HEADGOAL (assume_tac ctxt ORELSE' resolve_tac ctxt (facts @ thms))))))\<close>
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    19
58617
4f169d2cf6f3 more cartouches;
wenzelm
parents: 45242
diff changeset
    20
method_setup strip_asms =
59498
50b60f501b05 proper context for resolve_tac, eresolve_tac, dresolve_tac, forward_tac etc.;
wenzelm
parents: 58889
diff changeset
    21
  \<open>Attrib.thms >> (fn thms => fn ctxt => METHOD (fn facts =>
50b60f501b05 proper context for resolve_tac, eresolve_tac, dresolve_tac, forward_tac etc.;
wenzelm
parents: 58889
diff changeset
    22
    REPEAT (resolve_tac ctxt [@{thm strip_b}, @{thm strip_s}] 1 THEN
59499
14095f771781 misc tuning;
wenzelm
parents: 59498
diff changeset
    23
    DEPTH_SOLVE_1 (assume_tac ctxt 1 ORELSE resolve_tac ctxt (facts @ thms) 1))))\<close>
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    24
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    25
58617
4f169d2cf6f3 more cartouches;
wenzelm
parents: 45242
diff changeset
    26
subsection \<open>Simple types\<close>
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    27
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
    28
schematic_goal "A:* \<turnstile> A\<rightarrow>A : ?T"
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    29
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    30
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
    31
schematic_goal "A:* \<turnstile> \<Lambda> a:A. a : ?T"
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    32
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    33
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
    34
schematic_goal "A:* B:* b:B \<turnstile> \<Lambda> x:A. b : ?T"
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    35
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    36
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
    37
schematic_goal "A:* b:A \<turnstile> (\<Lambda> a:A. a)^b: ?T"
17453
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
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
    40
schematic_goal "A:* B:* c:A b:B \<turnstile> (\<Lambda> x:A. b)^ c: ?T"
17453
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
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
    43
schematic_goal "A:* B:* \<turnstile> \<Lambda> a:A. \<Lambda> b:B. a : ?T"
17453
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
58617
4f169d2cf6f3 more cartouches;
wenzelm
parents: 45242
diff changeset
    47
subsection \<open>Second-order types\<close>
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    48
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
    49
schematic_goal (in L2) "\<turnstile> \<Lambda> A:*. \<Lambda> a:A. a : ?T"
17453
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
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
    52
schematic_goal (in L2) "A:* \<turnstile> (\<Lambda> B:*.\<Lambda> b:B. b)^A : ?T"
17453
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
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
    55
schematic_goal (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
    56
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    57
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
    58
schematic_goal (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
    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
58617
4f169d2cf6f3 more cartouches;
wenzelm
parents: 45242
diff changeset
    62
subsection \<open>Weakly higher-order propositional logic\<close>
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    63
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
    64
schematic_goal (in Lomega) "\<turnstile> \<Lambda> A:*.A\<rightarrow>A : ?T"
17453
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
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
    67
schematic_goal (in Lomega) "B:* \<turnstile> (\<Lambda> A:*.A\<rightarrow>A) ^ B : ?T"
17453
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
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
    70
schematic_goal (in Lomega) "B:* b:B \<turnstile> (\<Lambda> y:B. b): ?T"
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    71
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    72
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
    73
schematic_goal (in Lomega) "A:* F:*\<rightarrow>* \<turnstile> F^(F^A): ?T"
17453
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
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
    76
schematic_goal (in Lomega) "A:* \<turnstile> \<Lambda> F:*\<rightarrow>*.F^(F^A): ?T"
17453
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
58617
4f169d2cf6f3 more cartouches;
wenzelm
parents: 45242
diff changeset
    80
subsection \<open>LP\<close>
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    81
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
    82
schematic_goal (in LP) "A:* \<turnstile> A \<rightarrow> * : ?T"
17453
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
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
    85
schematic_goal (in LP) "A:* P:A\<rightarrow>* a:A \<turnstile> P^a: ?T"
17453
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
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
    88
schematic_goal (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
    89
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    90
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
    91
schematic_goal (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
    92
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    93
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
    94
schematic_goal (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
    95
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    96
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
    97
schematic_goal (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
    98
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
    99
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
   100
schematic_goal (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
   101
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   102
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
   103
schematic_goal (in LP) "A:* P:A\<rightarrow>* Q:* a0:A \<turnstile>
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   104
        \<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
   105
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   106
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   107
58617
4f169d2cf6f3 more cartouches;
wenzelm
parents: 45242
diff changeset
   108
subsection \<open>Omega-order types\<close>
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   109
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
   110
schematic_goal (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
   111
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   112
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
   113
schematic_goal (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
   114
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   115
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
   116
schematic_goal (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
   117
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   118
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
   119
schematic_goal (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
   120
  apply (strip_asms rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   121
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   122
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   123
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   124
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   125
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   126
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   127
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   128
   apply (depth_solve1 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 assumption
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 (erule pi_elim)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   134
   apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   135
  apply (erule pi_elim)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   136
   apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   137
  apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   138
  done
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   139
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   140
58617
4f169d2cf6f3 more cartouches;
wenzelm
parents: 45242
diff changeset
   141
subsection \<open>Second-order Predicate Logic\<close>
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   142
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
   143
schematic_goal (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
   144
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   145
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
   146
schematic_goal (in LP2) "A:* P:A\<rightarrow>A\<rightarrow>* \<turnstile>
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   147
    (\<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
   148
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   149
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
   150
schematic_goal (in LP2) "A:* P:A\<rightarrow>A\<rightarrow>* \<turnstile>
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   151
    ?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"
58617
4f169d2cf6f3 more cartouches;
wenzelm
parents: 45242
diff changeset
   152
  -- \<open>Antisymmetry implies irreflexivity:\<close>
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   153
  apply (strip_asms rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   154
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   155
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   156
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   157
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   158
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   159
    apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   160
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   161
   apply (depth_solve1 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 (erule pi_elim, assumption, assumption?)+
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   167
  done
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   168
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   169
58617
4f169d2cf6f3 more cartouches;
wenzelm
parents: 45242
diff changeset
   170
subsection \<open>LPomega\<close>
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   171
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
   172
schematic_goal (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
   173
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   174
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
   175
schematic_goal (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
   176
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   177
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   178
58617
4f169d2cf6f3 more cartouches;
wenzelm
parents: 45242
diff changeset
   179
subsection \<open>Constructions\<close>
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   180
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
   181
schematic_goal (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
   182
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   183
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
   184
schematic_goal (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
   185
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   186
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
   187
schematic_goal (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
   188
  apply (strip_asms rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   189
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   190
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   191
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   192
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   193
  apply (erule pi_elim, assumption, assumption)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   194
  done
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   195
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   196
58617
4f169d2cf6f3 more cartouches;
wenzelm
parents: 45242
diff changeset
   197
subsection \<open>Some random examples\<close>
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   198
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
   199
schematic_goal (in LP2) "A:* c:A f:A\<rightarrow>A \<turnstile>
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   200
    \<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
   201
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   202
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
   203
schematic_goal (in CC) "\<Lambda> A:*.\<Lambda> c:A. \<Lambda> f:A\<rightarrow>A.
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   204
    \<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
   205
  by (depth_solve rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   206
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 59499
diff changeset
   207
schematic_goal (in LP2)
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   208
  "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)"
58617
4f169d2cf6f3 more cartouches;
wenzelm
parents: 45242
diff changeset
   209
  -- \<open>Symmetry of Leibnitz equality\<close>
17453
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   210
  apply (strip_asms rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   211
  apply (rule lam_ss)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   212
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   213
   prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   214
   apply (depth_solve1 rules)
45242
401f91ed8a93 discontinued redundant ASCII syntax;
wenzelm
parents: 42814
diff changeset
   215
  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
   216
   apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   217
  apply (unfold beta)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   218
  apply (erule imp_elim)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   219
   apply (rule lam_bs)
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 (rule lam_ss)
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
    prefer 2
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   226
    apply (depth_solve1 rules)
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   227
   apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   228
  apply assumption
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   229
  done
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   230
eccff680177d plain test session, includes example;
wenzelm
parents:
diff changeset
   231
end