From d42ffc9d24adb2b416ff73708ae64c1d4ca50c30 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Thu, 10 Jan 2013 11:09:38 +0100 Subject: reduce a precondition of lemma-checkInsert-lookupM Now it looks a lot more like lemma-lookupM-insert-other, so rename it to lemma-lookupM-checkInsert-other. --- CheckInsert.agda | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'CheckInsert.agda') diff --git a/CheckInsert.agda b/CheckInsert.agda index 796bece..4083720 100644 --- a/CheckInsert.agda +++ b/CheckInsert.agda @@ -85,14 +85,9 @@ lemma-lookupM-checkInsert i j x y h h' pl ph' | just z | pl' with deq y z lemma-lookupM-checkInsert i j x y h .h pl refl | just .y | pl' | yes refl = pl lemma-lookupM-checkInsert i j x y h h' pl () | just z | pl' | no ¬p -lemma-checkInsert-lookupM : {n : ℕ} → (i j : Fin n) → i ≢ j → (x : Carrier) → (r : Maybe Carrier) → (h h' : FinMapMaybe n Carrier) → lookupM i h' ≡ r → checkInsert j x h ≡ just h' → lookupM i h ≡ r -lemma-checkInsert-lookupM i j i≢j x r h h' pl ph' with lookupM j h -lemma-checkInsert-lookupM i j i≢j x r h h' pl ph' | just y with deq x y -lemma-checkInsert-lookupM i j i≢j x r h .h pl refl | just .x | yes refl = pl -lemma-checkInsert-lookupM i j i≢j x r h h' pl () | just y | no x≢y -lemma-checkInsert-lookupM i j i≢j x r h .(insert j x h) pl refl | nothing = begin - lookupM i h - ≡⟨ lemma-lookupM-insert-other i j x h i≢j ⟩ - lookupM i (insert j x h) - ≡⟨ pl ⟩ - r ∎ +lemma-lookupM-checkInsert-other : {n : ℕ} → (i j : Fin n) → i ≢ j → (x : Carrier) → (h h' : FinMapMaybe n Carrier) → checkInsert j x h ≡ just h' → lookupM i h ≡ lookupM i h' +lemma-lookupM-checkInsert-other i j i≢j x h h' ph' with lookupM j h +lemma-lookupM-checkInsert-other i j i≢j x h h' ph' | just y with deq x y +lemma-lookupM-checkInsert-other i j i≢j x h .h refl | just .x | yes refl = refl +lemma-lookupM-checkInsert-other i j i≢j x h h' () | just y | no x≢y +lemma-lookupM-checkInsert-other i j i≢j x h .(insert j x h) refl | nothing = lemma-lookupM-insert-other i j x h i≢j -- cgit v1.2.3