From 2f999bfd6553cb31ebffe4c32d0a2a52dedaf4d3 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Mon, 16 Dec 2013 17:34:59 +0100 Subject: move generic functions to a new Generic module --- FinMap.agda | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'FinMap.agda') diff --git a/FinMap.agda b/FinMap.agda index a515a2f..46dbd1c 100644 --- a/FinMap.agda +++ b/FinMap.agda @@ -15,6 +15,8 @@ open import Relation.Binary.Core using (_≡_ ; refl ; _≢_) open import Relation.Binary.PropositionalEquality using (cong ; sym ; _≗_ ; trans ; cong₂) open Relation.Binary.PropositionalEquality.≡-Reasoning using (begin_ ; _≡⟨_⟩_ ; _∎) +open import Generic using (just-injective) + FinMapMaybe : ℕ → Set → Set FinMapMaybe n A = Vec (Maybe A) n @@ -77,9 +79,6 @@ lemma-lookupM-insert-other zero (suc j) a (x ∷ xs) p = refl lemma-lookupM-insert-other (suc i) zero a (x ∷ xs) p = refl lemma-lookupM-insert-other (suc i) (suc j) a (x ∷ xs) p = lemma-lookupM-insert-other i j a xs (p ∘ cong suc) -just-injective : {A : Set} → {x y : A} → _≡_ {_} {Maybe A} (just x) (just y) → x ≡ y -just-injective refl = refl - lemma-lookupM-restrict : {A : Set} {n : ℕ} → (i : Fin n) → (f : Fin n → A) → (is : List (Fin n)) → (a : A) → lookupM i (restrict f is) ≡ just a → f i ≡ a lemma-lookupM-restrict i f [] a p = lemma-just≢nothing p (lemma-lookupM-empty i) lemma-lookupM-restrict i f (i' ∷ is) a p with i ≟ i' -- cgit v1.2.3