summaryrefslogtreecommitdiff
path: root/Bidir.agda
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2013-01-05 12:03:57 +0100
committerHelmut Grohne <helmut@subdivi.de>2013-01-05 12:03:57 +0100
commit55d4808670b0de9ecc117f81eb61b33b70d63536 (patch)
tree0ee5072983829ec8984924a637a961ddee6af83d /Bidir.agda
parent2b05019648523ab260b21e8f0199447b8124d332 (diff)
downloadbidiragda-55d4808670b0de9ecc117f81eb61b33b70d63536.tar.gz
shrink lemma-union-not-used using cong\_2
Diffstat (limited to 'Bidir.agda')
-rw-r--r--Bidir.agda10
1 files changed, 3 insertions, 7 deletions
diff --git a/Bidir.agda b/Bidir.agda
index 92a59fd..8fa36c9 100644
--- a/Bidir.agda
+++ b/Bidir.agda
@@ -189,9 +189,7 @@ 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 = begin
- just (lookup i (union h h')) ∷ map just (map (flip lookup (union h h')) is')
- ≡⟨ cong (flip _∷_ (map just (map (flip lookup (union h h')) is'))) (begin
+lemma-union-not-used h h' (i ∷ is') p | x , lookupM-i-h≡just-x = 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))
@@ -200,10 +198,8 @@ lemma-union-not-used h h' (i ∷ is') p | x , lookupM-i-h≡just-x = begin
≡⟨ refl ⟩
just x
≡⟨ sym lookupM-i-h≡just-x ⟩
- lookupM i h ∎) ⟩
- lookupM i h ∷ map just (map (flip lookup (union h h')) is')
- ≡⟨ cong (_∷_ (lookupM i h)) (lemma-union-not-used h h' is' (Data.List.All.tail p)) ⟩
- lookupM i h ∷ map (flip lookupM h) is' ∎
+ lookupM i h ∎)
+ (lemma-union-not-used h h' is' (Data.List.All.tail 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))