src/Pure/Pure.thy
author wenzelm
Thu Oct 04 20:29:42 2007 +0200 (2007-10-04)
changeset 24850 0cfd722ab579
parent 23824 8ad7131dbfcf
child 26426 ddac7ef1e991
permissions -rw-r--r--
Name.uu, Name.aT;
wenzelm@15803
     1
(*  Title:      Pure/Pure.thy
wenzelm@15803
     2
    ID:         $Id$
wenzelm@18466
     3
*)
wenzelm@15803
     4
wenzelm@18466
     5
header {* The Pure theory *}
wenzelm@15803
     6
wenzelm@15803
     7
theory Pure
wenzelm@15803
     8
imports ProtoPure
wenzelm@15803
     9
begin
wenzelm@19800
    10
wenzelm@19048
    11
setup  -- {* Common setup of internal components *}
wenzelm@15803
    12
wenzelm@20627
    13
wenzelm@18466
    14
subsection {* Meta-level connectives in assumptions *}
wenzelm@15803
    15
wenzelm@15803
    16
lemma meta_mp:
wenzelm@18019
    17
  assumes "PROP P ==> PROP Q" and "PROP P"
wenzelm@15803
    18
  shows "PROP Q"
wenzelm@18019
    19
    by (rule `PROP P ==> PROP Q` [OF `PROP P`])
wenzelm@15803
    20
nipkow@23432
    21
lemmas meta_impE = meta_mp [elim_format]
nipkow@23432
    22
wenzelm@15803
    23
lemma meta_spec:
wenzelm@18019
    24
  assumes "!!x. PROP P(x)"
wenzelm@15803
    25
  shows "PROP P(x)"
wenzelm@18019
    26
    by (rule `!!x. PROP P(x)`)
wenzelm@15803
    27
wenzelm@15803
    28
lemmas meta_allE = meta_spec [elim_format]
wenzelm@15803
    29
wenzelm@18466
    30
wenzelm@21625
    31
subsection {* Embedded terms *}
wenzelm@21625
    32
wenzelm@21625
    33
locale (open) meta_term_syntax =
wenzelm@21625
    34
  fixes meta_term :: "'a => prop"  ("TERM _")
wenzelm@21625
    35
wenzelm@21625
    36
lemmas [intro?] = termI
wenzelm@21625
    37
wenzelm@21625
    38
wenzelm@18466
    39
subsection {* Meta-level conjunction *}
wenzelm@18466
    40
wenzelm@18466
    41
locale (open) meta_conjunction_syntax =
wenzelm@18466
    42
  fixes meta_conjunction :: "prop => prop => prop"  (infixr "&&" 2)
wenzelm@18466
    43
wenzelm@18466
    44
lemma all_conjunction:
wenzelm@18466
    45
  includes meta_conjunction_syntax
wenzelm@18466
    46
  shows "(!!x. PROP A(x) && PROP B(x)) == ((!!x. PROP A(x)) && (!!x. PROP B(x)))"
wenzelm@18466
    47
proof
wenzelm@18466
    48
  assume conj: "!!x. PROP A(x) && PROP B(x)"
wenzelm@19121
    49
  show "(\<And>x. PROP A(x)) && (\<And>x. PROP B(x))"
wenzelm@19121
    50
  proof -
wenzelm@18466
    51
    fix x
wenzelm@19121
    52
    from conj show "PROP A(x)" by (rule conjunctionD1)
wenzelm@19121
    53
    from conj show "PROP B(x)" by (rule conjunctionD2)
wenzelm@18466
    54
  qed
wenzelm@18466
    55
next
wenzelm@18466
    56
  assume conj: "(!!x. PROP A(x)) && (!!x. PROP B(x))"
wenzelm@18466
    57
  fix x
wenzelm@19121
    58
  show "PROP A(x) && PROP B(x)"
wenzelm@19121
    59
  proof -
wenzelm@19121
    60
    show "PROP A(x)" by (rule conj [THEN conjunctionD1, rule_format])
wenzelm@19121
    61
    show "PROP B(x)" by (rule conj [THEN conjunctionD2, rule_format])
wenzelm@18466
    62
  qed
wenzelm@18466
    63
qed
wenzelm@18466
    64
wenzelm@19121
    65
lemma imp_conjunction:
wenzelm@18466
    66
  includes meta_conjunction_syntax
wenzelm@19121
    67
  shows "(PROP A ==> PROP B && PROP C) == (PROP A ==> PROP B) && (PROP A ==> PROP C)"
wenzelm@18836
    68
proof
wenzelm@18466
    69
  assume conj: "PROP A ==> PROP B && PROP C"
wenzelm@19121
    70
  show "(PROP A ==> PROP B) && (PROP A ==> PROP C)"
wenzelm@19121
    71
  proof -
wenzelm@18466
    72
    assume "PROP A"
wenzelm@19121
    73
    from conj [OF `PROP A`] show "PROP B" by (rule conjunctionD1)
wenzelm@19121
    74
    from conj [OF `PROP A`] show "PROP C" by (rule conjunctionD2)
wenzelm@18466
    75
  qed
wenzelm@18466
    76
next
wenzelm@18466
    77
  assume conj: "(PROP A ==> PROP B) && (PROP A ==> PROP C)"
wenzelm@18466
    78
  assume "PROP A"
wenzelm@19121
    79
  show "PROP B && PROP C"
wenzelm@19121
    80
  proof -
wenzelm@19121
    81
    from `PROP A` show "PROP B" by (rule conj [THEN conjunctionD1])
wenzelm@19121
    82
    from `PROP A` show "PROP C" by (rule conj [THEN conjunctionD2])
wenzelm@18466
    83
  qed
wenzelm@18466
    84
qed
wenzelm@18466
    85
wenzelm@18466
    86
lemma conjunction_imp:
wenzelm@18466
    87
  includes meta_conjunction_syntax
wenzelm@18466
    88
  shows "(PROP A && PROP B ==> PROP C) == (PROP A ==> PROP B ==> PROP C)"
wenzelm@18466
    89
proof
wenzelm@18466
    90
  assume r: "PROP A && PROP B ==> PROP C"
wenzelm@22933
    91
  assume ab: "PROP A" "PROP B"
wenzelm@22933
    92
  show "PROP C"
wenzelm@22933
    93
  proof (rule r)
wenzelm@22933
    94
    from ab show "PROP A && PROP B" .
wenzelm@22933
    95
  qed
wenzelm@18466
    96
next
wenzelm@18466
    97
  assume r: "PROP A ==> PROP B ==> PROP C"
wenzelm@18466
    98
  assume conj: "PROP A && PROP B"
wenzelm@18466
    99
  show "PROP C"
wenzelm@18466
   100
  proof (rule r)
wenzelm@19121
   101
    from conj show "PROP A" by (rule conjunctionD1)
wenzelm@19121
   102
    from conj show "PROP B" by (rule conjunctionD2)
wenzelm@18466
   103
  qed
wenzelm@18466
   104
qed
wenzelm@18466
   105
wenzelm@15803
   106
end