src/HOL/Import/HOL/HOL4Prob.thy
author haftmann
Wed, 06 Sep 2006 13:48:02 +0200
changeset 20485 3078fd2eec7b
parent 17694 b7870c2bd7df
child 23290 c358025ad8db
permissions -rw-r--r--
got rid of Numeral.bin type
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15647
b1f486a9c56b Updated import configuration.
skalberg
parents: 15071
diff changeset
     1
(* AUTOMATICALLY GENERATED, DO NOT EDIT! *)
b1f486a9c56b Updated import configuration.
skalberg
parents: 15071
diff changeset
     2
17566
484ff733f29c new header syntax;
wenzelm
parents: 17188
diff changeset
     3
theory HOL4Prob imports HOL4Real begin
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
     4
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
     5
;setup_theory prob_extra
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
     6
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
     7
lemma BOOL_BOOL_CASES_THM: "ALL f::bool => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
     8
   f = (%b::bool. False) |
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
     9
   f = (%b::bool. True) | f = (%b::bool. b) | f = Not"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    10
  by (import prob_extra BOOL_BOOL_CASES_THM)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    11
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    12
lemma EVEN_ODD_BASIC: "EVEN 0 & ~ EVEN 1 & EVEN 2 & ~ ODD 0 & ODD 1 & ~ ODD 2"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    13
  by (import prob_extra EVEN_ODD_BASIC)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    14
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
    15
lemma EVEN_ODD_EXISTS_EQ: "ALL n::nat.
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    16
   EVEN n = (EX m::nat. n = 2 * m) & ODD n = (EX m::nat. n = Suc (2 * m))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    17
  by (import prob_extra EVEN_ODD_EXISTS_EQ)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    18
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
    19
lemma DIV_THEN_MULT: "ALL (p::nat) q::nat. Suc q * (p div Suc q) <= p"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    20
  by (import prob_extra DIV_THEN_MULT)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    21
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
    22
lemma DIV_TWO_UNIQUE: "ALL (n::nat) (q::nat) r::nat.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
    23
   n = 2 * q + r & (r = 0 | r = 1) --> q = n div 2 & r = n mod 2"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    24
  by (import prob_extra DIV_TWO_UNIQUE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    25
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    26
lemma DIVISION_TWO: "ALL n::nat. n = 2 * (n div 2) + n mod 2 & (n mod 2 = 0 | n mod 2 = 1)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    27
  by (import prob_extra DIVISION_TWO)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    28
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    29
lemma DIV_TWO: "ALL n::nat. n = 2 * (n div 2) + n mod 2"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    30
  by (import prob_extra DIV_TWO)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    31
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    32
lemma MOD_TWO: "ALL n::nat. n mod 2 = (if EVEN n then 0 else 1)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    33
  by (import prob_extra MOD_TWO)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    34
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    35
lemma DIV_TWO_BASIC: "(op &::bool => bool => bool)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    36
 ((op =::nat => nat => bool)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    37
   ((op div::nat => nat => nat) (0::nat)
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
    38
     ((number_of \<Colon> int => nat)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
    39
       ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
    40
         ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int) (bit.B1::bit))
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    41
         (bit.B0::bit))))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    42
   (0::nat))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    43
 ((op &::bool => bool => bool)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    44
   ((op =::nat => nat => bool)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    45
     ((op div::nat => nat => nat) (1::nat)
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
    46
       ((number_of \<Colon> int => nat)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
    47
         ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
    48
           ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int) (bit.B1::bit))
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    49
           (bit.B0::bit))))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    50
     (0::nat))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    51
   ((op =::nat => nat => bool)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    52
     ((op div::nat => nat => nat)
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
    53
       ((number_of \<Colon> int => nat)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
    54
         ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
    55
           ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int) (bit.B1::bit))
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    56
           (bit.B0::bit)))
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
    57
       ((number_of \<Colon> int => nat)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
    58
         ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
    59
           ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int) (bit.B1::bit))
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    60
           (bit.B0::bit))))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    61
     (1::nat)))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    62
  by (import prob_extra DIV_TWO_BASIC)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    63
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
    64
lemma DIV_TWO_MONO: "ALL (m::nat) n::nat. m div 2 < n div 2 --> m < n"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    65
  by (import prob_extra DIV_TWO_MONO)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    66
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
    67
lemma DIV_TWO_MONO_EVEN: "ALL (m::nat) n::nat. EVEN n --> (m div 2 < n div 2) = (m < n)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    68
  by (import prob_extra DIV_TWO_MONO_EVEN)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    69
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    70
lemma DIV_TWO_CANCEL: "ALL n::nat. 2 * n div 2 = n & Suc (2 * n) div 2 = n"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    71
  by (import prob_extra DIV_TWO_CANCEL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    72
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    73
lemma EXP_DIV_TWO: "(All::(nat => bool) => bool)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    74
 (%n::nat.
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    75
     (op =::nat => nat => bool)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    76
      ((op div::nat => nat => nat)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    77
        ((op ^::nat => nat => nat)
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
    78
          ((number_of \<Colon> int => nat)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
    79
            ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
    80
              ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int) (bit.B1::bit))
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    81
              (bit.B0::bit)))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    82
          ((Suc::nat => nat) n))
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
    83
        ((number_of \<Colon> int => nat)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
    84
          ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
    85
            ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int) (bit.B1::bit))
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    86
            (bit.B0::bit))))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    87
      ((op ^::nat => nat => nat)
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
    88
        ((number_of \<Colon> int => nat)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
    89
          ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
    90
            ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int) (bit.B1::bit))
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    91
            (bit.B0::bit)))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    92
        n))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    93
  by (import prob_extra EXP_DIV_TWO)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    94
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    95
lemma EVEN_EXP_TWO: "ALL n::nat. EVEN (2 ^ n) = (n ~= 0)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    96
  by (import prob_extra EVEN_EXP_TWO)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    97
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
    98
lemma DIV_TWO_EXP: "ALL (n::nat) k::nat. (k div 2 < 2 ^ n) = (k < 2 ^ Suc n)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
    99
  by (import prob_extra DIV_TWO_EXP)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   100
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   101
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   102
  inf :: "(real => bool) => real" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   103
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   104
defs
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   105
  inf_primdef: "inf == %P::real => bool. - sup (IMAGE uminus P)"
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   106
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   107
lemma inf_def: "ALL P::real => bool. inf P = - sup (IMAGE uminus P)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   108
  by (import prob_extra inf_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   109
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   110
lemma INF_DEF_ALT: "ALL P::real => bool. inf P = - sup (%r::real. P (- r))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   111
  by (import prob_extra INF_DEF_ALT)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   112
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   113
lemma REAL_SUP_EXISTS_UNIQUE: "ALL P::real => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   114
   Ex P & (EX z::real. ALL x::real. P x --> x <= z) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   115
   (EX! s::real. ALL y::real. (EX x::real. P x & y < x) = (y < s))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   116
  by (import prob_extra REAL_SUP_EXISTS_UNIQUE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   117
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   118
lemma REAL_SUP_MAX: "ALL (P::real => bool) z::real.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   119
   P z & (ALL x::real. P x --> x <= z) --> sup P = z"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   120
  by (import prob_extra REAL_SUP_MAX)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   121
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   122
lemma REAL_INF_MIN: "ALL (P::real => bool) z::real.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   123
   P z & (ALL x::real. P x --> z <= x) --> inf P = z"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   124
  by (import prob_extra REAL_INF_MIN)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   125
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   126
lemma HALF_POS: "(op <::real => real => bool) (0::real)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   127
 ((op /::real => real => real) (1::real)
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   128
   ((number_of \<Colon> int => real)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   129
     ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   130
       ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int) (bit.B1::bit))
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   131
       (bit.B0::bit))))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   132
  by (import prob_extra HALF_POS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   133
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   134
lemma HALF_CANCEL: "(op =::real => real => bool)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   135
 ((op *::real => real => real)
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   136
   ((number_of \<Colon> int => real)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   137
     ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   138
       ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int) (bit.B1::bit))
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   139
       (bit.B0::bit)))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   140
   ((op /::real => real => real) (1::real)
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   141
     ((number_of \<Colon> int => real)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   142
       ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   143
         ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int) (bit.B1::bit))
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   144
         (bit.B0::bit)))))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   145
 (1::real)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   146
  by (import prob_extra HALF_CANCEL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   147
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   148
lemma POW_HALF_POS: "(All::(nat => bool) => bool)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   149
 (%n::nat.
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   150
     (op <::real => real => bool) (0::real)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   151
      ((op ^::real => nat => real)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   152
        ((op /::real => real => real) (1::real)
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   153
          ((number_of \<Colon> int => real)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   154
            ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   155
              ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int) (bit.B1::bit))
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   156
              (bit.B0::bit))))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   157
        n))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   158
  by (import prob_extra POW_HALF_POS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   159
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   160
lemma POW_HALF_MONO: "(All::(nat => bool) => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   161
 (%m::nat.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   162
     (All::(nat => bool) => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   163
      (%n::nat.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   164
          (op -->::bool => bool => bool) ((op <=::nat => nat => bool) m n)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   165
           ((op <=::real => real => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   166
             ((op ^::real => nat => real)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   167
               ((op /::real => real => real) (1::real)
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   168
                 ((number_of \<Colon> int => real)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   169
                   ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   170
                     ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int)
15647
b1f486a9c56b Updated import configuration.
skalberg
parents: 15071
diff changeset
   171
                       (bit.B1::bit))
b1f486a9c56b Updated import configuration.
skalberg
parents: 15071
diff changeset
   172
                     (bit.B0::bit))))
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   173
               n)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   174
             ((op ^::real => nat => real)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   175
               ((op /::real => real => real) (1::real)
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   176
                 ((number_of \<Colon> int => real)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   177
                   ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   178
                     ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int)
15647
b1f486a9c56b Updated import configuration.
skalberg
parents: 15071
diff changeset
   179
                       (bit.B1::bit))
b1f486a9c56b Updated import configuration.
skalberg
parents: 15071
diff changeset
   180
                     (bit.B0::bit))))
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   181
               m))))"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   182
  by (import prob_extra POW_HALF_MONO)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   183
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   184
lemma POW_HALF_TWICE: "(All::(nat => bool) => bool)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   185
 (%n::nat.
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   186
     (op =::real => real => bool)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   187
      ((op ^::real => nat => real)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   188
        ((op /::real => real => real) (1::real)
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   189
          ((number_of \<Colon> int => real)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   190
            ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   191
              ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int) (bit.B1::bit))
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   192
              (bit.B0::bit))))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   193
        n)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   194
      ((op *::real => real => real)
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   195
        ((number_of \<Colon> int => real)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   196
          ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   197
            ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int) (bit.B1::bit))
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   198
            (bit.B0::bit)))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   199
        ((op ^::real => nat => real)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   200
          ((op /::real => real => real) (1::real)
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   201
            ((number_of \<Colon> int => real)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   202
              ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   203
                ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int)
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   204
                  (bit.B1::bit))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   205
                (bit.B0::bit))))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   206
          ((Suc::nat => nat) n))))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   207
  by (import prob_extra POW_HALF_TWICE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   208
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   209
lemma X_HALF_HALF: "ALL x::real. 1 / 2 * x + 1 / 2 * x = x"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   210
  by (import prob_extra X_HALF_HALF)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   211
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   212
lemma REAL_SUP_LE_X: "ALL (P::real => bool) x::real.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   213
   Ex P & (ALL r::real. P r --> r <= x) --> sup P <= x"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   214
  by (import prob_extra REAL_SUP_LE_X)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   215
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   216
lemma REAL_X_LE_SUP: "ALL (P::real => bool) x::real.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   217
   Ex P &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   218
   (EX z::real. ALL r::real. P r --> r <= z) &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   219
   (EX r::real. P r & x <= r) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   220
   x <= sup P"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   221
  by (import prob_extra REAL_X_LE_SUP)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   222
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   223
lemma ABS_BETWEEN_LE: "ALL (x::real) (y::real) d::real.
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   224
   (0 <= d & x - d <= y & y <= x + d) = (abs (y - x) <= d)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   225
  by (import prob_extra ABS_BETWEEN_LE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   226
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   227
lemma ONE_MINUS_HALF: "(op =::real => real => bool)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   228
 ((op -::real => real => real) (1::real)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   229
   ((op /::real => real => real) (1::real)
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   230
     ((number_of \<Colon> int => real)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   231
       ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   232
         ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int) (bit.B1::bit))
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   233
         (bit.B0::bit)))))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   234
 ((op /::real => real => real) (1::real)
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   235
   ((number_of \<Colon> int => real)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   236
     ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   237
       ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int) (bit.B1::bit))
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   238
       (bit.B0::bit))))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   239
  by (import prob_extra ONE_MINUS_HALF)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   240
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   241
lemma HALF_LT_1: "(op <::real => real => bool)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   242
 ((op /::real => real => real) (1::real)
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   243
   ((number_of \<Colon> int => real)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   244
     ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   245
       ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int) (bit.B1::bit))
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   246
       (bit.B0::bit))))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   247
 (1::real)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   248
  by (import prob_extra HALF_LT_1)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   249
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   250
lemma POW_HALF_EXP: "(All::(nat => bool) => bool)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   251
 (%n::nat.
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   252
     (op =::real => real => bool)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   253
      ((op ^::real => nat => real)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   254
        ((op /::real => real => real) (1::real)
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   255
          ((number_of \<Colon> int => real)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   256
            ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   257
              ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int) (bit.B1::bit))
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   258
              (bit.B0::bit))))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   259
        n)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   260
      ((inverse::real => real)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   261
        ((real::nat => real)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   262
          ((op ^::nat => nat => nat)
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   263
            ((number_of \<Colon> int => nat)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   264
              ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
   265
                ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int)
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   266
                  (bit.B1::bit))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   267
                (bit.B0::bit)))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   268
            n))))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   269
  by (import prob_extra POW_HALF_EXP)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   270
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   271
lemma INV_SUC_POS: "ALL n::nat. 0 < 1 / real (Suc n)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   272
  by (import prob_extra INV_SUC_POS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   273
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   274
lemma INV_SUC_MAX: "ALL x::nat. 1 / real (Suc x) <= 1"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   275
  by (import prob_extra INV_SUC_MAX)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   276
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   277
lemma INV_SUC: "ALL n::nat. 0 < 1 / real (Suc n) & 1 / real (Suc n) <= 1"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   278
  by (import prob_extra INV_SUC)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   279
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   280
lemma ABS_UNIT_INTERVAL: "ALL (x::real) y::real.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   281
   0 <= x & x <= 1 & 0 <= y & y <= 1 --> abs (x - y) <= 1"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   282
  by (import prob_extra ABS_UNIT_INTERVAL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   283
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   284
lemma MEM_NIL: "ALL l::'a::type list. (ALL x::'a::type. ~ x mem l) = (l = [])"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   285
  by (import prob_extra MEM_NIL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   286
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   287
lemma MAP_MEM: "ALL (f::'a::type => 'b::type) (l::'a::type list) x::'b::type.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   288
   x mem map f l = (EX y::'a::type. y mem l & x = f y)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   289
  by (import prob_extra MAP_MEM)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   290
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   291
lemma MEM_NIL_MAP_CONS: "ALL (x::'a::type) l::'a::type list list. ~ [] mem map (op # x) l"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   292
  by (import prob_extra MEM_NIL_MAP_CONS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   293
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   294
lemma FILTER_TRUE: "ALL l::'a::type list. [x::'a::type:l. True] = l"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   295
  by (import prob_extra FILTER_TRUE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   296
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   297
lemma FILTER_FALSE: "ALL l::'a::type list. [x::'a::type:l. False] = []"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   298
  by (import prob_extra FILTER_FALSE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   299
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   300
lemma FILTER_MEM: "ALL (P::'a::type => bool) (x::'a::type) l::'a::type list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   301
   x mem filter P l --> P x"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   302
  by (import prob_extra FILTER_MEM)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   303
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   304
lemma MEM_FILTER: "ALL (P::'a::type => bool) (l::'a::type list) x::'a::type.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   305
   x mem filter P l --> x mem l"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   306
  by (import prob_extra MEM_FILTER)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   307
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   308
lemma FILTER_OUT_ELT: "ALL (x::'a::type) l::'a::type list. x mem l | [y::'a::type:l. y ~= x] = l"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   309
  by (import prob_extra FILTER_OUT_ELT)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   310
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   311
lemma IS_PREFIX_NIL: "ALL x::'a::type list. IS_PREFIX x [] & IS_PREFIX [] x = (x = [])"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   312
  by (import prob_extra IS_PREFIX_NIL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   313
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   314
lemma IS_PREFIX_REFL: "ALL x::'a::type list. IS_PREFIX x x"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   315
  by (import prob_extra IS_PREFIX_REFL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   316
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   317
lemma IS_PREFIX_ANTISYM: "ALL (x::'a::type list) y::'a::type list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   318
   IS_PREFIX y x & IS_PREFIX x y --> x = y"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   319
  by (import prob_extra IS_PREFIX_ANTISYM)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   320
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   321
lemma IS_PREFIX_TRANS: "ALL (x::'a::type list) (y::'a::type list) z::'a::type list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   322
   IS_PREFIX x y & IS_PREFIX y z --> IS_PREFIX x z"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   323
  by (import prob_extra IS_PREFIX_TRANS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   324
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   325
lemma IS_PREFIX_BUTLAST: "ALL (x::'a::type) y::'a::type list. IS_PREFIX (x # y) (butlast (x # y))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   326
  by (import prob_extra IS_PREFIX_BUTLAST)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   327
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   328
lemma IS_PREFIX_LENGTH: "ALL (x::'a::type list) y::'a::type list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   329
   IS_PREFIX y x --> length x <= length y"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   330
  by (import prob_extra IS_PREFIX_LENGTH)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   331
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   332
lemma IS_PREFIX_LENGTH_ANTI: "ALL (x::'a::type list) y::'a::type list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   333
   IS_PREFIX y x & length x = length y --> x = y"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   334
  by (import prob_extra IS_PREFIX_LENGTH_ANTI)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   335
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   336
lemma IS_PREFIX_SNOC: "ALL (x::'a::type) (y::'a::type list) z::'a::type list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   337
   IS_PREFIX (SNOC x y) z = (IS_PREFIX y z | z = SNOC x y)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   338
  by (import prob_extra IS_PREFIX_SNOC)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   339
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   340
lemma FOLDR_MAP: "ALL (f::'b::type => 'c::type => 'c::type) (e::'c::type)
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   341
   (g::'a::type => 'b::type) l::'a::type list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   342
   foldr f (map g l) e = foldr (%x::'a::type. f (g x)) l e"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   343
  by (import prob_extra FOLDR_MAP)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   344
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   345
lemma LAST_MEM: "ALL (h::'a::type) t::'a::type list. last (h # t) mem h # t"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   346
  by (import prob_extra LAST_MEM)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   347
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   348
lemma LAST_MAP_CONS: "ALL (b::bool) (h::bool list) t::bool list list.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   349
   EX x::bool list. last (map (op # b) (h # t)) = b # x"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   350
  by (import prob_extra LAST_MAP_CONS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   351
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   352
lemma EXISTS_LONGEST: "ALL (x::'a::type list) y::'a::type list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   353
   EX z::'a::type list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   354
      z mem x # y &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   355
      (ALL w::'a::type list. w mem x # y --> length w <= length z)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   356
  by (import prob_extra EXISTS_LONGEST)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   357
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   358
lemma UNION_DEF_ALT: "ALL (s::'a::type => bool) t::'a::type => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   359
   pred_set.UNION s t = (%x::'a::type. s x | t x)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   360
  by (import prob_extra UNION_DEF_ALT)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   361
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   362
lemma INTER_UNION_RDISTRIB: "ALL (p::'a::type => bool) (q::'a::type => bool) r::'a::type => bool.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   363
   pred_set.INTER (pred_set.UNION p q) r =
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   364
   pred_set.UNION (pred_set.INTER p r) (pred_set.INTER q r)"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   365
  by (import prob_extra INTER_UNION_RDISTRIB)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   366
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   367
lemma SUBSET_EQ: "ALL (x::'a::type => bool) xa::'a::type => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   368
   (x = xa) = (SUBSET x xa & SUBSET xa x)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   369
  by (import prob_extra SUBSET_EQ)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   370
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   371
lemma INTER_IS_EMPTY: "ALL (s::'a::type => bool) t::'a::type => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   372
   (pred_set.INTER s t = EMPTY) = (ALL x::'a::type. ~ s x | ~ t x)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   373
  by (import prob_extra INTER_IS_EMPTY)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   374
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   375
lemma UNION_DISJOINT_SPLIT: "ALL (s::'a::type => bool) (t::'a::type => bool) u::'a::type => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   376
   pred_set.UNION s t = pred_set.UNION s u &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   377
   pred_set.INTER s t = EMPTY & pred_set.INTER s u = EMPTY -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   378
   t = u"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   379
  by (import prob_extra UNION_DISJOINT_SPLIT)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   380
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   381
lemma GSPEC_DEF_ALT: "ALL f::'a::type => 'b::type * bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   382
   GSPEC f = (%v::'b::type. EX x::'a::type. (v, True) = f x)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   383
  by (import prob_extra GSPEC_DEF_ALT)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   384
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   385
;end_setup
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   386
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   387
;setup_theory prob_canon
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   388
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   389
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   390
  alg_twin :: "bool list => bool list => bool" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   391
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   392
defs
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   393
  alg_twin_primdef: "alg_twin ==
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   394
%(x::bool list) y::bool list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   395
   EX l::bool list. x = SNOC True l & y = SNOC False l"
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   396
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   397
lemma alg_twin_def: "ALL (x::bool list) y::bool list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   398
   alg_twin x y = (EX l::bool list. x = SNOC True l & y = SNOC False l)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   399
  by (import prob_canon alg_twin_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   400
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   401
constdefs
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   402
  alg_order_tupled :: "bool list * bool list => bool" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   403
  "(op ==::(bool list * bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   404
        => (bool list * bool list => bool) => prop)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   405
 (alg_order_tupled::bool list * bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   406
 ((WFREC::(bool list * bool list => bool list * bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   407
          => ((bool list * bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   408
              => bool list * bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   409
             => bool list * bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   410
   ((Eps::((bool list * bool list => bool list * bool list => bool) => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   411
          => bool list * bool list => bool list * bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   412
     (%R::bool list * bool list => bool list * bool list => bool.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   413
         (op &::bool => bool => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   414
          ((WF::(bool list * bool list => bool list * bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   415
                => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   416
            R)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   417
          ((All::(bool => bool) => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   418
            (%h'::bool.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   419
                (All::(bool => bool) => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   420
                 (%h::bool.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   421
                     (All::(bool list => bool) => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   422
                      (%t'::bool list.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   423
                          (All::(bool list => bool) => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   424
                           (%t::bool list.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   425
                               R ((Pair::bool list
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   426
   => bool list => bool list * bool list)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   427
                                   t t')
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   428
                                ((Pair::bool list
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   429
  => bool list => bool list * bool list)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   430
                                  ((op #::bool => bool list => bool list) h
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   431
                                    t)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   432
                                  ((op #::bool => bool list => bool list) h'
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   433
                                    t')))))))))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   434
   (%alg_order_tupled::bool list * bool list => bool.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   435
       (split::(bool list => bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   436
               => bool list * bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   437
        (%(v::bool list) v1::bool list.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   438
            (list_case::bool
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   439
                        => (bool => bool list => bool) => bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   440
             ((list_case::bool
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   441
                          => (bool => bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   442
                             => bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   443
               (True::bool) (%(v8::bool) v9::bool list. True::bool) v1)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   444
             (%(v4::bool) v5::bool list.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   445
                 (list_case::bool
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   446
                             => (bool => bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   447
                                => bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   448
                  (False::bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   449
                  (%(v10::bool) v11::bool list.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   450
                      (op |::bool => bool => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   451
                       ((op &::bool => bool => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   452
                         ((op =::bool => bool => bool) v4 (True::bool))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   453
                         ((op =::bool => bool => bool) v10 (False::bool)))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   454
                       ((op &::bool => bool => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   455
                         ((op =::bool => bool => bool) v4 v10)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   456
                         (alg_order_tupled
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   457
                           ((Pair::bool list
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   458
                                   => bool list => bool list * bool list)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   459
                             v5 v11))))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   460
                  v1)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   461
             v)))"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   462
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   463
lemma alg_order_tupled_primitive_def: "(op =::(bool list * bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   464
       => (bool list * bool list => bool) => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   465
 (alg_order_tupled::bool list * bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   466
 ((WFREC::(bool list * bool list => bool list * bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   467
          => ((bool list * bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   468
              => bool list * bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   469
             => bool list * bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   470
   ((Eps::((bool list * bool list => bool list * bool list => bool) => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   471
          => bool list * bool list => bool list * bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   472
     (%R::bool list * bool list => bool list * bool list => bool.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   473
         (op &::bool => bool => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   474
          ((WF::(bool list * bool list => bool list * bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   475
                => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   476
            R)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   477
          ((All::(bool => bool) => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   478
            (%h'::bool.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   479
                (All::(bool => bool) => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   480
                 (%h::bool.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   481
                     (All::(bool list => bool) => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   482
                      (%t'::bool list.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   483
                          (All::(bool list => bool) => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   484
                           (%t::bool list.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   485
                               R ((Pair::bool list
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   486
   => bool list => bool list * bool list)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   487
                                   t t')
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   488
                                ((Pair::bool list
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   489
  => bool list => bool list * bool list)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   490
                                  ((op #::bool => bool list => bool list) h
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   491
                                    t)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   492
                                  ((op #::bool => bool list => bool list) h'
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   493
                                    t')))))))))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   494
   (%alg_order_tupled::bool list * bool list => bool.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   495
       (split::(bool list => bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   496
               => bool list * bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   497
        (%(v::bool list) v1::bool list.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   498
            (list_case::bool
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   499
                        => (bool => bool list => bool) => bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   500
             ((list_case::bool
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   501
                          => (bool => bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   502
                             => bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   503
               (True::bool) (%(v8::bool) v9::bool list. True::bool) v1)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   504
             (%(v4::bool) v5::bool list.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   505
                 (list_case::bool
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   506
                             => (bool => bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   507
                                => bool list => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   508
                  (False::bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   509
                  (%(v10::bool) v11::bool list.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   510
                      (op |::bool => bool => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   511
                       ((op &::bool => bool => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   512
                         ((op =::bool => bool => bool) v4 (True::bool))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   513
                         ((op =::bool => bool => bool) v10 (False::bool)))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   514
                       ((op &::bool => bool => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   515
                         ((op =::bool => bool => bool) v4 v10)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   516
                         (alg_order_tupled
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   517
                           ((Pair::bool list
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   518
                                   => bool list => bool list * bool list)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   519
                             v5 v11))))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   520
                  v1)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   521
             v)))"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   522
  by (import prob_canon alg_order_tupled_primitive_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   523
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   524
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   525
  alg_order :: "bool list => bool list => bool" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   526
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   527
defs
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   528
  alg_order_primdef: "alg_order == %(x::bool list) x1::bool list. alg_order_tupled (x, x1)"
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   529
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   530
lemma alg_order_curried_def: "ALL (x::bool list) x1::bool list. alg_order x x1 = alg_order_tupled (x, x1)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   531
  by (import prob_canon alg_order_curried_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   532
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   533
lemma alg_order_ind: "ALL P::bool list => bool list => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   534
   (ALL (x::bool) xa::bool list. P [] (x # xa)) &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   535
   P [] [] &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   536
   (ALL (x::bool) xa::bool list. P (x # xa) []) &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   537
   (ALL (x::bool) (xa::bool list) (xb::bool) xc::bool list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   538
       P xa xc --> P (x # xa) (xb # xc)) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   539
   (ALL x::bool list. All (P x))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   540
  by (import prob_canon alg_order_ind)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   541
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   542
lemma alg_order_def: "alg_order [] ((v6::bool) # (v7::bool list)) = True &
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   543
alg_order [] [] = True &
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   544
alg_order ((v2::bool) # (v3::bool list)) [] = False &
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   545
alg_order ((h::bool) # (t::bool list)) ((h'::bool) # (t'::bool list)) =
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   546
(h = True & h' = False | h = h' & alg_order t t')"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   547
  by (import prob_canon alg_order_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   548
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   549
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   550
  alg_sorted :: "bool list list => bool" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   551
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   552
defs
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   553
  alg_sorted_primdef: "alg_sorted ==
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   554
WFREC
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   555
 (SOME R::bool list list => bool list list => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   556
     WF R &
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   557
     (ALL (x::bool list) (z::bool list list) y::bool list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   558
         R (y # z) (x # y # z)))
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   559
 (%alg_sorted::bool list list => bool.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   560
     list_case True
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   561
      (%v2::bool list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   562
          list_case True
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   563
           (%(v6::bool list) v7::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   564
               alg_order v2 v6 & alg_sorted (v6 # v7))))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   565
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   566
lemma alg_sorted_primitive_def: "alg_sorted =
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   567
WFREC
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   568
 (SOME R::bool list list => bool list list => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   569
     WF R &
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   570
     (ALL (x::bool list) (z::bool list list) y::bool list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   571
         R (y # z) (x # y # z)))
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   572
 (%alg_sorted::bool list list => bool.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   573
     list_case True
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   574
      (%v2::bool list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   575
          list_case True
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   576
           (%(v6::bool list) v7::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   577
               alg_order v2 v6 & alg_sorted (v6 # v7))))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   578
  by (import prob_canon alg_sorted_primitive_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   579
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   580
lemma alg_sorted_ind: "ALL P::bool list list => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   581
   (ALL (x::bool list) (y::bool list) z::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   582
       P (y # z) --> P (x # y # z)) &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   583
   (ALL v::bool list. P [v]) & P [] -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   584
   All P"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   585
  by (import prob_canon alg_sorted_ind)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   586
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   587
lemma alg_sorted_def: "alg_sorted ((x::bool list) # (y::bool list) # (z::bool list list)) =
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   588
(alg_order x y & alg_sorted (y # z)) &
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   589
alg_sorted [v::bool list] = True & alg_sorted [] = True"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   590
  by (import prob_canon alg_sorted_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   591
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   592
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   593
  alg_prefixfree :: "bool list list => bool" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   594
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   595
defs
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   596
  alg_prefixfree_primdef: "alg_prefixfree ==
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   597
WFREC
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   598
 (SOME R::bool list list => bool list list => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   599
     WF R &
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   600
     (ALL (x::bool list) (z::bool list list) y::bool list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   601
         R (y # z) (x # y # z)))
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   602
 (%alg_prefixfree::bool list list => bool.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   603
     list_case True
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   604
      (%v2::bool list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   605
          list_case True
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   606
           (%(v6::bool list) v7::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   607
               ~ IS_PREFIX v6 v2 & alg_prefixfree (v6 # v7))))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   608
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   609
lemma alg_prefixfree_primitive_def: "alg_prefixfree =
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   610
WFREC
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   611
 (SOME R::bool list list => bool list list => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   612
     WF R &
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   613
     (ALL (x::bool list) (z::bool list list) y::bool list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   614
         R (y # z) (x # y # z)))
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   615
 (%alg_prefixfree::bool list list => bool.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   616
     list_case True
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   617
      (%v2::bool list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   618
          list_case True
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   619
           (%(v6::bool list) v7::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   620
               ~ IS_PREFIX v6 v2 & alg_prefixfree (v6 # v7))))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   621
  by (import prob_canon alg_prefixfree_primitive_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   622
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   623
lemma alg_prefixfree_ind: "ALL P::bool list list => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   624
   (ALL (x::bool list) (y::bool list) z::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   625
       P (y # z) --> P (x # y # z)) &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   626
   (ALL v::bool list. P [v]) & P [] -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   627
   All P"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   628
  by (import prob_canon alg_prefixfree_ind)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   629
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   630
lemma alg_prefixfree_def: "alg_prefixfree ((x::bool list) # (y::bool list) # (z::bool list list)) =
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   631
(~ IS_PREFIX y x & alg_prefixfree (y # z)) &
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   632
alg_prefixfree [v::bool list] = True & alg_prefixfree [] = True"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   633
  by (import prob_canon alg_prefixfree_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   634
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   635
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   636
  alg_twinfree :: "bool list list => bool" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   637
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   638
defs
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   639
  alg_twinfree_primdef: "alg_twinfree ==
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   640
WFREC
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   641
 (SOME R::bool list list => bool list list => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   642
     WF R &
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   643
     (ALL (x::bool list) (z::bool list list) y::bool list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   644
         R (y # z) (x # y # z)))
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   645
 (%alg_twinfree::bool list list => bool.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   646
     list_case True
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   647
      (%v2::bool list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   648
          list_case True
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   649
           (%(v6::bool list) v7::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   650
               ~ alg_twin v2 v6 & alg_twinfree (v6 # v7))))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   651
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   652
lemma alg_twinfree_primitive_def: "alg_twinfree =
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   653
WFREC
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   654
 (SOME R::bool list list => bool list list => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   655
     WF R &
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   656
     (ALL (x::bool list) (z::bool list list) y::bool list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   657
         R (y # z) (x # y # z)))
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   658
 (%alg_twinfree::bool list list => bool.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   659
     list_case True
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   660
      (%v2::bool list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   661
          list_case True
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   662
           (%(v6::bool list) v7::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   663
               ~ alg_twin v2 v6 & alg_twinfree (v6 # v7))))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   664
  by (import prob_canon alg_twinfree_primitive_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   665
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   666
lemma alg_twinfree_ind: "ALL P::bool list list => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   667
   (ALL (x::bool list) (y::bool list) z::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   668
       P (y # z) --> P (x # y # z)) &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   669
   (ALL v::bool list. P [v]) & P [] -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   670
   All P"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   671
  by (import prob_canon alg_twinfree_ind)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   672
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   673
lemma alg_twinfree_def: "alg_twinfree ((x::bool list) # (y::bool list) # (z::bool list list)) =
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   674
(~ alg_twin x y & alg_twinfree (y # z)) &
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   675
alg_twinfree [v::bool list] = True & alg_twinfree [] = True"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   676
  by (import prob_canon alg_twinfree_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   677
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   678
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   679
  alg_longest :: "bool list list => nat" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   680
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   681
defs
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   682
  alg_longest_primdef: "alg_longest ==
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   683
FOLDR (%(h::bool list) t::nat. if t <= length h then length h else t) 0"
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   684
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   685
lemma alg_longest_def: "alg_longest =
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
   686
FOLDR (%(h::bool list) t::nat. if t <= length h then length h else t) 0"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   687
  by (import prob_canon alg_longest_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   688
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   689
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   690
  alg_canon_prefs :: "bool list => bool list list => bool list list" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   691
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   692
specification (alg_canon_prefs_primdef: alg_canon_prefs) alg_canon_prefs_def: "(ALL l::bool list. alg_canon_prefs l [] = [l]) &
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   693
(ALL (l::bool list) (h::bool list) t::bool list list.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   694
    alg_canon_prefs l (h # t) =
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   695
    (if IS_PREFIX h l then alg_canon_prefs l t else l # h # t))"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   696
  by (import prob_canon alg_canon_prefs_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   697
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   698
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   699
  alg_canon_find :: "bool list => bool list list => bool list list" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   700
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   701
specification (alg_canon_find_primdef: alg_canon_find) alg_canon_find_def: "(ALL l::bool list. alg_canon_find l [] = [l]) &
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   702
(ALL (l::bool list) (h::bool list) t::bool list list.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   703
    alg_canon_find l (h # t) =
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   704
    (if alg_order h l
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   705
     then if IS_PREFIX l h then h # t else h # alg_canon_find l t
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   706
     else alg_canon_prefs l (h # t)))"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   707
  by (import prob_canon alg_canon_find_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   708
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   709
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   710
  alg_canon1 :: "bool list list => bool list list" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   711
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   712
defs
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   713
  alg_canon1_primdef: "alg_canon1 == FOLDR alg_canon_find []"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   714
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   715
lemma alg_canon1_def: "alg_canon1 = FOLDR alg_canon_find []"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   716
  by (import prob_canon alg_canon1_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   717
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   718
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   719
  alg_canon_merge :: "bool list => bool list list => bool list list" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   720
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   721
specification (alg_canon_merge_primdef: alg_canon_merge) alg_canon_merge_def: "(ALL l::bool list. alg_canon_merge l [] = [l]) &
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   722
(ALL (l::bool list) (h::bool list) t::bool list list.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   723
    alg_canon_merge l (h # t) =
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   724
    (if alg_twin l h then alg_canon_merge (butlast h) t else l # h # t))"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   725
  by (import prob_canon alg_canon_merge_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   726
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   727
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   728
  alg_canon2 :: "bool list list => bool list list" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   729
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   730
defs
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   731
  alg_canon2_primdef: "alg_canon2 == FOLDR alg_canon_merge []"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   732
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   733
lemma alg_canon2_def: "alg_canon2 = FOLDR alg_canon_merge []"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   734
  by (import prob_canon alg_canon2_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   735
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   736
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   737
  alg_canon :: "bool list list => bool list list" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   738
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   739
defs
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   740
  alg_canon_primdef: "alg_canon == %l::bool list list. alg_canon2 (alg_canon1 l)"
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   741
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   742
lemma alg_canon_def: "ALL l::bool list list. alg_canon l = alg_canon2 (alg_canon1 l)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   743
  by (import prob_canon alg_canon_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   744
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   745
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   746
  algebra_canon :: "bool list list => bool" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   747
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   748
defs
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   749
  algebra_canon_primdef: "algebra_canon == %l::bool list list. alg_canon l = l"
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   750
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   751
lemma algebra_canon_def: "ALL l::bool list list. algebra_canon l = (alg_canon l = l)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   752
  by (import prob_canon algebra_canon_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   753
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   754
lemma ALG_TWIN_NIL: "ALL l::bool list. ~ alg_twin l [] & ~ alg_twin [] l"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   755
  by (import prob_canon ALG_TWIN_NIL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   756
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   757
lemma ALG_TWIN_SING: "ALL (x::bool) l::bool list.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   758
   alg_twin [x] l = (x = True & l = [False]) &
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   759
   alg_twin l [x] = (l = [True] & x = False)"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   760
  by (import prob_canon ALG_TWIN_SING)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   761
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   762
lemma ALG_TWIN_CONS: "ALL (x::bool) (y::bool) (z::bool list) (h::bool) t::bool list.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   763
   alg_twin (x # y # z) (h # t) = (x = h & alg_twin (y # z) t) &
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   764
   alg_twin (h # t) (x # y # z) = (x = h & alg_twin t (y # z))"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   765
  by (import prob_canon ALG_TWIN_CONS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   766
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   767
lemma ALG_TWIN_REDUCE: "ALL (h::bool) (t::bool list) t'::bool list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   768
   alg_twin (h # t) (h # t') = alg_twin t t'"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   769
  by (import prob_canon ALG_TWIN_REDUCE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   770
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   771
lemma ALG_TWINS_PREFIX: "ALL (x::bool list) l::bool list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   772
   IS_PREFIX x l -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   773
   x = l | IS_PREFIX x (SNOC True l) | IS_PREFIX x (SNOC False l)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   774
  by (import prob_canon ALG_TWINS_PREFIX)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   775
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   776
lemma ALG_ORDER_NIL: "ALL x::bool list. alg_order [] x & alg_order x [] = (x = [])"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   777
  by (import prob_canon ALG_ORDER_NIL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   778
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   779
lemma ALG_ORDER_REFL: "ALL x::bool list. alg_order x x"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   780
  by (import prob_canon ALG_ORDER_REFL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   781
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   782
lemma ALG_ORDER_ANTISYM: "ALL (x::bool list) y::bool list. alg_order x y & alg_order y x --> x = y"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   783
  by (import prob_canon ALG_ORDER_ANTISYM)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   784
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   785
lemma ALG_ORDER_TRANS: "ALL (x::bool list) (y::bool list) z::bool list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   786
   alg_order x y & alg_order y z --> alg_order x z"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   787
  by (import prob_canon ALG_ORDER_TRANS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   788
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   789
lemma ALG_ORDER_TOTAL: "ALL (x::bool list) y::bool list. alg_order x y | alg_order y x"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   790
  by (import prob_canon ALG_ORDER_TOTAL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   791
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   792
lemma ALG_ORDER_PREFIX: "ALL (x::bool list) y::bool list. IS_PREFIX y x --> alg_order x y"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   793
  by (import prob_canon ALG_ORDER_PREFIX)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   794
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   795
lemma ALG_ORDER_PREFIX_ANTI: "ALL (x::bool list) y::bool list. alg_order x y & IS_PREFIX x y --> x = y"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   796
  by (import prob_canon ALG_ORDER_PREFIX_ANTI)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   797
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   798
lemma ALG_ORDER_PREFIX_MONO: "ALL (x::bool list) (y::bool list) z::bool list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   799
   alg_order x y & alg_order y z & IS_PREFIX z x --> IS_PREFIX y x"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   800
  by (import prob_canon ALG_ORDER_PREFIX_MONO)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   801
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   802
lemma ALG_ORDER_PREFIX_TRANS: "ALL (x::bool list) (y::bool list) z::bool list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   803
   alg_order x y & IS_PREFIX y z --> alg_order x z | IS_PREFIX x z"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   804
  by (import prob_canon ALG_ORDER_PREFIX_TRANS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   805
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   806
lemma ALG_ORDER_SNOC: "ALL (x::bool) l::bool list. ~ alg_order (SNOC x l) l"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   807
  by (import prob_canon ALG_ORDER_SNOC)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   808
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   809
lemma ALG_SORTED_MIN: "ALL (h::bool list) t::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   810
   alg_sorted (h # t) --> (ALL x::bool list. x mem t --> alg_order h x)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   811
  by (import prob_canon ALG_SORTED_MIN)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   812
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   813
lemma ALG_SORTED_DEF_ALT: "ALL (h::bool list) t::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   814
   alg_sorted (h # t) =
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   815
   ((ALL x::bool list. x mem t --> alg_order h x) & alg_sorted t)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   816
  by (import prob_canon ALG_SORTED_DEF_ALT)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   817
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   818
lemma ALG_SORTED_TL: "ALL (h::bool list) t::bool list list. alg_sorted (h # t) --> alg_sorted t"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   819
  by (import prob_canon ALG_SORTED_TL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   820
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   821
lemma ALG_SORTED_MONO: "ALL (x::bool list) (y::bool list) z::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   822
   alg_sorted (x # y # z) --> alg_sorted (x # z)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   823
  by (import prob_canon ALG_SORTED_MONO)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   824
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   825
lemma ALG_SORTED_TLS: "ALL (l::bool list list) b::bool. alg_sorted (map (op # b) l) = alg_sorted l"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   826
  by (import prob_canon ALG_SORTED_TLS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   827
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   828
lemma ALG_SORTED_STEP: "ALL (l1::bool list list) l2::bool list list.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   829
   alg_sorted (map (op # True) l1 @ map (op # False) l2) =
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   830
   (alg_sorted l1 & alg_sorted l2)"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   831
  by (import prob_canon ALG_SORTED_STEP)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   832
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   833
lemma ALG_SORTED_APPEND: "ALL (h::bool list) (h'::bool list) (t::bool list list) t'::bool list list.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   834
   alg_sorted ((h # t) @ h' # t') =
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   835
   (alg_sorted (h # t) & alg_sorted (h' # t') & alg_order (last (h # t)) h')"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   836
  by (import prob_canon ALG_SORTED_APPEND)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   837
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   838
lemma ALG_SORTED_FILTER: "ALL (P::bool list => bool) b::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   839
   alg_sorted b --> alg_sorted (filter P b)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   840
  by (import prob_canon ALG_SORTED_FILTER)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   841
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   842
lemma ALG_PREFIXFREE_TL: "ALL (h::bool list) t::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   843
   alg_prefixfree (h # t) --> alg_prefixfree t"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   844
  by (import prob_canon ALG_PREFIXFREE_TL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   845
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   846
lemma ALG_PREFIXFREE_MONO: "ALL (x::bool list) (y::bool list) z::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   847
   alg_sorted (x # y # z) & alg_prefixfree (x # y # z) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   848
   alg_prefixfree (x # z)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   849
  by (import prob_canon ALG_PREFIXFREE_MONO)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   850
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   851
lemma ALG_PREFIXFREE_ELT: "ALL (h::bool list) t::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   852
   alg_sorted (h # t) & alg_prefixfree (h # t) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   853
   (ALL x::bool list. x mem t --> ~ IS_PREFIX x h & ~ IS_PREFIX h x)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   854
  by (import prob_canon ALG_PREFIXFREE_ELT)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   855
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   856
lemma ALG_PREFIXFREE_TLS: "ALL (l::bool list list) b::bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   857
   alg_prefixfree (map (op # b) l) = alg_prefixfree l"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   858
  by (import prob_canon ALG_PREFIXFREE_TLS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   859
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   860
lemma ALG_PREFIXFREE_STEP: "ALL (l1::bool list list) l2::bool list list.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   861
   alg_prefixfree (map (op # True) l1 @ map (op # False) l2) =
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   862
   (alg_prefixfree l1 & alg_prefixfree l2)"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   863
  by (import prob_canon ALG_PREFIXFREE_STEP)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   864
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   865
lemma ALG_PREFIXFREE_APPEND: "ALL (h::bool list) (h'::bool list) (t::bool list list) t'::bool list list.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   866
   alg_prefixfree ((h # t) @ h' # t') =
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   867
   (alg_prefixfree (h # t) &
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   868
    alg_prefixfree (h' # t') & ~ IS_PREFIX h' (last (h # t)))"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   869
  by (import prob_canon ALG_PREFIXFREE_APPEND)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   870
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   871
lemma ALG_PREFIXFREE_FILTER: "ALL (P::bool list => bool) b::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   872
   alg_sorted b & alg_prefixfree b --> alg_prefixfree (filter P b)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   873
  by (import prob_canon ALG_PREFIXFREE_FILTER)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   874
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   875
lemma ALG_TWINFREE_TL: "ALL (h::bool list) t::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   876
   alg_twinfree (h # t) --> alg_twinfree t"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   877
  by (import prob_canon ALG_TWINFREE_TL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   878
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   879
lemma ALG_TWINFREE_TLS: "ALL (l::bool list list) b::bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   880
   alg_twinfree (map (op # b) l) = alg_twinfree l"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   881
  by (import prob_canon ALG_TWINFREE_TLS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   882
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   883
lemma ALG_TWINFREE_STEP1: "ALL (l1::bool list list) l2::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   884
   alg_twinfree (map (op # True) l1 @ map (op # False) l2) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   885
   alg_twinfree l1 & alg_twinfree l2"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   886
  by (import prob_canon ALG_TWINFREE_STEP1)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   887
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   888
lemma ALG_TWINFREE_STEP2: "ALL (l1::bool list list) l2::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   889
   (~ [] mem l1 | ~ [] mem l2) & alg_twinfree l1 & alg_twinfree l2 -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   890
   alg_twinfree (map (op # True) l1 @ map (op # False) l2)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   891
  by (import prob_canon ALG_TWINFREE_STEP2)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   892
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   893
lemma ALG_TWINFREE_STEP: "ALL (l1::bool list list) l2::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   894
   ~ [] mem l1 | ~ [] mem l2 -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   895
   alg_twinfree (map (op # True) l1 @ map (op # False) l2) =
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   896
   (alg_twinfree l1 & alg_twinfree l2)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   897
  by (import prob_canon ALG_TWINFREE_STEP)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   898
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   899
lemma ALG_LONGEST_HD: "ALL (h::bool list) t::bool list list. length h <= alg_longest (h # t)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   900
  by (import prob_canon ALG_LONGEST_HD)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   901
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   902
lemma ALG_LONGEST_TL: "ALL (h::bool list) t::bool list list. alg_longest t <= alg_longest (h # t)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   903
  by (import prob_canon ALG_LONGEST_TL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   904
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   905
lemma ALG_LONGEST_TLS: "ALL (h::bool list) (t::bool list list) b::bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   906
   alg_longest (map (op # b) (h # t)) = Suc (alg_longest (h # t))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   907
  by (import prob_canon ALG_LONGEST_TLS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   908
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   909
lemma ALG_LONGEST_APPEND: "ALL (l1::bool list list) l2::bool list list.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   910
   alg_longest l1 <= alg_longest (l1 @ l2) &
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   911
   alg_longest l2 <= alg_longest (l1 @ l2)"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   912
  by (import prob_canon ALG_LONGEST_APPEND)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   913
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   914
lemma ALG_CANON_PREFS_HD: "ALL (l::bool list) b::bool list list. hd (alg_canon_prefs l b) = l"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   915
  by (import prob_canon ALG_CANON_PREFS_HD)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   916
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   917
lemma ALG_CANON_PREFS_DELETES: "ALL (l::bool list) (b::bool list list) x::bool list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   918
   x mem alg_canon_prefs l b --> x mem l # b"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   919
  by (import prob_canon ALG_CANON_PREFS_DELETES)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   920
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   921
lemma ALG_CANON_PREFS_SORTED: "ALL (l::bool list) b::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   922
   alg_sorted (l # b) --> alg_sorted (alg_canon_prefs l b)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   923
  by (import prob_canon ALG_CANON_PREFS_SORTED)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   924
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   925
lemma ALG_CANON_PREFS_PREFIXFREE: "ALL (l::bool list) b::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   926
   alg_sorted b & alg_prefixfree b --> alg_prefixfree (alg_canon_prefs l b)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   927
  by (import prob_canon ALG_CANON_PREFS_PREFIXFREE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   928
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   929
lemma ALG_CANON_PREFS_CONSTANT: "ALL (l::bool list) b::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   930
   alg_prefixfree (l # b) --> alg_canon_prefs l b = l # b"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   931
  by (import prob_canon ALG_CANON_PREFS_CONSTANT)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   932
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   933
lemma ALG_CANON_FIND_HD: "ALL (l::bool list) (h::bool list) t::bool list list.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   934
   hd (alg_canon_find l (h # t)) = l | hd (alg_canon_find l (h # t)) = h"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   935
  by (import prob_canon ALG_CANON_FIND_HD)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   936
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   937
lemma ALG_CANON_FIND_DELETES: "ALL (l::bool list) (b::bool list list) x::bool list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   938
   x mem alg_canon_find l b --> x mem l # b"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   939
  by (import prob_canon ALG_CANON_FIND_DELETES)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   940
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   941
lemma ALG_CANON_FIND_SORTED: "ALL (l::bool list) b::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   942
   alg_sorted b --> alg_sorted (alg_canon_find l b)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   943
  by (import prob_canon ALG_CANON_FIND_SORTED)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   944
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   945
lemma ALG_CANON_FIND_PREFIXFREE: "ALL (l::bool list) b::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   946
   alg_sorted b & alg_prefixfree b --> alg_prefixfree (alg_canon_find l b)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   947
  by (import prob_canon ALG_CANON_FIND_PREFIXFREE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   948
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   949
lemma ALG_CANON_FIND_CONSTANT: "ALL (l::bool list) b::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   950
   alg_sorted (l # b) & alg_prefixfree (l # b) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   951
   alg_canon_find l b = l # b"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   952
  by (import prob_canon ALG_CANON_FIND_CONSTANT)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   953
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   954
lemma ALG_CANON1_SORTED: "ALL x::bool list list. alg_sorted (alg_canon1 x)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   955
  by (import prob_canon ALG_CANON1_SORTED)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   956
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
   957
lemma ALG_CANON1_PREFIXFREE: "ALL l::bool list list. alg_prefixfree (alg_canon1 l)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   958
  by (import prob_canon ALG_CANON1_PREFIXFREE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   959
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   960
lemma ALG_CANON1_CONSTANT: "ALL l::bool list list. alg_sorted l & alg_prefixfree l --> alg_canon1 l = l"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   961
  by (import prob_canon ALG_CANON1_CONSTANT)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   962
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   963
lemma ALG_CANON_MERGE_SORTED_PREFIXFREE_TWINFREE: "ALL (l::bool list) b::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   964
   alg_sorted (l # b) & alg_prefixfree (l # b) & alg_twinfree b -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   965
   alg_sorted (alg_canon_merge l b) &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   966
   alg_prefixfree (alg_canon_merge l b) & alg_twinfree (alg_canon_merge l b)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   967
  by (import prob_canon ALG_CANON_MERGE_SORTED_PREFIXFREE_TWINFREE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   968
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   969
lemma ALG_CANON_MERGE_PREFIXFREE_PRESERVE: "ALL (l::bool list) (b::bool list list) h::bool list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   970
   (ALL x::bool list. x mem l # b --> ~ IS_PREFIX h x & ~ IS_PREFIX x h) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   971
   (ALL x::bool list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   972
       x mem alg_canon_merge l b --> ~ IS_PREFIX h x & ~ IS_PREFIX x h)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   973
  by (import prob_canon ALG_CANON_MERGE_PREFIXFREE_PRESERVE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   974
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   975
lemma ALG_CANON_MERGE_SHORTENS: "ALL (l::bool list) (b::bool list list) x::bool list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   976
   x mem alg_canon_merge l b -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   977
   (EX y::bool list. y mem l # b & IS_PREFIX y x)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   978
  by (import prob_canon ALG_CANON_MERGE_SHORTENS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   979
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   980
lemma ALG_CANON_MERGE_CONSTANT: "ALL (l::bool list) b::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   981
   alg_twinfree (l # b) --> alg_canon_merge l b = l # b"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   982
  by (import prob_canon ALG_CANON_MERGE_CONSTANT)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   983
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   984
lemma ALG_CANON2_PREFIXFREE_PRESERVE: "ALL (x::bool list list) xa::bool list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   985
   (ALL xb::bool list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   986
       xb mem x --> ~ IS_PREFIX xa xb & ~ IS_PREFIX xb xa) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   987
   (ALL xb::bool list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   988
       xb mem alg_canon2 x --> ~ IS_PREFIX xa xb & ~ IS_PREFIX xb xa)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   989
  by (import prob_canon ALG_CANON2_PREFIXFREE_PRESERVE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   990
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   991
lemma ALG_CANON2_SHORTENS: "ALL (x::bool list list) xa::bool list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   992
   xa mem alg_canon2 x --> (EX y::bool list. y mem x & IS_PREFIX y xa)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   993
  by (import prob_canon ALG_CANON2_SHORTENS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   994
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   995
lemma ALG_CANON2_SORTED_PREFIXFREE_TWINFREE: "ALL x::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   996
   alg_sorted x & alg_prefixfree x -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   997
   alg_sorted (alg_canon2 x) &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
   998
   alg_prefixfree (alg_canon2 x) & alg_twinfree (alg_canon2 x)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
   999
  by (import prob_canon ALG_CANON2_SORTED_PREFIXFREE_TWINFREE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1000
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1001
lemma ALG_CANON2_CONSTANT: "ALL l::bool list list. alg_twinfree l --> alg_canon2 l = l"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1002
  by (import prob_canon ALG_CANON2_CONSTANT)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1003
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1004
lemma ALG_CANON_SORTED_PREFIXFREE_TWINFREE: "ALL l::bool list list.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1005
   alg_sorted (alg_canon l) &
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1006
   alg_prefixfree (alg_canon l) & alg_twinfree (alg_canon l)"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1007
  by (import prob_canon ALG_CANON_SORTED_PREFIXFREE_TWINFREE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1008
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1009
lemma ALG_CANON_CONSTANT: "ALL l::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1010
   alg_sorted l & alg_prefixfree l & alg_twinfree l --> alg_canon l = l"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1011
  by (import prob_canon ALG_CANON_CONSTANT)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1012
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1013
lemma ALG_CANON_IDEMPOT: "ALL l::bool list list. alg_canon (alg_canon l) = alg_canon l"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1014
  by (import prob_canon ALG_CANON_IDEMPOT)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1015
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1016
lemma ALGEBRA_CANON_DEF_ALT: "ALL l::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1017
   algebra_canon l = (alg_sorted l & alg_prefixfree l & alg_twinfree l)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1018
  by (import prob_canon ALGEBRA_CANON_DEF_ALT)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1019
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1020
lemma ALGEBRA_CANON_BASIC: "algebra_canon [] &
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1021
algebra_canon [[]] & (ALL x::bool list. algebra_canon [x])"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1022
  by (import prob_canon ALGEBRA_CANON_BASIC)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1023
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1024
lemma ALG_CANON_BASIC: "alg_canon [] = [] &
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1025
alg_canon [[]] = [[]] & (ALL x::bool list. alg_canon [x] = [x])"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1026
  by (import prob_canon ALG_CANON_BASIC)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1027
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1028
lemma ALGEBRA_CANON_TL: "ALL (h::bool list) t::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1029
   algebra_canon (h # t) --> algebra_canon t"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1030
  by (import prob_canon ALGEBRA_CANON_TL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1031
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1032
lemma ALGEBRA_CANON_NIL_MEM: "ALL l::bool list list. (algebra_canon l & [] mem l) = (l = [[]])"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1033
  by (import prob_canon ALGEBRA_CANON_NIL_MEM)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1034
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1035
lemma ALGEBRA_CANON_TLS: "ALL (l::bool list list) b::bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1036
   algebra_canon (map (op # b) l) = algebra_canon l"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1037
  by (import prob_canon ALGEBRA_CANON_TLS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1038
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1039
lemma ALGEBRA_CANON_STEP1: "ALL (l1::bool list list) l2::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1040
   algebra_canon (map (op # True) l1 @ map (op # False) l2) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1041
   algebra_canon l1 & algebra_canon l2"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1042
  by (import prob_canon ALGEBRA_CANON_STEP1)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1043
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1044
lemma ALGEBRA_CANON_STEP2: "ALL (l1::bool list list) l2::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1045
   (l1 ~= [[]] | l2 ~= [[]]) & algebra_canon l1 & algebra_canon l2 -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1046
   algebra_canon (map (op # True) l1 @ map (op # False) l2)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1047
  by (import prob_canon ALGEBRA_CANON_STEP2)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1048
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1049
lemma ALGEBRA_CANON_STEP: "ALL (l1::bool list list) l2::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1050
   l1 ~= [[]] | l2 ~= [[]] -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1051
   algebra_canon (map (op # True) l1 @ map (op # False) l2) =
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1052
   (algebra_canon l1 & algebra_canon l2)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1053
  by (import prob_canon ALGEBRA_CANON_STEP)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1054
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1055
lemma ALGEBRA_CANON_CASES_THM: "ALL l::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1056
   algebra_canon l -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1057
   l = [] |
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1058
   l = [[]] |
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1059
   (EX (l1::bool list list) l2::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1060
       algebra_canon l1 &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1061
       algebra_canon l2 & l = map (op # True) l1 @ map (op # False) l2)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1062
  by (import prob_canon ALGEBRA_CANON_CASES_THM)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1063
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1064
lemma ALGEBRA_CANON_CASES: "ALL P::bool list list => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1065
   P [] &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1066
   P [[]] &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1067
   (ALL (l1::bool list list) l2::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1068
       algebra_canon l1 &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1069
       algebra_canon l2 &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1070
       algebra_canon (map (op # True) l1 @ map (op # False) l2) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1071
       P (map (op # True) l1 @ map (op # False) l2)) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1072
   (ALL l::bool list list. algebra_canon l --> P l)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1073
  by (import prob_canon ALGEBRA_CANON_CASES)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1074
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1075
lemma ALGEBRA_CANON_INDUCTION: "ALL P::bool list list => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1076
   P [] &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1077
   P [[]] &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1078
   (ALL (l1::bool list list) l2::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1079
       algebra_canon l1 &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1080
       algebra_canon l2 &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1081
       P l1 &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1082
       P l2 & algebra_canon (map (op # True) l1 @ map (op # False) l2) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1083
       P (map (op # True) l1 @ map (op # False) l2)) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1084
   (ALL l::bool list list. algebra_canon l --> P l)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1085
  by (import prob_canon ALGEBRA_CANON_INDUCTION)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1086
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1087
lemma MEM_NIL_STEP: "ALL (l1::bool list list) l2::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1088
   ~ [] mem map (op # True) l1 @ map (op # False) l2"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1089
  by (import prob_canon MEM_NIL_STEP)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1090
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1091
lemma ALG_SORTED_PREFIXFREE_MEM_NIL: "ALL l::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1092
   (alg_sorted l & alg_prefixfree l & [] mem l) = (l = [[]])"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1093
  by (import prob_canon ALG_SORTED_PREFIXFREE_MEM_NIL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1094
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1095
lemma ALG_SORTED_PREFIXFREE_EQUALITY: "ALL (l::bool list list) l'::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1096
   (ALL x::bool list. x mem l = x mem l') &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1097
   alg_sorted l & alg_sorted l' & alg_prefixfree l & alg_prefixfree l' -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1098
   l = l'"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1099
  by (import prob_canon ALG_SORTED_PREFIXFREE_EQUALITY)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1100
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1101
;end_setup
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1102
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1103
;setup_theory boolean_sequence
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1104
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1105
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1106
  SHD :: "(nat => bool) => bool" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1107
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1108
defs
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1109
  SHD_primdef: "SHD == %f::nat => bool. f 0"
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1110
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1111
lemma SHD_def: "ALL f::nat => bool. SHD f = f 0"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1112
  by (import boolean_sequence SHD_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1113
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1114
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1115
  STL :: "(nat => bool) => nat => bool" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1116
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1117
defs
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1118
  STL_primdef: "STL == %(f::nat => bool) n::nat. f (Suc n)"
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1119
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1120
lemma STL_def: "ALL (f::nat => bool) n::nat. STL f n = f (Suc n)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1121
  by (import boolean_sequence STL_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1122
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1123
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1124
  SCONS :: "bool => (nat => bool) => nat => bool" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1125
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1126
specification (SCONS_primdef: SCONS) SCONS_def: "(ALL (h::bool) t::nat => bool. SCONS h t 0 = h) &
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1127
(ALL (h::bool) (t::nat => bool) n::nat. SCONS h t (Suc n) = t n)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1128
  by (import boolean_sequence SCONS_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1129
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1130
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1131
  SDEST :: "(nat => bool) => bool * (nat => bool)" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1132
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1133
defs
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1134
  SDEST_primdef: "SDEST == %s::nat => bool. (SHD s, STL s)"
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1135
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1136
lemma SDEST_def: "SDEST = (%s::nat => bool. (SHD s, STL s))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1137
  by (import boolean_sequence SDEST_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1138
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1139
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1140
  SCONST :: "bool => nat => bool" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1141
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1142
defs
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1143
  SCONST_primdef: "SCONST == K"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1144
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1145
lemma SCONST_def: "SCONST = K"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1146
  by (import boolean_sequence SCONST_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1147
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1148
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1149
  STAKE :: "nat => (nat => bool) => bool list" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1150
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1151
specification (STAKE_primdef: STAKE) STAKE_def: "(ALL s::nat => bool. STAKE 0 s = []) &
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1152
(ALL (n::nat) s::nat => bool. STAKE (Suc n) s = SHD s # STAKE n (STL s))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1153
  by (import boolean_sequence STAKE_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1154
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1155
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1156
  SDROP :: "nat => (nat => bool) => nat => bool" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1157
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1158
specification (SDROP_primdef: SDROP) SDROP_def: "SDROP 0 = I & (ALL n::nat. SDROP (Suc n) = SDROP n o STL)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1159
  by (import boolean_sequence SDROP_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1160
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1161
lemma SCONS_SURJ: "ALL x::nat => bool. EX (xa::bool) t::nat => bool. x = SCONS xa t"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1162
  by (import boolean_sequence SCONS_SURJ)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1163
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1164
lemma SHD_STL_ISO: "ALL (h::bool) t::nat => bool. EX x::nat => bool. SHD x = h & STL x = t"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1165
  by (import boolean_sequence SHD_STL_ISO)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1166
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1167
lemma SHD_SCONS: "ALL (h::bool) t::nat => bool. SHD (SCONS h t) = h"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1168
  by (import boolean_sequence SHD_SCONS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1169
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1170
lemma STL_SCONS: "ALL (h::bool) t::nat => bool. STL (SCONS h t) = t"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1171
  by (import boolean_sequence STL_SCONS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1172
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1173
lemma SHD_SCONST: "ALL b::bool. SHD (SCONST b) = b"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1174
  by (import boolean_sequence SHD_SCONST)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1175
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1176
lemma STL_SCONST: "ALL b::bool. STL (SCONST b) = SCONST b"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1177
  by (import boolean_sequence STL_SCONST)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1178
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1179
;end_setup
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1180
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1181
;setup_theory prob_algebra
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1182
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1183
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1184
  alg_embed :: "bool list => (nat => bool) => bool" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1185
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1186
specification (alg_embed_primdef: alg_embed) alg_embed_def: "(ALL s::nat => bool. alg_embed [] s = True) &
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1187
(ALL (h::bool) (t::bool list) s::nat => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1188
    alg_embed (h # t) s = (h = SHD s & alg_embed t (STL s)))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1189
  by (import prob_algebra alg_embed_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1190
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1191
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1192
  algebra_embed :: "bool list list => (nat => bool) => bool" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1193
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1194
specification (algebra_embed_primdef: algebra_embed) algebra_embed_def: "algebra_embed [] = EMPTY &
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1195
(ALL (h::bool list) t::bool list list.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1196
    algebra_embed (h # t) = pred_set.UNION (alg_embed h) (algebra_embed t))"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1197
  by (import prob_algebra algebra_embed_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1198
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1199
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1200
  measurable :: "((nat => bool) => bool) => bool" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1201
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1202
defs
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1203
  measurable_primdef: "measurable ==
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1204
%s::(nat => bool) => bool. EX b::bool list list. s = algebra_embed b"
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1205
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1206
lemma measurable_def: "ALL s::(nat => bool) => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1207
   measurable s = (EX b::bool list list. s = algebra_embed b)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1208
  by (import prob_algebra measurable_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1209
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1210
lemma HALVES_INTER: "pred_set.INTER (%x::nat => bool. SHD x = True)
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1211
 (%x::nat => bool. SHD x = False) =
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1212
EMPTY"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1213
  by (import prob_algebra HALVES_INTER)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1214
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1215
lemma INTER_STL: "ALL (p::(nat => bool) => bool) q::(nat => bool) => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1216
   pred_set.INTER p q o STL = pred_set.INTER (p o STL) (q o STL)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1217
  by (import prob_algebra INTER_STL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1218
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1219
lemma COMPL_SHD: "ALL b::bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1220
   COMPL (%x::nat => bool. SHD x = b) = (%x::nat => bool. SHD x = (~ b))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1221
  by (import prob_algebra COMPL_SHD)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1222
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1223
lemma ALG_EMBED_BASIC: "alg_embed [] = pred_set.UNIV &
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1224
(ALL (h::bool) t::bool list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1225
    alg_embed (h # t) =
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1226
    pred_set.INTER (%x::nat => bool. SHD x = h) (alg_embed t o STL))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1227
  by (import prob_algebra ALG_EMBED_BASIC)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1228
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1229
lemma ALG_EMBED_NIL: "ALL c::bool list. All (alg_embed c) = (c = [])"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1230
  by (import prob_algebra ALG_EMBED_NIL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1231
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1232
lemma ALG_EMBED_POPULATED: "ALL b::bool list. Ex (alg_embed b)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1233
  by (import prob_algebra ALG_EMBED_POPULATED)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1234
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1235
lemma ALG_EMBED_PREFIX: "ALL (b::bool list) (c::bool list) s::nat => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1236
   alg_embed b s & alg_embed c s --> IS_PREFIX b c | IS_PREFIX c b"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1237
  by (import prob_algebra ALG_EMBED_PREFIX)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1238
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1239
lemma ALG_EMBED_PREFIX_SUBSET: "ALL (b::bool list) c::bool list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1240
   SUBSET (alg_embed b) (alg_embed c) = IS_PREFIX b c"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1241
  by (import prob_algebra ALG_EMBED_PREFIX_SUBSET)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1242
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1243
lemma ALG_EMBED_TWINS: "ALL l::bool list.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1244
   pred_set.UNION (alg_embed (SNOC True l)) (alg_embed (SNOC False l)) =
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1245
   alg_embed l"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1246
  by (import prob_algebra ALG_EMBED_TWINS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1247
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1248
lemma ALGEBRA_EMBED_BASIC: "algebra_embed [] = EMPTY &
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1249
algebra_embed [[]] = pred_set.UNIV &
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1250
(ALL b::bool. algebra_embed [[b]] = (%s::nat => bool. SHD s = b))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1251
  by (import prob_algebra ALGEBRA_EMBED_BASIC)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1252
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1253
lemma ALGEBRA_EMBED_MEM: "ALL (b::bool list list) x::nat => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1254
   algebra_embed b x --> (EX l::bool list. l mem b & alg_embed l x)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1255
  by (import prob_algebra ALGEBRA_EMBED_MEM)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1256
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1257
lemma ALGEBRA_EMBED_APPEND: "ALL (l1::bool list list) l2::bool list list.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1258
   algebra_embed (l1 @ l2) =
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1259
   pred_set.UNION (algebra_embed l1) (algebra_embed l2)"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1260
  by (import prob_algebra ALGEBRA_EMBED_APPEND)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1261
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1262
lemma ALGEBRA_EMBED_TLS: "ALL (l::bool list list) b::bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1263
   algebra_embed (map (op # b) l) (SCONS (h::bool) (t::nat => bool)) =
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1264
   (h = b & algebra_embed l t)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1265
  by (import prob_algebra ALGEBRA_EMBED_TLS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1266
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1267
lemma ALG_CANON_PREFS_EMBED: "ALL (l::bool list) b::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1268
   algebra_embed (alg_canon_prefs l b) = algebra_embed (l # b)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1269
  by (import prob_algebra ALG_CANON_PREFS_EMBED)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1270
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1271
lemma ALG_CANON_FIND_EMBED: "ALL (l::bool list) b::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1272
   algebra_embed (alg_canon_find l b) = algebra_embed (l # b)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1273
  by (import prob_algebra ALG_CANON_FIND_EMBED)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1274
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1275
lemma ALG_CANON1_EMBED: "ALL x::bool list list. algebra_embed (alg_canon1 x) = algebra_embed x"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1276
  by (import prob_algebra ALG_CANON1_EMBED)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1277
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1278
lemma ALG_CANON_MERGE_EMBED: "ALL (l::bool list) b::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1279
   algebra_embed (alg_canon_merge l b) = algebra_embed (l # b)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1280
  by (import prob_algebra ALG_CANON_MERGE_EMBED)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1281
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1282
lemma ALG_CANON2_EMBED: "ALL x::bool list list. algebra_embed (alg_canon2 x) = algebra_embed x"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1283
  by (import prob_algebra ALG_CANON2_EMBED)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1284
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1285
lemma ALG_CANON_EMBED: "ALL l::bool list list. algebra_embed (alg_canon l) = algebra_embed l"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1286
  by (import prob_algebra ALG_CANON_EMBED)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1287
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1288
lemma ALGEBRA_CANON_UNIV: "ALL l::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1289
   algebra_canon l --> algebra_embed l = pred_set.UNIV --> l = [[]]"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1290
  by (import prob_algebra ALGEBRA_CANON_UNIV)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1291
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1292
lemma ALG_CANON_REP: "ALL (b::bool list list) c::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1293
   (alg_canon b = alg_canon c) = (algebra_embed b = algebra_embed c)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1294
  by (import prob_algebra ALG_CANON_REP)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1295
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1296
lemma ALGEBRA_CANON_EMBED_EMPTY: "ALL l::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1297
   algebra_canon l --> (ALL v::nat => bool. ~ algebra_embed l v) = (l = [])"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1298
  by (import prob_algebra ALGEBRA_CANON_EMBED_EMPTY)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1299
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1300
lemma ALGEBRA_CANON_EMBED_UNIV: "ALL l::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1301
   algebra_canon l --> All (algebra_embed l) = (l = [[]])"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1302
  by (import prob_algebra ALGEBRA_CANON_EMBED_UNIV)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1303
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1304
lemma MEASURABLE_ALGEBRA: "ALL b::bool list list. measurable (algebra_embed b)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1305
  by (import prob_algebra MEASURABLE_ALGEBRA)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1306
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1307
lemma MEASURABLE_BASIC: "measurable EMPTY &
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1308
measurable pred_set.UNIV &
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1309
(ALL b::bool. measurable (%s::nat => bool. SHD s = b))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1310
  by (import prob_algebra MEASURABLE_BASIC)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1311
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1312
lemma MEASURABLE_SHD: "ALL b::bool. measurable (%s::nat => bool. SHD s = b)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1313
  by (import prob_algebra MEASURABLE_SHD)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1314
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1315
lemma ALGEBRA_EMBED_COMPL: "ALL l::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1316
   EX l'::bool list list. COMPL (algebra_embed l) = algebra_embed l'"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1317
  by (import prob_algebra ALGEBRA_EMBED_COMPL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1318
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1319
lemma MEASURABLE_COMPL: "ALL s::(nat => bool) => bool. measurable (COMPL s) = measurable s"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1320
  by (import prob_algebra MEASURABLE_COMPL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1321
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1322
lemma MEASURABLE_UNION: "ALL (s::(nat => bool) => bool) t::(nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1323
   measurable s & measurable t --> measurable (pred_set.UNION s t)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1324
  by (import prob_algebra MEASURABLE_UNION)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1325
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1326
lemma MEASURABLE_INTER: "ALL (s::(nat => bool) => bool) t::(nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1327
   measurable s & measurable t --> measurable (pred_set.INTER s t)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1328
  by (import prob_algebra MEASURABLE_INTER)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1329
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1330
lemma MEASURABLE_STL: "ALL p::(nat => bool) => bool. measurable (p o STL) = measurable p"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1331
  by (import prob_algebra MEASURABLE_STL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1332
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1333
lemma MEASURABLE_SDROP: "ALL (n::nat) p::(nat => bool) => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1334
   measurable (p o SDROP n) = measurable p"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1335
  by (import prob_algebra MEASURABLE_SDROP)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1336
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1337
lemma MEASURABLE_INTER_HALVES: "ALL p::(nat => bool) => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1338
   (measurable (pred_set.INTER (%x::nat => bool. SHD x = True) p) &
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1339
    measurable (pred_set.INTER (%x::nat => bool. SHD x = False) p)) =
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1340
   measurable p"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1341
  by (import prob_algebra MEASURABLE_INTER_HALVES)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1342
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1343
lemma MEASURABLE_HALVES: "ALL (p::(nat => bool) => bool) q::(nat => bool) => bool.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1344
   measurable
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1345
    (pred_set.UNION (pred_set.INTER (%x::nat => bool. SHD x = True) p)
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1346
      (pred_set.INTER (%x::nat => bool. SHD x = False) q)) =
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1347
   (measurable (pred_set.INTER (%x::nat => bool. SHD x = True) p) &
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1348
    measurable (pred_set.INTER (%x::nat => bool. SHD x = False) q))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1349
  by (import prob_algebra MEASURABLE_HALVES)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1350
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1351
lemma MEASURABLE_INTER_SHD: "ALL (b::bool) p::(nat => bool) => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1352
   measurable (pred_set.INTER (%x::nat => bool. SHD x = b) (p o STL)) =
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1353
   measurable p"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1354
  by (import prob_algebra MEASURABLE_INTER_SHD)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1355
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1356
;end_setup
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1357
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1358
;setup_theory prob
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1359
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1360
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1361
  alg_measure :: "bool list list => real" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1362
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1363
specification (alg_measure_primdef: alg_measure) alg_measure_def: "alg_measure [] = 0 &
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1364
(ALL (l::bool list) rest::bool list list.
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1365
    alg_measure (l # rest) = (1 / 2) ^ length l + alg_measure rest)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1366
  by (import prob alg_measure_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1367
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1368
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1369
  algebra_measure :: "bool list list => real" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1370
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1371
defs
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1372
  algebra_measure_primdef: "algebra_measure ==
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1373
%b::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1374
   inf (%r::real.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1375
           EX c::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1376
              algebra_embed b = algebra_embed c & alg_measure c = r)"
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1377
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1378
lemma algebra_measure_def: "ALL b::bool list list.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1379
   algebra_measure b =
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1380
   inf (%r::real.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1381
           EX c::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1382
              algebra_embed b = algebra_embed c & alg_measure c = r)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1383
  by (import prob algebra_measure_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1384
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1385
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1386
  prob :: "((nat => bool) => bool) => real" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1387
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1388
defs
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1389
  prob_primdef: "prob ==
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1390
%s::(nat => bool) => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1391
   sup (%r::real.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1392
           EX b::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1393
              algebra_measure b = r & SUBSET (algebra_embed b) s)"
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1394
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1395
lemma prob_def: "ALL s::(nat => bool) => bool.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1396
   prob s =
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1397
   sup (%r::real.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1398
           EX b::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1399
              algebra_measure b = r & SUBSET (algebra_embed b) s)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1400
  by (import prob prob_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1401
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1402
lemma ALG_TWINS_MEASURE: "(All::(bool list => bool) => bool)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1403
 (%l::bool list.
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1404
     (op =::real => real => bool)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1405
      ((op +::real => real => real)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1406
        ((op ^::real => nat => real)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1407
          ((op /::real => real => real) (1::real)
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
  1408
            ((number_of \<Colon> int => real)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
  1409
              ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
  1410
                ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int)
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1411
                  (bit.B1::bit))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1412
                (bit.B0::bit))))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1413
          ((size::bool list => nat)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1414
            ((SNOC::bool => bool list => bool list) (True::bool) l)))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1415
        ((op ^::real => nat => real)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1416
          ((op /::real => real => real) (1::real)
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
  1417
            ((number_of \<Colon> int => real)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
  1418
              ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
  1419
                ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int)
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1420
                  (bit.B1::bit))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1421
                (bit.B0::bit))))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1422
          ((size::bool list => nat)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1423
            ((SNOC::bool => bool list => bool list) (False::bool) l))))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1424
      ((op ^::real => nat => real)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1425
        ((op /::real => real => real) (1::real)
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
  1426
          ((number_of \<Colon> int => real)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
  1427
            ((op BIT \<Colon> int => bit => int)
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 17694
diff changeset
  1428
              ((op BIT \<Colon> int => bit => int) (Numeral.Pls \<Colon> int) (bit.B1::bit))
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1429
              (bit.B0::bit))))
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1430
        ((size::bool list => nat) l)))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1431
  by (import prob ALG_TWINS_MEASURE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1432
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1433
lemma ALG_MEASURE_BASIC: "alg_measure [] = 0 &
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1434
alg_measure [[]] = 1 & (ALL b::bool. alg_measure [[b]] = 1 / 2)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1435
  by (import prob ALG_MEASURE_BASIC)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1436
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1437
lemma ALG_MEASURE_POS: "ALL l::bool list list. 0 <= alg_measure l"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1438
  by (import prob ALG_MEASURE_POS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1439
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1440
lemma ALG_MEASURE_APPEND: "ALL (l1::bool list list) l2::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1441
   alg_measure (l1 @ l2) = alg_measure l1 + alg_measure l2"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1442
  by (import prob ALG_MEASURE_APPEND)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1443
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1444
lemma ALG_MEASURE_TLS: "ALL (l::bool list list) b::bool.
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1445
   2 * alg_measure (map (op # b) l) = alg_measure l"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1446
  by (import prob ALG_MEASURE_TLS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1447
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1448
lemma ALG_CANON_PREFS_MONO: "ALL (l::bool list) b::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1449
   alg_measure (alg_canon_prefs l b) <= alg_measure (l # b)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1450
  by (import prob ALG_CANON_PREFS_MONO)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1451
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1452
lemma ALG_CANON_FIND_MONO: "ALL (l::bool list) b::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1453
   alg_measure (alg_canon_find l b) <= alg_measure (l # b)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1454
  by (import prob ALG_CANON_FIND_MONO)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1455
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1456
lemma ALG_CANON1_MONO: "ALL x::bool list list. alg_measure (alg_canon1 x) <= alg_measure x"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1457
  by (import prob ALG_CANON1_MONO)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1458
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1459
lemma ALG_CANON_MERGE_MONO: "ALL (l::bool list) b::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1460
   alg_measure (alg_canon_merge l b) <= alg_measure (l # b)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1461
  by (import prob ALG_CANON_MERGE_MONO)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1462
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1463
lemma ALG_CANON2_MONO: "ALL x::bool list list. alg_measure (alg_canon2 x) <= alg_measure x"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1464
  by (import prob ALG_CANON2_MONO)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1465
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1466
lemma ALG_CANON_MONO: "ALL l::bool list list. alg_measure (alg_canon l) <= alg_measure l"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1467
  by (import prob ALG_CANON_MONO)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1468
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1469
lemma ALGEBRA_MEASURE_DEF_ALT: "ALL l::bool list list. algebra_measure l = alg_measure (alg_canon l)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1470
  by (import prob ALGEBRA_MEASURE_DEF_ALT)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1471
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1472
lemma ALGEBRA_MEASURE_BASIC: "algebra_measure [] = 0 &
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1473
algebra_measure [[]] = 1 & (ALL b::bool. algebra_measure [[b]] = 1 / 2)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1474
  by (import prob ALGEBRA_MEASURE_BASIC)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1475
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1476
lemma ALGEBRA_CANON_MEASURE_MAX: "ALL l::bool list list. algebra_canon l --> alg_measure l <= 1"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1477
  by (import prob ALGEBRA_CANON_MEASURE_MAX)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1478
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1479
lemma ALGEBRA_MEASURE_MAX: "ALL l::bool list list. algebra_measure l <= 1"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1480
  by (import prob ALGEBRA_MEASURE_MAX)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1481
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1482
lemma ALGEBRA_MEASURE_MONO_EMBED: "ALL (x::bool list list) xa::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1483
   SUBSET (algebra_embed x) (algebra_embed xa) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1484
   algebra_measure x <= algebra_measure xa"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1485
  by (import prob ALGEBRA_MEASURE_MONO_EMBED)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1486
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1487
lemma ALG_MEASURE_COMPL: "ALL l::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1488
   algebra_canon l -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1489
   (ALL c::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1490
       algebra_canon c -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1491
       COMPL (algebra_embed l) = algebra_embed c -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1492
       alg_measure l + alg_measure c = 1)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1493
  by (import prob ALG_MEASURE_COMPL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1494
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1495
lemma ALG_MEASURE_ADDITIVE: "ALL l::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1496
   algebra_canon l -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1497
   (ALL c::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1498
       algebra_canon c -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1499
       (ALL d::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1500
           algebra_canon d -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1501
           pred_set.INTER (algebra_embed c) (algebra_embed d) = EMPTY &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1502
           algebra_embed l =
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1503
           pred_set.UNION (algebra_embed c) (algebra_embed d) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1504
           alg_measure l = alg_measure c + alg_measure d))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1505
  by (import prob ALG_MEASURE_ADDITIVE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1506
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1507
lemma PROB_ALGEBRA: "ALL l::bool list list. prob (algebra_embed l) = algebra_measure l"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1508
  by (import prob PROB_ALGEBRA)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1509
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1510
lemma PROB_BASIC: "prob EMPTY = 0 &
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1511
prob pred_set.UNIV = 1 &
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1512
(ALL b::bool. prob (%s::nat => bool. SHD s = b) = 1 / 2)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1513
  by (import prob PROB_BASIC)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1514
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1515
lemma PROB_ADDITIVE: "ALL (s::(nat => bool) => bool) t::(nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1516
   measurable s & measurable t & pred_set.INTER s t = EMPTY -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1517
   prob (pred_set.UNION s t) = prob s + prob t"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1518
  by (import prob PROB_ADDITIVE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1519
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1520
lemma PROB_COMPL: "ALL s::(nat => bool) => bool. measurable s --> prob (COMPL s) = 1 - prob s"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1521
  by (import prob PROB_COMPL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1522
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1523
lemma PROB_SUP_EXISTS1: "ALL s::(nat => bool) => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1524
   EX (x::real) b::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1525
      algebra_measure b = x & SUBSET (algebra_embed b) s"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1526
  by (import prob PROB_SUP_EXISTS1)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1527
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1528
lemma PROB_SUP_EXISTS2: "ALL s::(nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1529
   EX x::real.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1530
      ALL r::real.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1531
         (EX b::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1532
             algebra_measure b = r & SUBSET (algebra_embed b) s) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1533
         r <= x"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1534
  by (import prob PROB_SUP_EXISTS2)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1535
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1536
lemma PROB_LE_X: "ALL (s::(nat => bool) => bool) x::real.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1537
   (ALL s'::(nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1538
       measurable s' & SUBSET s' s --> prob s' <= x) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1539
   prob s <= x"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1540
  by (import prob PROB_LE_X)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1541
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1542
lemma X_LE_PROB: "ALL (s::(nat => bool) => bool) x::real.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1543
   (EX s'::(nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1544
       measurable s' & SUBSET s' s & x <= prob s') -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1545
   x <= prob s"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1546
  by (import prob X_LE_PROB)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1547
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1548
lemma PROB_SUBSET_MONO: "ALL (s::(nat => bool) => bool) t::(nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1549
   SUBSET s t --> prob s <= prob t"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1550
  by (import prob PROB_SUBSET_MONO)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1551
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1552
lemma PROB_ALG: "ALL x::bool list. prob (alg_embed x) = (1 / 2) ^ length x"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1553
  by (import prob PROB_ALG)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1554
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1555
lemma PROB_STL: "ALL p::(nat => bool) => bool. measurable p --> prob (p o STL) = prob p"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1556
  by (import prob PROB_STL)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1557
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1558
lemma PROB_SDROP: "ALL (n::nat) p::(nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1559
   measurable p --> prob (p o SDROP n) = prob p"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1560
  by (import prob PROB_SDROP)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1561
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1562
lemma PROB_INTER_HALVES: "ALL p::(nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1563
   measurable p -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1564
   prob (pred_set.INTER (%x::nat => bool. SHD x = True) p) +
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1565
   prob (pred_set.INTER (%x::nat => bool. SHD x = False) p) =
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1566
   prob p"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1567
  by (import prob PROB_INTER_HALVES)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1568
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1569
lemma PROB_INTER_SHD: "ALL (b::bool) p::(nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1570
   measurable p -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1571
   prob (pred_set.INTER (%x::nat => bool. SHD x = b) (p o STL)) =
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1572
   1 / 2 * prob p"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1573
  by (import prob PROB_INTER_SHD)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1574
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1575
lemma ALGEBRA_MEASURE_POS: "ALL l::bool list list. 0 <= algebra_measure l"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1576
  by (import prob ALGEBRA_MEASURE_POS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1577
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1578
lemma ALGEBRA_MEASURE_RANGE: "ALL l::bool list list. 0 <= algebra_measure l & algebra_measure l <= 1"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1579
  by (import prob ALGEBRA_MEASURE_RANGE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1580
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1581
lemma PROB_POS: "ALL p::(nat => bool) => bool. 0 <= prob p"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1582
  by (import prob PROB_POS)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1583
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1584
lemma PROB_MAX: "ALL p::(nat => bool) => bool. prob p <= 1"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1585
  by (import prob PROB_MAX)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1586
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1587
lemma PROB_RANGE: "ALL p::(nat => bool) => bool. 0 <= prob p & prob p <= 1"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1588
  by (import prob PROB_RANGE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1589
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1590
lemma ABS_PROB: "ALL p::(nat => bool) => bool. abs (prob p) = prob p"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1591
  by (import prob ABS_PROB)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1592
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1593
lemma PROB_SHD: "ALL b::bool. prob (%s::nat => bool. SHD s = b) = 1 / 2"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1594
  by (import prob PROB_SHD)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1595
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1596
lemma PROB_COMPL_LE1: "ALL (p::(nat => bool) => bool) r::real.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1597
   measurable p --> (prob (COMPL p) <= r) = (1 - r <= prob p)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1598
  by (import prob PROB_COMPL_LE1)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1599
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1600
;end_setup
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1601
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1602
;setup_theory prob_pseudo
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1603
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1604
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1605
  pseudo_linear_hd :: "nat => bool" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1606
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1607
defs
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1608
  pseudo_linear_hd_primdef: "pseudo_linear_hd == EVEN"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1609
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1610
lemma pseudo_linear_hd_def: "pseudo_linear_hd = EVEN"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1611
  by (import prob_pseudo pseudo_linear_hd_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1612
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1613
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1614
  pseudo_linear_tl :: "nat => nat => nat => nat => nat" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1615
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1616
defs
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1617
  pseudo_linear_tl_primdef: "pseudo_linear_tl ==
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1618
%(a::nat) (b::nat) (n::nat) x::nat. (a * x + b) mod (2 * n + 1)"
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1619
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1620
lemma pseudo_linear_tl_def: "ALL (a::nat) (b::nat) (n::nat) x::nat.
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1621
   pseudo_linear_tl a b n x = (a * x + b) mod (2 * n + 1)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1622
  by (import prob_pseudo pseudo_linear_tl_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1623
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1624
lemma PSEUDO_LINEAR1_EXECUTE: "EX x::nat => nat => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1625
   (ALL xa::nat. SHD (x xa) = pseudo_linear_hd xa) &
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1626
   (ALL xa::nat.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1627
       STL (x xa) =
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1628
       x (pseudo_linear_tl
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1629
           (NUMERAL
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1630
             (NUMERAL_BIT1
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1631
               (NUMERAL_BIT1
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1632
                 (NUMERAL_BIT1
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1633
                   (NUMERAL_BIT2 (NUMERAL_BIT1 (NUMERAL_BIT2 ALT_ZERO)))))))
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1634
           (NUMERAL
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1635
             (NUMERAL_BIT1
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1636
               (NUMERAL_BIT1
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1637
                 (NUMERAL_BIT1
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1638
                   (NUMERAL_BIT1 (NUMERAL_BIT1 (NUMERAL_BIT2 ALT_ZERO)))))))
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1639
           (NUMERAL
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1640
             (NUMERAL_BIT1
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1641
               (NUMERAL_BIT1
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1642
                 (NUMERAL_BIT1
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1643
                   (NUMERAL_BIT1 (NUMERAL_BIT2 (NUMERAL_BIT1 ALT_ZERO)))))))
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1644
           xa))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1645
  by (import prob_pseudo PSEUDO_LINEAR1_EXECUTE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1646
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1647
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1648
  pseudo_linear1 :: "nat => nat => bool" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1649
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1650
specification (pseudo_linear1_primdef: pseudo_linear1) pseudo_linear1_def: "(ALL x::nat. SHD (pseudo_linear1 x) = pseudo_linear_hd x) &
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1651
(ALL x::nat.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1652
    STL (pseudo_linear1 x) =
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1653
    pseudo_linear1
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1654
     (pseudo_linear_tl
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1655
       (NUMERAL
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1656
         (NUMERAL_BIT1
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1657
           (NUMERAL_BIT1
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1658
             (NUMERAL_BIT1
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1659
               (NUMERAL_BIT2 (NUMERAL_BIT1 (NUMERAL_BIT2 ALT_ZERO)))))))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1660
       (NUMERAL
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1661
         (NUMERAL_BIT1
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1662
           (NUMERAL_BIT1
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1663
             (NUMERAL_BIT1
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1664
               (NUMERAL_BIT1 (NUMERAL_BIT1 (NUMERAL_BIT2 ALT_ZERO)))))))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1665
       (NUMERAL
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1666
         (NUMERAL_BIT1
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1667
           (NUMERAL_BIT1
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1668
             (NUMERAL_BIT1
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1669
               (NUMERAL_BIT1 (NUMERAL_BIT2 (NUMERAL_BIT1 ALT_ZERO)))))))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1670
       x))"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1671
  by (import prob_pseudo pseudo_linear1_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1672
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1673
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1674
  pseudo :: "nat => nat => bool" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1675
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1676
defs
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1677
  pseudo_primdef: "pseudo == pseudo_linear1"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1678
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1679
lemma pseudo_def: "pseudo = pseudo_linear1"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1680
  by (import prob_pseudo pseudo_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1681
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1682
;end_setup
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1683
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1684
;setup_theory prob_indep
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1685
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1686
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1687
  indep_set :: "((nat => bool) => bool) => ((nat => bool) => bool) => bool" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1688
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1689
defs
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1690
  indep_set_primdef: "indep_set ==
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1691
%(p::(nat => bool) => bool) q::(nat => bool) => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1692
   measurable p & measurable q & prob (pred_set.INTER p q) = prob p * prob q"
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1693
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1694
lemma indep_set_def: "ALL (p::(nat => bool) => bool) q::(nat => bool) => bool.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1695
   indep_set p q =
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1696
   (measurable p &
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1697
    measurable q & prob (pred_set.INTER p q) = prob p * prob q)"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1698
  by (import prob_indep indep_set_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1699
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1700
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1701
  alg_cover_set :: "bool list list => bool" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1702
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1703
defs
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1704
  alg_cover_set_primdef: "alg_cover_set ==
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1705
%l::bool list list.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1706
   alg_sorted l & alg_prefixfree l & algebra_embed l = pred_set.UNIV"
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1707
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1708
lemma alg_cover_set_def: "ALL l::bool list list.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1709
   alg_cover_set l =
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1710
   (alg_sorted l & alg_prefixfree l & algebra_embed l = pred_set.UNIV)"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1711
  by (import prob_indep alg_cover_set_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1712
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1713
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1714
  alg_cover :: "bool list list => (nat => bool) => bool list" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1715
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1716
defs
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1717
  alg_cover_primdef: "alg_cover ==
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1718
%(l::bool list list) x::nat => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1719
   SOME b::bool list. b mem l & alg_embed b x"
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1720
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1721
lemma alg_cover_def: "ALL (l::bool list list) x::nat => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1722
   alg_cover l x = (SOME b::bool list. b mem l & alg_embed b x)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1723
  by (import prob_indep alg_cover_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1724
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1725
consts
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1726
  indep :: "((nat => bool) => 'a * (nat => bool)) => bool" 
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1727
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1728
defs
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1729
  indep_primdef: "indep ==
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1730
%f::(nat => bool) => 'a::type * (nat => bool).
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1731
   EX (l::bool list list) r::bool list => 'a::type.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1732
      alg_cover_set l &
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1733
      (ALL s::nat => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1734
          f s =
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1735
          (let c::bool list = alg_cover l s in (r c, SDROP (length c) s)))"
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1736
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1737
lemma indep_def: "ALL f::(nat => bool) => 'a::type * (nat => bool).
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1738
   indep f =
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1739
   (EX (l::bool list list) r::bool list => 'a::type.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1740
       alg_cover_set l &
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1741
       (ALL s::nat => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1742
           f s =
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1743
           (let c::bool list = alg_cover l s in (r c, SDROP (length c) s))))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1744
  by (import prob_indep indep_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1745
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1746
lemma INDEP_SET_BASIC: "ALL p::(nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1747
   measurable p --> indep_set EMPTY p & indep_set pred_set.UNIV p"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1748
  by (import prob_indep INDEP_SET_BASIC)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1749
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1750
lemma INDEP_SET_SYM: "ALL (p::(nat => bool) => bool) q::(nat => bool) => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1751
   indep_set p q = indep_set p q"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1752
  by (import prob_indep INDEP_SET_SYM)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1753
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1754
lemma INDEP_SET_DISJOINT_DECOMP: "ALL (p::(nat => bool) => bool) (q::(nat => bool) => bool)
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1755
   r::(nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1756
   indep_set p r & indep_set q r & pred_set.INTER p q = EMPTY -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1757
   indep_set (pred_set.UNION p q) r"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1758
  by (import prob_indep INDEP_SET_DISJOINT_DECOMP)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1759
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1760
lemma ALG_COVER_SET_BASIC: "~ alg_cover_set [] & alg_cover_set [[]] & alg_cover_set [[True], [False]]"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1761
  by (import prob_indep ALG_COVER_SET_BASIC)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1762
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1763
lemma ALG_COVER_WELL_DEFINED: "ALL (l::bool list list) x::nat => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1764
   alg_cover_set l --> alg_cover l x mem l & alg_embed (alg_cover l x) x"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1765
  by (import prob_indep ALG_COVER_WELL_DEFINED)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1766
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1767
lemma ALG_COVER_UNIV: "alg_cover [[]] = K []"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1768
  by (import prob_indep ALG_COVER_UNIV)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1769
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1770
lemma MAP_CONS_TL_FILTER: "ALL (l::bool list list) b::bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1771
   ~ [] mem l -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1772
   map (op # b) (map tl [x::bool list:l. hd x = b]) =
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1773
   [x::bool list:l. hd x = b]"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1774
  by (import prob_indep MAP_CONS_TL_FILTER)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1775
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1776
lemma ALG_COVER_SET_CASES_THM: "ALL l::bool list list.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1777
   alg_cover_set l =
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1778
   (l = [[]] |
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1779
    (EX (x::bool list list) xa::bool list list.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1780
        alg_cover_set x &
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1781
        alg_cover_set xa & l = map (op # True) x @ map (op # False) xa))"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1782
  by (import prob_indep ALG_COVER_SET_CASES_THM)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1783
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1784
lemma ALG_COVER_SET_CASES: "ALL P::bool list list => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1785
   P [[]] &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1786
   (ALL (l1::bool list list) l2::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1787
       alg_cover_set l1 &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1788
       alg_cover_set l2 &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1789
       alg_cover_set (map (op # True) l1 @ map (op # False) l2) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1790
       P (map (op # True) l1 @ map (op # False) l2)) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1791
   (ALL l::bool list list. alg_cover_set l --> P l)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1792
  by (import prob_indep ALG_COVER_SET_CASES)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1793
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1794
lemma ALG_COVER_SET_INDUCTION: "ALL P::bool list list => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1795
   P [[]] &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1796
   (ALL (l1::bool list list) l2::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1797
       alg_cover_set l1 &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1798
       alg_cover_set l2 &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1799
       P l1 &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1800
       P l2 & alg_cover_set (map (op # True) l1 @ map (op # False) l2) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1801
       P (map (op # True) l1 @ map (op # False) l2)) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1802
   (ALL l::bool list list. alg_cover_set l --> P l)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1803
  by (import prob_indep ALG_COVER_SET_INDUCTION)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1804
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1805
lemma ALG_COVER_EXISTS_UNIQUE: "ALL l::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1806
   alg_cover_set l -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1807
   (ALL s::nat => bool. EX! x::bool list. x mem l & alg_embed x s)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1808
  by (import prob_indep ALG_COVER_EXISTS_UNIQUE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1809
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1810
lemma ALG_COVER_UNIQUE: "ALL (l::bool list list) (x::bool list) s::nat => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1811
   alg_cover_set l & x mem l & alg_embed x s --> alg_cover l s = x"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1812
  by (import prob_indep ALG_COVER_UNIQUE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1813
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1814
lemma ALG_COVER_STEP: "ALL (l1::bool list list) (l2::bool list list) (h::bool) t::nat => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1815
   alg_cover_set l1 & alg_cover_set l2 -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1816
   alg_cover (map (op # True) l1 @ map (op # False) l2) (SCONS h t) =
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1817
   (if h then True # alg_cover l1 t else False # alg_cover l2 t)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1818
  by (import prob_indep ALG_COVER_STEP)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1819
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1820
lemma ALG_COVER_HEAD: "ALL l::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1821
   alg_cover_set l -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1822
   (ALL f::bool list => bool. f o alg_cover l = algebra_embed (filter f l))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1823
  by (import prob_indep ALG_COVER_HEAD)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1824
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1825
lemma ALG_COVER_TAIL_STEP: "ALL (l1::bool list list) (l2::bool list list) q::(nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1826
   alg_cover_set l1 & alg_cover_set l2 -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1827
   q o
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1828
   (%x::nat => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1829
       SDROP
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1830
        (length (alg_cover (map (op # True) l1 @ map (op # False) l2) x))
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1831
        x) =
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1832
   pred_set.UNION
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1833
    (pred_set.INTER (%x::nat => bool. SHD x = True)
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1834
      (q o ((%x::nat => bool. SDROP (length (alg_cover l1 x)) x) o STL)))
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1835
    (pred_set.INTER (%x::nat => bool. SHD x = False)
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1836
      (q o ((%x::nat => bool. SDROP (length (alg_cover l2 x)) x) o STL)))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1837
  by (import prob_indep ALG_COVER_TAIL_STEP)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1838
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1839
lemma ALG_COVER_TAIL_MEASURABLE: "ALL l::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1840
   alg_cover_set l -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1841
   (ALL q::(nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1842
       measurable
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1843
        (q o (%x::nat => bool. SDROP (length (alg_cover l x)) x)) =
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1844
       measurable q)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1845
  by (import prob_indep ALG_COVER_TAIL_MEASURABLE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1846
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1847
lemma ALG_COVER_TAIL_PROB: "ALL l::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1848
   alg_cover_set l -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1849
   (ALL q::(nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1850
       measurable q -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1851
       prob (q o (%x::nat => bool. SDROP (length (alg_cover l x)) x)) =
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1852
       prob q)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1853
  by (import prob_indep ALG_COVER_TAIL_PROB)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1854
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1855
lemma INDEP_INDEP_SET_LEMMA: "ALL l::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1856
   alg_cover_set l -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1857
   (ALL q::(nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1858
       measurable q -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1859
       (ALL x::bool list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1860
           x mem l -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1861
           prob
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1862
            (pred_set.INTER (alg_embed x)
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1863
              (q o (%x::nat => bool. SDROP (length (alg_cover l x)) x))) =
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1864
           (1 / 2) ^ length x * prob q))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1865
  by (import prob_indep INDEP_INDEP_SET_LEMMA)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1866
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1867
lemma INDEP_SET_LIST: "ALL (q::(nat => bool) => bool) l::bool list list.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1868
   alg_sorted l &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1869
   alg_prefixfree l &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1870
   measurable q &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1871
   (ALL x::bool list. x mem l --> indep_set (alg_embed x) q) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1872
   indep_set (algebra_embed l) q"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1873
  by (import prob_indep INDEP_SET_LIST)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1874
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1875
lemma INDEP_INDEP_SET: "ALL (f::(nat => bool) => 'a::type * (nat => bool)) (p::'a::type => bool)
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1876
   q::(nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1877
   indep f & measurable q --> indep_set (p o (fst o f)) (q o (snd o f))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1878
  by (import prob_indep INDEP_INDEP_SET)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1879
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1880
lemma INDEP_UNIT: "ALL x::'a::type. indep (UNIT x)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1881
  by (import prob_indep INDEP_UNIT)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1882
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1883
lemma INDEP_SDEST: "indep SDEST"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1884
  by (import prob_indep INDEP_SDEST)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1885
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1886
lemma BIND_STEP: "ALL f::(nat => bool) => 'a::type * (nat => bool).
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1887
   BIND SDEST (%k::bool. f o SCONS k) = f"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1888
  by (import prob_indep BIND_STEP)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1889
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1890
lemma INDEP_BIND_SDEST: "ALL f::bool => (nat => bool) => 'a::type * (nat => bool).
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1891
   (ALL x::bool. indep (f x)) --> indep (BIND SDEST f)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1892
  by (import prob_indep INDEP_BIND_SDEST)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1893
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1894
lemma INDEP_BIND: "ALL (f::(nat => bool) => 'a::type * (nat => bool))
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1895
   g::'a::type => (nat => bool) => 'b::type * (nat => bool).
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1896
   indep f & (ALL x::'a::type. indep (g x)) --> indep (BIND f g)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1897
  by (import prob_indep INDEP_BIND)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1898
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1899
lemma INDEP_PROB: "ALL (f::(nat => bool) => 'a::type * (nat => bool)) (p::'a::type => bool)
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1900
   q::(nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1901
   indep f & measurable q -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1902
   prob (pred_set.INTER (p o (fst o f)) (q o (snd o f))) =
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1903
   prob (p o (fst o f)) * prob q"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1904
  by (import prob_indep INDEP_PROB)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1905
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1906
lemma INDEP_MEASURABLE1: "ALL (f::(nat => bool) => 'a::type * (nat => bool)) p::'a::type => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1907
   indep f --> measurable (p o (fst o f))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1908
  by (import prob_indep INDEP_MEASURABLE1)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1909
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1910
lemma INDEP_MEASURABLE2: "ALL (f::(nat => bool) => 'a::type * (nat => bool)) q::(nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1911
   indep f & measurable q --> measurable (q o (snd o f))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1912
  by (import prob_indep INDEP_MEASURABLE2)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1913
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1914
lemma PROB_INDEP_BOUND: "ALL (f::(nat => bool) => nat * (nat => bool)) n::nat.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1915
   indep f -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1916
   prob (%s::nat => bool. fst (f s) < Suc n) =
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1917
   prob (%s::nat => bool. fst (f s) < n) +
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1918
   prob (%s::nat => bool. fst (f s) = n)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1919
  by (import prob_indep PROB_INDEP_BOUND)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1920
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1921
;end_setup
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1922
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1923
;setup_theory prob_uniform
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1924
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1925
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1926
  unif_bound :: "nat => nat" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1927
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1928
defs
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1929
  unif_bound_primdef: "unif_bound ==
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1930
WFREC
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1931
 (SOME R::nat => nat => bool. WF R & (ALL v::nat. R (Suc v div 2) (Suc v)))
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1932
 (%unif_bound::nat => nat.
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1933
     nat_case 0 (%v1::nat. Suc (unif_bound (Suc v1 div 2))))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1934
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1935
lemma unif_bound_primitive_def: "unif_bound =
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1936
WFREC
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1937
 (SOME R::nat => nat => bool. WF R & (ALL v::nat. R (Suc v div 2) (Suc v)))
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1938
 (%unif_bound::nat => nat.
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1939
     nat_case 0 (%v1::nat. Suc (unif_bound (Suc v1 div 2))))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1940
  by (import prob_uniform unif_bound_primitive_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1941
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1942
lemma unif_bound_def: "unif_bound 0 = 0 &
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1943
unif_bound (Suc (v::nat)) = Suc (unif_bound (Suc v div 2))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1944
  by (import prob_uniform unif_bound_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1945
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1946
lemma unif_bound_ind: "ALL P::nat => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1947
   P 0 & (ALL v::nat. P (Suc v div 2) --> P (Suc v)) --> All P"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1948
  by (import prob_uniform unif_bound_ind)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1949
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1950
constdefs
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1951
  unif_tupled :: "nat * (nat => bool) => nat * (nat => bool)" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1952
  "unif_tupled ==
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1953
WFREC
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1954
 (SOME R::nat * (nat => bool) => nat * (nat => bool) => bool.
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1955
     WF R & (ALL (s::nat => bool) v2::nat. R (Suc v2 div 2, s) (Suc v2, s)))
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1956
 (%(unif_tupled::nat * (nat => bool) => nat * (nat => bool)) (v::nat,
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1957
     v1::nat => bool).
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1958
     case v of 0 => (0, v1)
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1959
     | Suc (v3::nat) =>
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1960
         let (m::nat, s'::nat => bool) = unif_tupled (Suc v3 div 2, v1)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1961
         in (if SHD s' then 2 * m + 1 else 2 * m, STL s'))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1962
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1963
lemma unif_tupled_primitive_def: "unif_tupled =
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1964
WFREC
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1965
 (SOME R::nat * (nat => bool) => nat * (nat => bool) => bool.
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1966
     WF R & (ALL (s::nat => bool) v2::nat. R (Suc v2 div 2, s) (Suc v2, s)))
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1967
 (%(unif_tupled::nat * (nat => bool) => nat * (nat => bool)) (v::nat,
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1968
     v1::nat => bool).
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1969
     case v of 0 => (0, v1)
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1970
     | Suc (v3::nat) =>
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1971
         let (m::nat, s'::nat => bool) = unif_tupled (Suc v3 div 2, v1)
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1972
         in (if SHD s' then 2 * m + 1 else 2 * m, STL s'))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1973
  by (import prob_uniform unif_tupled_primitive_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1974
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1975
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1976
  unif :: "nat => (nat => bool) => nat * (nat => bool)" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1977
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1978
defs
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1979
  unif_primdef: "unif == %(x::nat) x1::nat => bool. unif_tupled (x, x1)"
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1980
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1981
lemma unif_curried_def: "ALL (x::nat) x1::nat => bool. unif x x1 = unif_tupled (x, x1)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1982
  by (import prob_uniform unif_curried_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1983
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1984
lemma unif_def: "unif 0 (s::nat => bool) = (0, s) &
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  1985
unif (Suc (v2::nat)) s =
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1986
(let (m::nat, s'::nat => bool) = unif (Suc v2 div 2) s
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  1987
 in (if SHD s' then 2 * m + 1 else 2 * m, STL s'))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1988
  by (import prob_uniform unif_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1989
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1990
lemma unif_ind: "ALL P::nat => (nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1991
   All (P 0) &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1992
   (ALL (v2::nat) s::nat => bool. P (Suc v2 div 2) s --> P (Suc v2) s) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1993
   (ALL v::nat. All (P v))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1994
  by (import prob_uniform unif_ind)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1995
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1996
constdefs
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  1997
  uniform_tupled :: "nat * nat * (nat => bool) => nat * (nat => bool)" 
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1998
  "uniform_tupled ==
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  1999
WFREC
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2000
 (SOME R::nat * nat * (nat => bool) => nat * nat * (nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2001
     WF R &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2002
     (ALL (t::nat) (s::nat => bool) (n::nat) (res::nat) s'::nat => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2003
         (res, s') = unif n s & ~ res < Suc n -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2004
         R (t, Suc n, s') (Suc t, Suc n, s)))
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2005
 (%(uniform_tupled::nat * nat * (nat => bool) => nat * (nat => bool))
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2006
     (v::nat, v1::nat * (nat => bool)).
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2007
     case v of
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2008
     0 => (%(v3::nat, v4::nat => bool).
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2009
              case v3 of 0 => ARB | Suc (v5::nat) => (0, v4))
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2010
           v1
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2011
     | Suc (v2::nat) =>
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2012
         (%(v7::nat, v8::nat => bool).
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2013
             case v7 of 0 => ARB
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2014
             | Suc (v9::nat) =>
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2015
                 let (res::nat, s'::nat => bool) = unif v9 v8
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2016
                 in if res < Suc v9 then (res, s')
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2017
                    else uniform_tupled (v2, Suc v9, s'))
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2018
          v1)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2019
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2020
lemma uniform_tupled_primitive_def: "uniform_tupled =
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2021
WFREC
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2022
 (SOME R::nat * nat * (nat => bool) => nat * nat * (nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2023
     WF R &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2024
     (ALL (t::nat) (s::nat => bool) (n::nat) (res::nat) s'::nat => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2025
         (res, s') = unif n s & ~ res < Suc n -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2026
         R (t, Suc n, s') (Suc t, Suc n, s)))
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2027
 (%(uniform_tupled::nat * nat * (nat => bool) => nat * (nat => bool))
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2028
     (v::nat, v1::nat * (nat => bool)).
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2029
     case v of
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2030
     0 => (%(v3::nat, v4::nat => bool).
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2031
              case v3 of 0 => ARB | Suc (v5::nat) => (0, v4))
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2032
           v1
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2033
     | Suc (v2::nat) =>
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2034
         (%(v7::nat, v8::nat => bool).
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2035
             case v7 of 0 => ARB
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2036
             | Suc (v9::nat) =>
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2037
                 let (res::nat, s'::nat => bool) = unif v9 v8
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2038
                 in if res < Suc v9 then (res, s')
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2039
                    else uniform_tupled (v2, Suc v9, s'))
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2040
          v1)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2041
  by (import prob_uniform uniform_tupled_primitive_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2042
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2043
consts
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2044
  uniform :: "nat => nat => (nat => bool) => nat * (nat => bool)" 
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2045
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2046
defs
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  2047
  uniform_primdef: "uniform == %(x::nat) (x1::nat) x2::nat => bool. uniform_tupled (x, x1, x2)"
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  2048
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  2049
lemma uniform_curried_def: "ALL (x::nat) (x1::nat) x2::nat => bool.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  2050
   uniform x x1 x2 = uniform_tupled (x, x1, x2)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2051
  by (import prob_uniform uniform_curried_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2052
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2053
lemma uniform_ind: "ALL P::nat => nat => (nat => bool) => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2054
   (ALL x::nat. All (P (Suc x) 0)) &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2055
   All (P 0 0) &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2056
   (ALL x::nat. All (P 0 (Suc x))) &
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2057
   (ALL (x::nat) (xa::nat) xb::nat => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2058
       (ALL (xc::nat) xd::nat => bool.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2059
           (xc, xd) = unif xa xb & ~ xc < Suc xa --> P x (Suc xa) xd) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2060
       P (Suc x) (Suc xa) xb) -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2061
   (ALL (x::nat) xa::nat. All (P x xa))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2062
  by (import prob_uniform uniform_ind)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2063
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  2064
lemma uniform_def: "uniform 0 (Suc (n::nat)) (s::nat => bool) = (0, s) &
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  2065
uniform (Suc (t::nat)) (Suc n) s =
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  2066
(let (xa::nat, x::nat => bool) = unif n s
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2067
 in if xa < Suc n then (xa, x) else uniform t (Suc n) x)"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2068
  by (import prob_uniform uniform_def)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2069
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  2070
lemma SUC_DIV_TWO_ZERO: "ALL n::nat. (Suc n div 2 = 0) = (n = 0)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2071
  by (import prob_uniform SUC_DIV_TWO_ZERO)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2072
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  2073
lemma UNIF_BOUND_LOWER: "ALL n::nat. n < 2 ^ unif_bound n"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2074
  by (import prob_uniform UNIF_BOUND_LOWER)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2075
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  2076
lemma UNIF_BOUND_LOWER_SUC: "ALL n::nat. Suc n <= 2 ^ unif_bound n"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2077
  by (import prob_uniform UNIF_BOUND_LOWER_SUC)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2078
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2079
lemma UNIF_BOUND_UPPER: "ALL n::nat. n ~= 0 --> 2 ^ unif_bound n <= 2 * n"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2080
  by (import prob_uniform UNIF_BOUND_UPPER)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2081
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  2082
lemma UNIF_BOUND_UPPER_SUC: "ALL n::nat. 2 ^ unif_bound n <= Suc (2 * n)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2083
  by (import prob_uniform UNIF_BOUND_UPPER_SUC)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2084
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  2085
lemma UNIF_DEF_MONAD: "unif 0 = UNIT 0 &
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  2086
(ALL n::nat.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2087
    unif (Suc n) =
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  2088
    BIND (unif (Suc n div 2))
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  2089
     (%m::nat.
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  2090
         BIND SDEST (%b::bool. UNIT (if b then 2 * m + 1 else 2 * m))))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2091
  by (import prob_uniform UNIF_DEF_MONAD)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2092
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  2093
lemma UNIFORM_DEF_MONAD: "(ALL x::nat. uniform 0 (Suc x) = UNIT 0) &
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  2094
(ALL (x::nat) xa::nat.
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2095
    uniform (Suc x) (Suc xa) =
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  2096
    BIND (unif xa)
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  2097
     (%m::nat. if m < Suc xa then UNIT m else uniform x (Suc xa)))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2098
  by (import prob_uniform UNIFORM_DEF_MONAD)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2099
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  2100
lemma INDEP_UNIF: "ALL n::nat. indep (unif n)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2101
  by (import prob_uniform INDEP_UNIF)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2102
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  2103
lemma INDEP_UNIFORM: "ALL (t::nat) n::nat. indep (uniform t (Suc n))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2104
  by (import prob_uniform INDEP_UNIFORM)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2105
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  2106
lemma PROB_UNIF: "ALL (n::nat) k::nat.
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  2107
   prob (%s::nat => bool. fst (unif n s) = k) =
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  2108
   (if k < 2 ^ unif_bound n then (1 / 2) ^ unif_bound n else 0)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2109
  by (import prob_uniform PROB_UNIF)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2110
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  2111
lemma UNIF_RANGE: "ALL (n::nat) s::nat => bool. fst (unif n s) < 2 ^ unif_bound n"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2112
  by (import prob_uniform UNIF_RANGE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2113
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  2114
lemma PROB_UNIF_PAIR: "ALL (n::nat) (k::nat) k'::nat.
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  2115
   (prob (%s::nat => bool. fst (unif n s) = k) =
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  2116
    prob (%s::nat => bool. fst (unif n s) = k')) =
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  2117
   ((k < 2 ^ unif_bound n) = (k' < 2 ^ unif_bound n))"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2118
  by (import prob_uniform PROB_UNIF_PAIR)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2119
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2120
lemma PROB_UNIF_BOUND: "ALL (n::nat) k::nat.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2121
   k <= 2 ^ unif_bound n -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2122
   prob (%s::nat => bool. fst (unif n s) < k) =
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2123
   real k * (1 / 2) ^ unif_bound n"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2124
  by (import prob_uniform PROB_UNIF_BOUND)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2125
17652
b1ef33ebfa17 Release HOL4 and HOLLight Importer.
obua
parents: 17644
diff changeset
  2126
lemma PROB_UNIF_GOOD: "ALL n::nat. 1 / 2 <= prob (%s::nat => bool. fst (unif n s) < Suc n)"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2127
  by (import prob_uniform PROB_UNIF_GOOD)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2128
17644
bd59bfd4bf37 fixed disambiguation problem
obua
parents: 17566
diff changeset
  2129
lemma UNIFORM_RANGE: "ALL (t::nat) (n::nat) s::nat => bool. fst (uniform t (Suc n) s) < Suc n"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2130
  by (import prob_uniform UNIFORM_RANGE)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2131
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2132
lemma PROB_UNIFORM_LOWER_BOUND: "(All::(real => bool) => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2133
 (%b::real.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2134
     (op -->::bool => bool => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2135
      ((All::(nat => bool) => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2136
        (%k::nat.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2137
            (op -->::bool => bool => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2138
             ((op <::nat => nat => bool) k ((Suc::nat => nat) (n::nat)))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2139
             ((op <::real => real => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2140
               ((prob::((nat => bool) => bool) => real)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2141
                 (%s::nat => bool.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2142
                     (op =::nat => nat => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2143
                      ((fst::nat * (nat => bool) => nat)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2144
                        ((uniform::nat
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2145
                                   => nat
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2146
=> (nat => bool) => nat * (nat => bool))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2147
                          (t::nat) ((Suc::nat => nat) n) s))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2148
                      k))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2149
               b)))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2150
      ((All::(nat => bool) => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2151
        (%m::nat.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2152
            (op -->::bool => bool => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2153
             ((op <::nat => nat => bool) m ((Suc::nat => nat) n))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2154
             ((op <::real => real => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2155
               ((prob::((nat => bool) => bool) => real)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2156
                 (%s::nat => bool.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2157
                     (op <::nat => nat => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2158
                      ((fst::nat * (nat => bool) => nat)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2159
                        ((uniform::nat
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2160
                                   => nat
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2161
=> (nat => bool) => nat * (nat => bool))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2162
                          t ((Suc::nat => nat) n) s))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2163
                      ((Suc::nat => nat) m)))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2164
               ((op *::real => real => real)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2165
                 ((real::nat => real) ((Suc::nat => nat) m)) b)))))"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2166
  by (import prob_uniform PROB_UNIFORM_LOWER_BOUND)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2167
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2168
lemma PROB_UNIFORM_UPPER_BOUND: "(All::(real => bool) => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2169
 (%b::real.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2170
     (op -->::bool => bool => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2171
      ((All::(nat => bool) => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2172
        (%k::nat.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2173
            (op -->::bool => bool => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2174
             ((op <::nat => nat => bool) k ((Suc::nat => nat) (n::nat)))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2175
             ((op <::real => real => bool) b
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2176
               ((prob::((nat => bool) => bool) => real)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2177
                 (%s::nat => bool.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2178
                     (op =::nat => nat => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2179
                      ((fst::nat * (nat => bool) => nat)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2180
                        ((uniform::nat
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2181
                                   => nat
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2182
=> (nat => bool) => nat * (nat => bool))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2183
                          (t::nat) ((Suc::nat => nat) n) s))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2184
                      k)))))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2185
      ((All::(nat => bool) => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2186
        (%m::nat.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2187
            (op -->::bool => bool => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2188
             ((op <::nat => nat => bool) m ((Suc::nat => nat) n))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2189
             ((op <::real => real => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2190
               ((op *::real => real => real)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2191
                 ((real::nat => real) ((Suc::nat => nat) m)) b)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2192
               ((prob::((nat => bool) => bool) => real)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2193
                 (%s::nat => bool.
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2194
                     (op <::nat => nat => bool)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2195
                      ((fst::nat * (nat => bool) => nat)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2196
                        ((uniform::nat
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2197
                                   => nat
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2198
=> (nat => bool) => nat * (nat => bool))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2199
                          t ((Suc::nat => nat) n) s))
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2200
                      ((Suc::nat => nat) m)))))))"
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2201
  by (import prob_uniform PROB_UNIFORM_UPPER_BOUND)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2202
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2203
lemma PROB_UNIFORM_PAIR_SUC: "ALL (t::nat) (n::nat) (k::nat) k'::nat.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2204
   k < Suc n & k' < Suc n -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2205
   abs (prob (%s::nat => bool. fst (uniform t (Suc n) s) = k) -
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2206
        prob (%s::nat => bool. fst (uniform t (Suc n) s) = k'))
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2207
   <= (1 / 2) ^ t"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2208
  by (import prob_uniform PROB_UNIFORM_PAIR_SUC)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2209
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2210
lemma PROB_UNIFORM_SUC: "ALL (t::nat) (n::nat) k::nat.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2211
   k < Suc n -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2212
   abs (prob (%s::nat => bool. fst (uniform t (Suc n) s) = k) -
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2213
        1 / real (Suc n))
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2214
   <= (1 / 2) ^ t"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2215
  by (import prob_uniform PROB_UNIFORM_SUC)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2216
17694
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2217
lemma PROB_UNIFORM: "ALL (t::nat) (n::nat) k::nat.
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2218
   k < n -->
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2219
   abs (prob (%s::nat => bool. fst (uniform t n s) = k) - 1 / real n)
b7870c2bd7df mapped "-->" to "hol4-->"
obua
parents: 17652
diff changeset
  2220
   <= (1 / 2) ^ t"
14516
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2221
  by (import prob_uniform PROB_UNIFORM)
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2222
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2223
;end_setup
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2224
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2225
end
a183dec876ab Added HOL proof importer.
skalberg
parents:
diff changeset
  2226