src/Pure/Pure.thy
author wenzelm
Wed Aug 01 19:53:20 2012 +0200 (2012-08-01)
changeset 48638 22d65e375c01
parent 29606 fedb8be05f24
child 48641 92b48b8abfe4
permissions -rw-r--r--
more standard bootstrapping of Pure.thy;
wenzelm@48638
     1
theory Pure
wenzelm@48638
     2
begin
wenzelm@15803
     3
wenzelm@26435
     4
section {* Further content for the Pure theory *}
wenzelm@20627
     5
wenzelm@18466
     6
subsection {* Meta-level connectives in assumptions *}
wenzelm@15803
     7
wenzelm@15803
     8
lemma meta_mp:
wenzelm@18019
     9
  assumes "PROP P ==> PROP Q" and "PROP P"
wenzelm@15803
    10
  shows "PROP Q"
wenzelm@18019
    11
    by (rule `PROP P ==> PROP Q` [OF `PROP P`])
wenzelm@15803
    12
nipkow@23432
    13
lemmas meta_impE = meta_mp [elim_format]
nipkow@23432
    14
wenzelm@15803
    15
lemma meta_spec:
wenzelm@26958
    16
  assumes "!!x. PROP P x"
wenzelm@26958
    17
  shows "PROP P x"
wenzelm@26958
    18
    by (rule `!!x. PROP P x`)
wenzelm@15803
    19
wenzelm@15803
    20
lemmas meta_allE = meta_spec [elim_format]
wenzelm@15803
    21
wenzelm@26570
    22
lemma swap_params:
wenzelm@26958
    23
  "(!!x y. PROP P x y) == (!!y x. PROP P x y)" ..
wenzelm@26570
    24
wenzelm@18466
    25
wenzelm@18466
    26
subsection {* Meta-level conjunction *}
wenzelm@18466
    27
wenzelm@18466
    28
lemma all_conjunction:
wenzelm@28856
    29
  "(!!x. PROP A x &&& PROP B x) == ((!!x. PROP A x) &&& (!!x. PROP B x))"
wenzelm@18466
    30
proof
wenzelm@28856
    31
  assume conj: "!!x. PROP A x &&& PROP B x"
wenzelm@28856
    32
  show "(!!x. PROP A x) &&& (!!x. PROP B x)"
wenzelm@19121
    33
  proof -
wenzelm@18466
    34
    fix x
wenzelm@26958
    35
    from conj show "PROP A x" by (rule conjunctionD1)
wenzelm@26958
    36
    from conj show "PROP B x" by (rule conjunctionD2)
wenzelm@18466
    37
  qed
wenzelm@18466
    38
next
wenzelm@28856
    39
  assume conj: "(!!x. PROP A x) &&& (!!x. PROP B x)"
wenzelm@18466
    40
  fix x
wenzelm@28856
    41
  show "PROP A x &&& PROP B x"
wenzelm@19121
    42
  proof -
wenzelm@26958
    43
    show "PROP A x" by (rule conj [THEN conjunctionD1, rule_format])
wenzelm@26958
    44
    show "PROP B x" by (rule conj [THEN conjunctionD2, rule_format])
wenzelm@18466
    45
  qed
wenzelm@18466
    46
qed
wenzelm@18466
    47
wenzelm@19121
    48
lemma imp_conjunction:
wenzelm@28856
    49
  "(PROP A ==> PROP B &&& PROP C) == (PROP A ==> PROP B) &&& (PROP A ==> PROP C)"
wenzelm@18836
    50
proof
wenzelm@28856
    51
  assume conj: "PROP A ==> PROP B &&& PROP C"
wenzelm@28856
    52
  show "(PROP A ==> PROP B) &&& (PROP A ==> PROP C)"
wenzelm@19121
    53
  proof -
wenzelm@18466
    54
    assume "PROP A"
wenzelm@19121
    55
    from conj [OF `PROP A`] show "PROP B" by (rule conjunctionD1)
wenzelm@19121
    56
    from conj [OF `PROP A`] show "PROP C" by (rule conjunctionD2)
wenzelm@18466
    57
  qed
wenzelm@18466
    58
next
wenzelm@28856
    59
  assume conj: "(PROP A ==> PROP B) &&& (PROP A ==> PROP C)"
wenzelm@18466
    60
  assume "PROP A"
wenzelm@28856
    61
  show "PROP B &&& PROP C"
wenzelm@19121
    62
  proof -
wenzelm@19121
    63
    from `PROP A` show "PROP B" by (rule conj [THEN conjunctionD1])
wenzelm@19121
    64
    from `PROP A` show "PROP C" by (rule conj [THEN conjunctionD2])
wenzelm@18466
    65
  qed
wenzelm@18466
    66
qed
wenzelm@18466
    67
wenzelm@18466
    68
lemma conjunction_imp:
wenzelm@28856
    69
  "(PROP A &&& PROP B ==> PROP C) == (PROP A ==> PROP B ==> PROP C)"
wenzelm@18466
    70
proof
wenzelm@28856
    71
  assume r: "PROP A &&& PROP B ==> PROP C"
wenzelm@22933
    72
  assume ab: "PROP A" "PROP B"
wenzelm@22933
    73
  show "PROP C"
wenzelm@22933
    74
  proof (rule r)
wenzelm@28856
    75
    from ab show "PROP A &&& PROP B" .
wenzelm@22933
    76
  qed
wenzelm@18466
    77
next
wenzelm@18466
    78
  assume r: "PROP A ==> PROP B ==> PROP C"
wenzelm@28856
    79
  assume conj: "PROP A &&& PROP B"
wenzelm@18466
    80
  show "PROP C"
wenzelm@18466
    81
  proof (rule r)
wenzelm@19121
    82
    from conj show "PROP A" by (rule conjunctionD1)
wenzelm@19121
    83
    from conj show "PROP B" by (rule conjunctionD2)
wenzelm@18466
    84
  qed
wenzelm@18466
    85
qed
wenzelm@18466
    86
wenzelm@48638
    87
end
wenzelm@48638
    88