File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
src/Data/Vec/Membership/Propositional Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -506,6 +506,11 @@ Other minor additions
506
506
take⁺ : ∀ {n} m {xs} → All P {m + n} xs → All P {m} (take m xs)
507
507
```
508
508
509
+ * Added new proofs to ` Data.Vec.Membership.Propositional.Properties ` :
510
+ ``` agda
511
+ index-∈-lookup : (i : Fin n) (xs : Vec A n) → Any.index (∈-lookup i xs) ≡ i
512
+ ```
513
+
509
514
Refactorings
510
515
------------
511
516
Original file line number Diff line number Diff line change @@ -14,14 +14,14 @@ open import Data.Vec hiding (here; there)
14
14
open import Data.Vec.Relation.Unary.Any using (here; there)
15
15
open import Data.List.Base using ([]; _∷_)
16
16
open import Data.List.Relation.Unary.Any using (here; there)
17
- open import Data.Vec.Relation.Unary.Any using (Any; here; there)
17
+ open import Data.Vec.Relation.Unary.Any as Any using (Any; here; there)
18
18
open import Data.Vec.Membership.Propositional
19
19
open import Data.List.Membership.Propositional
20
20
using () renaming (_∈_ to _∈ₗ_)
21
21
open import Level using (Level)
22
22
open import Function using (_∘_; id)
23
23
open import Relation.Unary using (Pred)
24
- open import Relation.Binary.PropositionalEquality using (refl)
24
+ open import Relation.Binary.PropositionalEquality using (_≡_; refl; cong )
25
25
26
26
private
27
27
variable
@@ -36,6 +36,10 @@ private
36
36
∈-lookup zero (x ∷ xs) = here refl
37
37
∈-lookup (suc i) (x ∷ xs) = there (∈-lookup i xs)
38
38
39
+ index-∈-lookup : ∀ {n} (i : Fin n) (xs : Vec A n) → Any.index (∈-lookup i xs) ≡ i
40
+ index-∈-lookup zero (x ∷ xs) = refl
41
+ index-∈-lookup (suc i) (x ∷ xs) = cong suc (index-∈-lookup i xs)
42
+
39
43
------------------------------------------------------------------------
40
44
-- map
41
45
You can’t perform that action at this time.
0 commit comments