diff options
author | Helmut Grohne <grohne@cs.uni-bonn.de> | 2013-12-16 17:34:59 +0100 |
---|---|---|
committer | Helmut Grohne <grohne@cs.uni-bonn.de> | 2013-12-16 17:34:59 +0100 |
commit | 2f999bfd6553cb31ebffe4c32d0a2a52dedaf4d3 (patch) | |
tree | c204596acfa8626c47c291f86f57ec8f51a50bd2 /Bidir.agda | |
parent | ce9855e6c2e8b88499ebd9660e0cd225146c1b6b (diff) | |
download | bidiragda-2f999bfd6553cb31ebffe4c32d0a2a52dedaf4d3.tar.gz |
move generic functions to a new Generic module
Diffstat (limited to 'Bidir.agda')
-rw-r--r-- | Bidir.agda | 9 |
1 files changed, 1 insertions, 8 deletions
@@ -22,6 +22,7 @@ open Relation.Binary.PropositionalEquality.≡-Reasoning using (begin_ ; _≡⟨ import FreeTheorems open FreeTheorems.VecVec using (get-type ; free-theorem) +open import Generic using (just-injective ; map-just-injective) open import FinMap import CheckInsert open CheckInsert Carrier deq @@ -128,14 +129,6 @@ lemma-<$>-just : {A B : Set} {f : A → B} {b : B} {ma : Maybe A} → f <$> ma â lemma-<$>-just {ma = just x} f<$>ma≡just-b = x , refl lemma-<$>-just {ma = nothing} () -∷-injective : {A : Set} {n : â„•} {x y : A} {xs ys : Vec A n} → (x ∷ xs) ≡ (y ∷ ys) → x ≡ y × xs ≡ ys -∷-injective refl = refl , refl - -map-just-injective : {A : Set} {n : â„•} {xs ys : Vec A n} → map Maybe.just xs ≡ map Maybe.just ys → xs ≡ ys -map-just-injective {xs = []} {ys = []} p = refl -map-just-injective {xs = x ∷ xs'} {ys = y ∷ ys'} p with ∷-injective p -map-just-injective {xs = x ∷ xs'} {ys = .x ∷ ys'} p | refl , p' = cong (_∷_ x) (map-just-injective p') - lemma-union-not-used : {m n : â„•} {A : Set} (h : FinMapMaybe n A) → (h' : FinMap n A) → (is : Vec (Fin n) m) → (toList is) in-domain-of h → map just (map (flip lookup (union h h')) is) ≡ map (flip lookupM h) is lemma-union-not-used h h' [] p = refl lemma-union-not-used h h' (i ∷ is') (Data.List.All._∷_ (x , px) p') = congâ‚‚ _∷_ (begin |