1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
|
(in-package "ACL2")
(include-book "nonstd/integrals/integrable-functions" :dir :system)
(local (include-book "arithmetic-5/top" :dir :system))
(local (include-book "nonstd/nsa/nsa" :dir :system))
(defun make-partition-rec (a delta n)
(if (zp n)
(list a)
(cons a
(make-partition-rec (+ a delta) delta (1- n)))))
(defun make-partition (a b n)
(make-partition-rec a (/ (- b a) n) n))
(defun make-small-partition (a b)
(make-partition a b (i-large-integer)))
(defthm partitionp-append
(implies (and (partitionp p1)
(partitionp p2)
(equal (car (last p1)) (car p2)))
(partitionp (append p1 (cdr p2)))))
(local
(defthm deltas-append
(implies (and (partitionp p1)
(partitionp p2)
(equal (car (last p1)) (car p2)))
(equal (deltas (append p1 (cdr p2)))
(append (deltas p1)
(deltas p2))))))
(local
(defthm maxlist-non-negative
(implies (real-listp x)
(and (realp (maxlist x))
(<= 0 (maxlist x))))))
(local
(defthm maxlist-append
(implies (and (real-listp x1)
(real-listp x2)
)
(equal (maxlist (append x1 x2))
(max (maxlist x1)
(maxlist x2))))))
(local
(defthm real-listp-deltas
(implies (partitionp p)
(real-listp (deltas p)))))
(local
(defthm maxlist-deltas-append
(implies (and (partitionp p1)
(partitionp p2)
(equal (car (last p1)) (car p2)))
(equal (maxlist (deltas (append p1 (cdr p2))))
(max (maxlist (deltas p1))
(maxlist (deltas p2)))))
:hints (("Goal" :do-not-induct t))
))
(defthm mesh-append
(implies (and (partitionp p1)
(partitionp p2)
(equal (car (last p1)) (car p2)))
(equal (mesh (append p1 (cdr p2)))
(max (mesh p1)
(mesh p2)))))
(local
(defthm mesh-append
(implies (and (partitionp p1)
(partitionp p2)
(equal (car (last p1)) (car p2)))
(equal (mesh (append p1 (cdr p2)))
(max (mesh p1)
(mesh p2))))))
(local
(defthmd i-close-plus
(implies (and (i-close x1 x2)
(i-close y1 y2))
(i-close (+ x1 y1)
(+ x2 y2)))
:hints (("Goal"
:in-theory (enable i-close i-small)))))
(local
(defthm car-make-partition-rec
(equal (car (make-partition-rec a delta n))
a)))
(local
(defthm car-make-partition
(equal (car (make-partition a b n))
a)))
(local
(defthm car-last-make-partition-rec
(implies (and (acl2-numberp a)
(acl2-numberp delta)
(natp n))
(equal (car (last (make-partition-rec a delta n)))
(+ a (* n delta))))))
(local
(defthm car-last-make-partition
(implies (and (acl2-numberp a)
(acl2-numberp b)
(posp n))
(equal (car (last (make-partition a b n)))
b))))
(local
(defthm partitionp-make-partition-rec
(implies (and (realp a)
(realp delta)
(< 0 delta)
(natp n)
)
(partitionp (make-partition-rec a delta n)))))
(local
(defthm partitionp-make-partition
(implies (and (realp a)
(realp b)
(< a b)
(natp n)
)
(partitionp (make-partition a b n)))))
(local
(defthm maxlist-deltas-make-partition-rec
(implies (and (acl2-numberp a)
(acl2-numberp delta)
(<= 0 delta))
(equal (maxlist (deltas (make-partition-rec a delta n)))
(if (zp n)
0
delta)))))
(local
(defthm maxlist-deltas-make-partition
(implies (and (acl2-numberp a)
(acl2-numberp b)
(< a b)
(posp n))
(equal (maxlist (deltas (make-partition a b n)))
(/ (- b a) n)))))
(local
(defthm consp-cdr-make-partition-rec-2
(consp (cdr (make-partition-rec a delta 2)))
:hints (("Goal"
:expand ((make-partition-rec a delta 2))))
))
(local
(defthm consp-cdr-make-partition-rec-1
(consp (cdr (make-partition-rec a delta 1)))
:hints (("Goal"
:expand ((make-partition-rec a delta 1))))
))
(local
(defthm consp-cdr-make-partition-rec
(implies (posp n)
(consp (cdr (make-partition-rec a delta n))))))
(local
(defthm consp-cdr-make-partition
(implies (posp n)
(consp (cdr (make-partition a b n))))))
(defthm partitionp-make-small-partition
(implies (and (realp a)
(realp b)
(< a b))
(partitionp (make-small-partition a b))))
(defthm car-make-small-partition
(equal (car (make-small-partition a b))
a))
(defthm car-last-make-small-partition
(implies (and (acl2-numberp a)
(acl2-numberp b))
(equal (car (last (make-small-partition a b)))
b)))
(defthm car-last-cdr-make-small-partition
(implies (and (acl2-numberp a)
(acl2-numberp b)
(< a b))
(equal (car (last (cdr (make-small-partition a b))))
b))
:hints (("Goal"
:use ((:instance car-last-make-small-partition))
:in-theory (disable car-last-make-small-partition
make-small-partition))))
(local
(defthm maxlist-deltas-make-small-partition
(implies (and (acl2-numberp a)
(acl2-numberp b)
(< a b))
(equal (maxlist (deltas (make-small-partition a b)))
(/ (- b a) (i-large-integer))))))
(local
(defthm mesh-make-small-partition
(implies (and (acl2-numberp a)
(acl2-numberp b)
(< a b))
(equal (mesh (make-small-partition a b))
(/ (- b a) (i-large-integer))))))
(defthm small-mesh-make-small-partition
(implies (and (acl2-numberp a) (standardp a)
(acl2-numberp b) (standardp b)
(< a b))
(i-small (mesh (make-small-partition a b)))))
(defthm consp-cdr-make-small-partition
(implies (and (acl2-numberp a)
(acl2-numberp b)
(< a b))
(consp (cdr (make-small-partition a b)))))
(in-theory (disable make-small-partition))
|