1
- {-# OPTIONS --erasure #-}
1
+ {-# OPTIONS --erasure --no-import-sorts #-}
2
2
3
3
-- | Proofs on 'Set'.
4
4
module Data.Set.Prop where
@@ -13,7 +13,7 @@ open import Haskell.Data.Set
13
13
Properties
14
14
Basic
15
15
------------------------------------------------------------------------------}
16
- module _ {a : Set } {{_ : Ord a}} where
16
+ module _ {a : Type } {{_ : Ord a}} where
17
17
18
18
--
19
19
prop-null-empty
@@ -26,11 +26,11 @@ module _ {a : Set} {{_ : Ord a}} where
26
26
Properties
27
27
https://en.wikipedia.org/wiki/Boolean_algebra_(structure)
28
28
------------------------------------------------------------------------------}
29
- module _ {a : Set } {{_ : Ord a}} where
29
+ module _ {a : Type } {{_ : Ord a}} where
30
30
31
31
--
32
32
prop-union-idem
33
- : ∀ {sa : ℙ a}
33
+ : ∀ {sa : Set a}
34
34
→ union sa sa
35
35
≡ sa
36
36
--
@@ -46,7 +46,7 @@ module _ {a : Set} {{_ : Ord a}} where
46
46
47
47
--
48
48
prop-union-assoc
49
- : ∀ {sa sb sc : ℙ a}
49
+ : ∀ {sa sb sc : Set a}
50
50
→ union (union sa sb) sc
51
51
≡ union sa (union sb sc)
52
52
--
@@ -66,7 +66,7 @@ module _ {a : Set} {{_ : Ord a}} where
66
66
67
67
--
68
68
prop-union-sym
69
- : ∀ {sa sb : ℙ a}
69
+ : ∀ {sa sb : Set a}
70
70
→ union sa sb
71
71
≡ union sb sa
72
72
--
@@ -83,7 +83,7 @@ module _ {a : Set} {{_ : Ord a}} where
83
83
84
84
--
85
85
prop-union-absorb
86
- : ∀ {sa sb : ℙ a}
86
+ : ∀ {sa sb : Set a}
87
87
→ union sa (intersection sa sb)
88
88
≡ sa
89
89
--
@@ -100,7 +100,7 @@ module _ {a : Set} {{_ : Ord a}} where
100
100
101
101
--
102
102
prop-union-identity
103
- : ∀ {sa : ℙ a}
103
+ : ∀ {sa : Set a}
104
104
→ union sa empty
105
105
≡ sa
106
106
--
@@ -117,7 +117,7 @@ module _ {a : Set} {{_ : Ord a}} where
117
117
118
118
--
119
119
prop-union-intersection-distribute
120
- : ∀ {sa sb sc : ℙ a}
120
+ : ∀ {sa sb sc : Set a}
121
121
→ union sa (intersection sb sc)
122
122
≡ intersection (union sa sb) (union sa sc)
123
123
--
@@ -139,7 +139,7 @@ module _ {a : Set} {{_ : Ord a}} where
139
139
140
140
--
141
141
prop-intersection-idem
142
- : ∀ {sa : ℙ a}
142
+ : ∀ {sa : Set a}
143
143
→ intersection sa sa
144
144
≡ sa
145
145
--
@@ -155,7 +155,7 @@ module _ {a : Set} {{_ : Ord a}} where
155
155
156
156
--
157
157
prop-intersection-assoc
158
- : ∀ {sa sb sc : ℙ a}
158
+ : ∀ {sa sb sc : Set a}
159
159
→ intersection (intersection sa sb) sc
160
160
≡ intersection sa (intersection sb sc)
161
161
--
@@ -175,7 +175,7 @@ module _ {a : Set} {{_ : Ord a}} where
175
175
176
176
--
177
177
prop-intersection-sym
178
- : ∀ {sa sb : ℙ a}
178
+ : ∀ {sa sb : Set a}
179
179
→ intersection sa sb
180
180
≡ intersection sb sa
181
181
--
@@ -192,7 +192,7 @@ module _ {a : Set} {{_ : Ord a}} where
192
192
193
193
--
194
194
prop-intersection-absorb
195
- : ∀ {sa sb : ℙ a}
195
+ : ∀ {sa sb : Set a}
196
196
→ intersection sa (union sa sb)
197
197
≡ sa
198
198
--
@@ -209,7 +209,7 @@ module _ {a : Set} {{_ : Ord a}} where
209
209
210
210
--
211
211
prop-intersection-union-distribute
212
- : ∀ {sa sb sc : ℙ a}
212
+ : ∀ {sa sb sc : Set a}
213
213
→ intersection sa (union sb sc)
214
214
≡ union (intersection sa sb) (intersection sa sc)
215
215
--
@@ -230,7 +230,7 @@ module _ {a : Set} {{_ : Ord a}} where
230
230
231
231
--
232
232
prop-intersection-empty-right
233
- : ∀ {sa : ℙ a}
233
+ : ∀ {sa : Set a}
234
234
→ intersection sa empty
235
235
≡ empty
236
236
--
@@ -247,7 +247,7 @@ module _ {a : Set} {{_ : Ord a}} where
247
247
248
248
--
249
249
prop-intersection-empty-left
250
- : ∀ {sa : ℙ a}
250
+ : ∀ {sa : Set a}
251
251
→ intersection empty sa
252
252
≡ empty
253
253
--
@@ -265,11 +265,11 @@ module _ {a : Set} {{_ : Ord a}} where
265
265
Properties
266
266
involving difference
267
267
------------------------------------------------------------------------------}
268
- module _ {a : Set } {{_ : Ord a}} where
268
+ module _ {a : Type } {{_ : Ord a}} where
269
269
270
270
--
271
271
prop-intersection-difference
272
- : ∀ {sa sb : ℙ a}
272
+ : ∀ {sa sb : Set a}
273
273
→ intersection sb (difference sa sb)
274
274
≡ empty
275
275
--
@@ -291,7 +291,7 @@ module _ {a : Set} {{_ : Ord a}} where
291
291
292
292
--
293
293
prop-disjoint-difference
294
- : ∀ {sa sb : ℙ a}
294
+ : ∀ {sa sb : Set a}
295
295
→ disjoint sb (difference sa sb)
296
296
≡ True
297
297
--
@@ -300,7 +300,7 @@ module _ {a : Set} {{_ : Ord a}} where
300
300
301
301
--
302
302
prop-union-difference
303
- : ∀ {sa sb : ℙ a}
303
+ : ∀ {sa sb : Set a}
304
304
→ union (difference sa sb) sb
305
305
≡ union sa sb
306
306
--
@@ -323,7 +323,7 @@ module _ {a : Set} {{_ : Ord a}} where
323
323
324
324
--
325
325
prop-difference-union-x
326
- : ∀ {sa sb sc : ℙ a}
326
+ : ∀ {sa sb sc : Set a}
327
327
→ difference (union sa sb) sc
328
328
≡ union (difference sa sc) (difference sb sc)
329
329
--
@@ -347,7 +347,7 @@ module _ {a : Set} {{_ : Ord a}} where
347
347
348
348
--
349
349
prop-deMorgan-difference-intersection
350
- : ∀ {sa sb sc : ℙ a}
350
+ : ∀ {sa sb sc : Set a}
351
351
→ difference sa (intersection sb sc)
352
352
≡ union (difference sa sb) (difference sa sc)
353
353
--
@@ -369,7 +369,7 @@ module _ {a : Set} {{_ : Ord a}} where
369
369
370
370
--
371
371
prop-deMorgan-difference-union
372
- : ∀ {sa sb sc : ℙ a}
372
+ : ∀ {sa sb sc : Set a}
373
373
→ difference sa (union sb sc)
374
374
≡ intersection (difference sa sb) (difference sa sc)
375
375
--
@@ -393,27 +393,27 @@ module _ {a : Set} {{_ : Ord a}} where
393
393
Properties
394
394
involving isSubsetOf
395
395
------------------------------------------------------------------------------}
396
- module _ {a : Set } {{_ : Ord a}} where
396
+ module _ {a : Type } {{_ : Ord a}} where
397
397
398
398
-- | The 'empty' set is a subset of every set.
399
399
prop-isSubsetOf-empty
400
- : ∀ {sa : ℙ a}
400
+ : ∀ {sa : Set a}
401
401
→ isSubsetOf empty sa ≡ True
402
402
--
403
403
prop-isSubsetOf-empty {sa} =
404
404
prop-intersection→isSubsetOf empty sa prop-intersection-empty-left
405
405
406
406
-- | 'isSubsetOf' is reflexive
407
407
prop-isSubsetOf-refl
408
- : ∀ {sa : ℙ a}
408
+ : ∀ {sa : Set a}
409
409
→ isSubsetOf sa sa ≡ True
410
410
--
411
411
prop-isSubsetOf-refl {sa} =
412
412
prop-intersection→isSubsetOf sa sa prop-intersection-idem
413
413
414
414
-- | 'isSubsetOf' is antisymmetric
415
415
prop-isSubsetOf-antisym
416
- : ∀ {sa sb : ℙ a}
416
+ : ∀ {sa sb : Set a}
417
417
→ isSubsetOf sa sb ≡ True
418
418
→ isSubsetOf sb sa ≡ True
419
419
→ sa ≡ sb
@@ -440,7 +440,7 @@ module _ {a : Set} {{_ : Ord a}} where
440
440
441
441
-- | 'isSubsetOf' is transitive
442
442
prop-isSubsetOf-trans
443
- : ∀ {sa sb sc : ℙ a}
443
+ : ∀ {sa sb sc : Set a}
444
444
→ isSubsetOf sa sb ≡ True
445
445
→ isSubsetOf sb sc ≡ True
446
446
→ isSubsetOf sa sc ≡ True
@@ -471,7 +471,7 @@ module _ {a : Set} {{_ : Ord a}} where
471
471
472
472
--
473
473
prop-isSubsetOf-intersection
474
- : ∀ {sa sb : ℙ a}
474
+ : ∀ {sa sb : Set a}
475
475
→ isSubsetOf (intersection sa sb) sb ≡ True
476
476
--
477
477
prop-isSubsetOf-intersection {sa} {sb} =
@@ -487,7 +487,7 @@ module _ {a : Set} {{_ : Ord a}} where
487
487
488
488
--
489
489
prop-isSubsetOf-difference
490
- : ∀ {sa sb : ℙ a}
490
+ : ∀ {sa sb : Set a}
491
491
→ isSubsetOf (difference sa sb) sa ≡ True
492
492
--
493
493
prop-isSubsetOf-difference {sa} {sb} =
0 commit comments