You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- An index can just be any set (of any universe, which is why it looks so complicated).
@@ -130,6 +130,19 @@ _⊢_≡ⁱ_ : ∀ {I : Set iℓ} (A : IndexedSet I) → I → I → Set ℓ
130
130
A ⊢ i ≡ⁱ j = A i ≈ A j
131
131
```
132
132
133
+
## Inverse Operations
134
+
135
+
```agda
136
+
_∉_ : ∀ {I : Set iℓ} → Carrier → IndexedSet I → Set (ℓ ⊔ iℓ)
137
+
a ∉ A = ∀ i → ¬ (a ≈ A i)
138
+
139
+
Disjoint : ∀ {I : Set iℓ} {J : Set jℓ} (A : IndexedSet I) (B : IndexedSet J) → Set (ℓ ⊔ iℓ ⊔ jℓ)
140
+
Disjoint A B = ∀ i → A i ∉ B
141
+
142
+
Disjoint-flip : ∀ {I : Set iℓ} {J : Set jℓ} {A : IndexedSet I} {B : IndexedSet J} → Disjoint A B → Disjoint B A
143
+
Disjoint-flip disjointAB j i Bj≈Ai = disjointAB i j (Eq.sym Bj≈Ai)
144
+
```
145
+
133
146
## Singletons
134
147
135
148
```agda
@@ -164,11 +177,13 @@ We now prove the following theorems:
164
177
⊆-refl i = i , Eq.refl
165
178
166
179
-- There is no antisymmetry definition in Relation.Binary.Indexed.Heterogeneous.Definition. Adding that to the standard library would be good and a low hanging fruit.
⊆-antisym : ∀ {I : Set iℓ} {J : Set jℓ} {A : IndexedSet I} {B : IndexedSet J} → A ⊆ B → B ⊆ A → A ≅ B
168
182
⊆-antisym l r = l , r
169
183
170
184
-- There are no generalized transitivity, symmetry and antisymmetry definitions which allow different levels in Relation.Binary.Indexed.Heterogeneous.Definition . Adding that to the standard library would be good and a low hanging fruit.
171
-
⊆-trans : Transitive (IndexedSet {iℓ}) _⊆_
185
+
-- ⊆-trans : Transitive (IndexedSet {iℓ}) _⊆_
186
+
⊆-trans : ∀ {I : Set iℓ} {J : Set jℓ} {K : Set kℓ} {A : IndexedSet I} {B : IndexedSet J} {C : IndexedSet K} → A ⊆ B → B ⊆ C → A ⊆ C
172
187
⊆-trans A⊆B B⊆C i =
173
188
-- This proof looks resembles state monad bind >>=.
174
189
-- interesting... 🤔
@@ -179,10 +194,10 @@ We now prove the following theorems:
179
194
≅-refl : Reflexive (IndexedSet {iℓ}) _≅_
180
195
≅-refl = ⊆-refl , ⊆-refl
181
196
182
-
≅-sym : Symmetric (IndexedSet {iℓ}) _≅_
197
+
≅-sym : ∀ {I : Set iℓ} {J : Set jℓ} {A : IndexedSet I} {B : IndexedSet J} → A ≅ B → B ≅ A
183
198
≅-sym (l , r) = r , l
184
199
185
-
≅-trans : Transitive (IndexedSet {iℓ}) _≅_
200
+
≅-trans : ∀ {I : Set iℓ} {J : Set jℓ} {K : Set kℓ} {A : IndexedSet I} {B : IndexedSet J} {C : IndexedSet K} → A ≅ B → B ≅ C → A ≅ C
186
201
≅-trans (A⊆B , B⊆A) (B⊆C , C⊆B) =
187
202
⊆-trans A⊆B B⊆C
188
203
, ⊆-trans C⊆B B⊆A
@@ -625,6 +640,183 @@ singleton-set-is-nonempty : (A : 𝟙 iℓ) → nonempty A
625
640
singleton-set-is-nonempty _ = tt
626
641
```
627
642
643
+
## Operations
644
+
645
+
```agda
646
+
module _ where
647
+
open import Data.Sum using (_⊎_; inj₁; inj₂)
648
+
private variable
649
+
α : Set iℓ
650
+
β : Set jℓ
651
+
652
+
{-|
653
+
Indexed Set Union (Or):
654
+
We can create the union of two indexed sets by accepting either of the input indices.
0 commit comments