summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2012-09-14 20:41:26 +0200
committerHelmut Grohne <helmut@subdivi.de>2012-09-14 20:41:26 +0200
commitdd4bbd5d31c003a054f676b859012105be81394b (patch)
tree4367222e8836b1f4834b764acf4ae67e194539d7
parent566d649c300b41df3718cd717fee1bf36d4b04cd (diff)
downloadbidiragda-dd4bbd5d31c003a054f676b859012105be81394b.tar.gz
employ rewrite in lemma-map-lookupM-assoc
Thanks to Wouter Swierstra for pointing to the keyword.
-rw-r--r--Bidir.agda3
1 files changed, 1 insertions, 2 deletions
diff --git a/Bidir.agda b/Bidir.agda
index cbac029..c7171a4 100644
--- a/Bidir.agda
+++ b/Bidir.agda
@@ -130,8 +130,7 @@ lemma-map-lookupM-assoc eq i (i' ∷ is') x (x' ∷ xs') h h' ph' ph | yes p | (
lemma-map-lookupM-assoc eq i (i' ∷ is') x (x' ∷ xs') h h' ph' ph | yes p | (x'' , refl) | .(just x'') with eq x x''
lemma-map-lookupM-assoc eq i (i' ∷ is') x (x' ∷ xs') h .h ph' refl | yes p | (.x , refl) | .(just x) | yes refl = refl
lemma-map-lookupM-assoc eq i (i' ∷ is') x (x' ∷ xs') h h' ph' () | yes p | (x'' , refl) | .(just x'') | no ¬p
-lemma-map-lookupM-assoc eq i (i' ∷ is') x (x' ∷ xs') h h' ph' ph | no ¬p with lookupM i h' | lemma-∉-lookupM-assoc eq i (i' ∷ is') (x' ∷ xs') h' ph' ¬p
-lemma-map-lookupM-assoc eq i (i' ∷ is') x (x' ∷ xs') h h' ph' ph | no ¬p | .nothing | refl = begin
+lemma-map-lookupM-assoc eq i (i' ∷ is') x (x' ∷ xs') h h' ph' ph | no ¬p rewrite lemma-∉-lookupM-assoc eq i (i' ∷ is') (x' ∷ xs') h' ph' ¬p = begin
map (flip lookupM h) (i' ∷ is')
≡⟨ map-cong (λ i'' → cong (lookupM i'') (lemma-from-just (sym ph))) (i' ∷ is') ⟩
map (flip lookupM (insert i x h')) (i' ∷ is')