summaryrefslogtreecommitdiff
path: root/Bidir.agda
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2013-01-14 14:14:30 +0100
committerHelmut Grohne <helmut@subdivi.de>2013-01-14 14:14:30 +0100
commit14045101118b9150b19e51f60beb0c3078073f47 (patch)
tree6957df17183cf03257f8c4be076c40798304b9cf /Bidir.agda
parent9c2be74a5369c1bdb737a67c7c508cb50c62bd83 (diff)
downloadbidiragda-14045101118b9150b19e51f60beb0c3078073f47.tar.gz
shrink lemma-union-not-used by matching on All's ctor
Diffstat (limited to 'Bidir.agda')
-rw-r--r--Bidir.agda11
1 files changed, 4 insertions, 7 deletions
diff --git a/Bidir.agda b/Bidir.agda
index d8bbf8c..fb35001 100644
--- a/Bidir.agda
+++ b/Bidir.agda
@@ -177,18 +177,15 @@ map-just-injective {xs = x ∷ xs'} {ys = .x ∷ ys'} p | refl , p' = cong (_∷
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') p with Data.List.All.head p
-lemma-union-not-used h h' (i ∷ is') p | x , lookupM-i-h≡just-x = cong₂ _∷_ (begin
+lemma-union-not-used h h' (i ∷ is') (All._∷_ (x , px) p') = cong₂ _∷_ (begin
just (lookup i (union h h'))
≡⟨ cong just (lookup∘tabulate (λ j → maybe′ id (lookup j h') (lookupM j h)) i) ⟩
just (maybe′ id (lookup i h') (lookupM i h))
- ≡⟨ cong just (cong (maybe′ id (lookup i h')) lookupM-i-h≡just-x) ⟩
+ ≡⟨ cong just (cong (maybe′ id (lookup i h')) px) ⟩
just (maybe′ id (lookup i h') (just x))
- ≡⟨ refl ⟩
- just x
- ≡⟨ sym lookupM-i-h≡just-x ⟩
+ ≡⟨ sym px ⟩
lookupM i h ∎)
- (lemma-union-not-used h h' is' (Data.List.All.tail p))
+ (lemma-union-not-used h h' is' p')
theorem-2 : {getlen : ℕ → ℕ} (get : get-type getlen) → {m : ℕ} → (v : Vec Carrier (getlen m)) → (s u : Vec Carrier m) → bff get s v ≡ just u → get u ≡ v
theorem-2 get v s u p with lemma-fmap-just (proj₂ (lemma-fmap-just p))