File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
src/Data/List/Membership/Setoid Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,8 @@ Additions to existing modules
125
125
126
126
* In ` Data.List.Membership.Setoid.Properties ` :
127
127
``` agda
128
+ ∉⇒All[≉] : x ∉ xs → All (x ≉_) xs
129
+ All[≉]⇒∉ : All (x ≉_) xs → x ∉ xs
128
130
Any-∈-swap : Any (_∈ ys) xs → Any (_∈ xs) ys
129
131
All-∉-swap : All (_∉ ys) xs → All (_∉ xs) ys
130
132
∈-map∘filter⁻ : y ∈₂ map f (filter P? xs) → ∃[ x ] x ∈₁ xs × y ≈₂ f x × P x
Original file line number Diff line number Diff line change @@ -75,6 +75,14 @@ module _ (S : Setoid c ℓ) where
75
75
∉-resp-≋ : ∀ {x} → (x ∉_) Respects _≋_
76
76
∉-resp-≋ xs≋ys v∉xs v∈ys = v∉xs (∈-resp-≋ (≋-sym xs≋ys) v∈ys)
77
77
78
+ -- x ∉_ is equivalent to All (x ≉_)
79
+
80
+ ∉⇒All[≉] : ∀ {x xs} → x ∉ xs → All (x ≉_) xs
81
+ ∉⇒All[≉] = All.¬Any⇒All¬ _
82
+
83
+ All[≉]⇒∉ : ∀ {x xs} → All (x ≉_) xs → x ∉ xs
84
+ All[≉]⇒∉ = All.All¬⇒¬Any
85
+
78
86
-- index is injective in its first argument.
79
87
80
88
index-injective : ∀ {x₁ x₂ xs} (x₁∈xs : x₁ ∈ xs) (x₂∈xs : x₂ ∈ xs) →
@@ -93,7 +101,7 @@ module _ (S : Setoid c ℓ) where
93
101
94
102
private
95
103
∉×∈⇒≉ : ∀ {x y xs} → All (y ≉_) xs → x ∈ xs → x ≉ y
96
- ∉×∈⇒≉ = All.lookupWith λ y≉z x≈z x≈y → y≉z (trans (sym x≈y) x≈z )
104
+ ∉×∈⇒≉ ≉s x∈xs x≈y = All[≉]⇒∉ S ≉s (∈-resp-≈ S x≈y x∈xs )
97
105
98
106
unique⇒irrelevant : Binary.Irrelevant _≈_ → ∀ {xs} → Unique xs → Unary.Irrelevant (_∈ xs)
99
107
unique⇒irrelevant ≈-irr _ (here p) (here q) =
You can’t perform that action at this time.
0 commit comments