File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,7 @@ Additions to existing modules
185
185
product≢0 : All NonZero ns → NonZero (product ns)
186
186
∈⇒≤product : All NonZero ns → n ∈ ns → n ≤ product ns
187
187
concatMap-++ : concatMap f (xs ++ ys) ≡ concatMap f xs ++ concatMap f ys
188
+ filter-≐ : P ≐ Q → filter P? ≗ filter Q?
188
189
```
189
190
190
191
* In ` Data.List.Relation.Unary.Any.Properties ` :
Original file line number Diff line number Diff line change @@ -45,16 +45,16 @@ open import Relation.Binary.PropositionalEquality.Properties as ≡
45
45
open import Relation.Binary.Core using (Rel)
46
46
open import Relation.Nullary.Reflects using (invert)
47
47
open import Relation.Nullary using (¬_; Dec; does; _because_; yes; no; contradiction)
48
- open import Relation.Nullary.Decidable as Decidable using (isYes; map′; ⌊_⌋; ¬?; _×-dec_)
49
- open import Relation.Unary using (Pred; Decidable; ∁)
48
+ open import Relation.Nullary.Decidable as Decidable using (isYes; map′; ⌊_⌋; ¬?; _×-dec_; dec-true; dec-false )
49
+ open import Relation.Unary using (Pred; Decidable; ∁; _≐_ )
50
50
open import Relation.Unary.Properties using (∁?)
51
51
import Data.Nat.GeneralisedArithmetic as ℕ
52
52
53
53
open ≡-Reasoning
54
54
55
55
private
56
56
variable
57
- a b c d e p ℓ : Level
57
+ a b c d e p q ℓ : Level
58
58
A : Set a
59
59
B : Set b
60
60
C : Set c
@@ -1236,6 +1236,14 @@ module _ {P : Pred A p} (P? : Decidable P) where
1236
1236
... | true = cong (x ∷_) ih
1237
1237
... | false = ih
1238
1238
1239
+ module _ {P : Pred A p} {Q : Pred A q} (P? : Decidable P) (Q? : Decidable Q) where
1240
+
1241
+ filter-≐ : P ≐ Q → filter P? ≗ filter Q?
1242
+ filter-≐ P≐Q [] = refl
1243
+ filter-≐ P≐Q (x ∷ xs) with P? x
1244
+ ... | yes P[x] = trans (cong (x ∷_) (filter-≐ P≐Q xs)) (sym (filter-accept Q? (proj₁ P≐Q P[x])))
1245
+ ... | no ¬P[x] = trans (filter-≐ P≐Q xs) (sym (filter-reject Q? (¬P[x] ∘ proj₂ P≐Q)))
1246
+
1239
1247
------------------------------------------------------------------------
1240
1248
-- derun and deduplicate
1241
1249
You can’t perform that action at this time.
0 commit comments