File: equivalence-continuous-function.lisp

package info (click to toggle)
acl2 8.6%2Bdfsg-3
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 1,138,276 kB
  • sloc: lisp: 17,818,294; java: 125,359; python: 28,122; javascript: 23,458; cpp: 18,851; ansic: 11,569; perl: 7,678; xml: 5,591; sh: 3,978; makefile: 3,840; ruby: 2,633; yacc: 1,126; ml: 763; awk: 295; csh: 233; lex: 197; php: 178; tcl: 49; asm: 23; haskell: 17
file content (165 lines) | stat: -rw-r--r-- 6,330 bytes parent folder | download | duplicates (6)
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
(in-package "ACL2")


(local (include-book "arithmetic-5/top" :dir :system))
(include-book "integrable-functions")
(include-book "continuous-function")
(include-book "equivalence-integrals")
(include-book "nonstd/nsa/equivalence-continuity" :dir :system)



(defun map-rcfn-hyper (p)
  (if (consp p)
      (cons (rcfn-hyper (car p))
	    (map-rcfn-hyper (cdr p)))
    nil))

(defthm real-listp-map-rcfn-hyper
  (implies (partitionp p)
           (real-listp (map-rcfn-hyper p))))

(defun riemann-rcfn-hyper (p)
  (dotprod (deltas p)
	   (map-rcfn-hyper (cdr p))))

(defthm real-riemann-rcfn-hyper
  (implies (partitionp p)
           (realp (riemann-rcfn-hyper p))))

(defthm limited-riemann-rcfn-hyper-small-partition
  (implies (and (realp a) (standardp a)
		(realp b) (standardp b)
		(inside-interval-p a (rcfn-hyper-domain))
		(inside-interval-p b (rcfn-hyper-domain))
		(< a b))
	   (i-limited (riemann-rcfn-hyper (make-small-partition a b))))
  :hints (("Goal"
           :by (:functional-instance limited-riemann-rcfn-small-partition
                                     (rcfn rcfn-hyper)
                                     (rcfn-domain rcfn-hyper-domain)
                                     (map-rcfn map-rcfn-hyper)
                                     (riemann-rcfn riemann-rcfn-hyper)))
          ("Subgoal 3"
           :use ((:instance rcfn-hyper-is-continuous-using-nonstandard-criterion
                            (x0 x)
                            (x y))))
          ("Subgoal 2"
           :use ((:instance rcfn-hyper-domain-non-trivial)))
          ))


(encapsulate
 nil

 (local (in-theory (disable riemann-rcfn-hyper)))

 (defun-std strict-int-rcfn-hyper (a b)
   (if (and (realp a)
	    (realp b)
	    (inside-interval-p a (rcfn-hyper-domain))
	    (inside-interval-p b (rcfn-hyper-domain))
	    (< a b))
       (standard-part (riemann-rcfn-hyper (make-small-partition a b)))
     0))
 )

(defthm-std realp-strict-int-rcfn-hyper
  (implies (and (realp a)
                (realp b))
           (realp (strict-int-rcfn-hyper a b)))
  :hints (("Goal"
           :use ((:instance real-riemann-rcfn-hyper
                            (p (make-small-partition a b))))
           :in-theory (disable riemann-rcfn-hyper
                               real-riemann-rcfn-hyper))))

(defun int-rcfn-hyper (a b)
  (if (<= a b)
      (strict-int-rcfn-hyper a b)
    (- (strict-int-rcfn-hyper b a))))

(defthm realp-int-rcfn-nyper
  (implies (and (realp a)
                (realp b))
           (realp (int-rcfn-hyper a b))))

(defthm strict-int-rcfn-hyper-is-integral-of-rcfn-hyper
  (implies (and (standardp a)
		(standardp b)
		(<= a b)
		(inside-interval-p a (rcfn-hyper-domain))
		(inside-interval-p b (rcfn-hyper-domain))
		(partitionp p)
		(equal (car p) a)
		(equal (car (last p)) b)
		(i-small (mesh p)))
	   (i-close (riemann-rcfn-hyper p)
		    (strict-int-rcfn-hyper a b)))
  :hints (("Goal"
	   :do-not-induct t
	   :by (:functional-instance strict-int-rcfn-is-integral-of-rcfn
                                     (rcfn rcfn-hyper)
                                     (rcfn-domain rcfn-hyper-domain)
                                     (map-rcfn map-rcfn-hyper)
                                     (riemann-rcfn riemann-rcfn-hyper)
                                     (strict-int-rcfn strict-int-rcfn-hyper)))
          ))

(defun-sk forall-partitions-riemann-sum-is-close-to-int-rcfn-hyper (a b eps delta)
  (forall (p)
          (implies (and (<= a b)
                        (partitionp p)
                        (equal (car p) a)
                        (equal (car (last p)) b)
                        (< (mesh p) delta))
                   (< (abs (- (riemann-rcfn-hyper p)
                              (strict-int-rcfn-hyper a b)))
                      eps)))
  :rewrite :direct)

(defun-sk exists-delta-so-that-riemann-sum-is-close-to-int-rcfn-hyper (a b eps)
  (exists (delta)
          (implies (and (inside-interval-p a (rcfn-hyper-domain))
                        (inside-interval-p b (rcfn-hyper-domain))
                        (<= a b)
                        (realp eps)
                        (< 0 eps))
                   (and (realp delta)
                        (< 0 delta)
                        (forall-partitions-riemann-sum-is-close-to-int-rcfn-hyper a b eps delta)))))

(defthm rcfn-hyper-is-integrable-hyperreal
  (implies (and (inside-interval-p a (rcfn-hyper-domain))
                (inside-interval-p b (rcfn-hyper-domain))
                (<= a b)
                (realp eps)
                (< 0 eps))
           (exists-delta-so-that-riemann-sum-is-close-to-int-rcfn-hyper a b eps))
  :hints (("Goal"
           :by (:functional-instance rifn-is-integrable-hyperreal
                                     (rifn rcfn-hyper)
                                     (domain-rifn rcfn-hyper-domain)
                                     (map-rifn map-rcfn-hyper)
                                     (riemann-rifn riemann-rcfn-hyper)
                                     (strict-int-rifn strict-int-rcfn-hyper)
                                     (exists-delta-so-that-riemann-sum-is-close-to-int-rifn
                                      exists-delta-so-that-riemann-sum-is-close-to-int-rcfn-hyper)
                                     (exists-delta-so-that-riemann-sum-is-close-to-int-rifn-witness
                                      exists-delta-so-that-riemann-sum-is-close-to-int-rcfn-hyper-witness)
                                     (forall-partitions-riemann-sum-is-close-to-int-rifn
                                      forall-partitions-riemann-sum-is-close-to-int-rcfn-hyper)
                                     (forall-partitions-riemann-sum-is-close-to-int-rifn-witness
                                      forall-partitions-riemann-sum-is-close-to-int-rcfn-hyper-witness)
                                     ))
          ("Subgoal 8"
           :use ((:instance EXISTS-DELTA-SO-THAT-RIEMANN-SUM-IS-CLOSE-TO-INT-RCFN-HYPER-suff)))
          ("Subgoal 6"
           :use ((:instance FORALL-PARTITIONS-RIEMANN-SUM-IS-CLOSE-TO-INT-RCFN-HYPER-necc)))
          ("Subgoal 4"
           :use ((:instance strict-int-rcfn-hyper-is-integral-of-rcfn-hyper)))
          ("Subgoal 3"
           :use ((:instance rcfn-hyper-domain-non-trivial)))
          ))