summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Grohne <grohne@cs.uni-bonn.de>2014-10-15 10:35:43 +0200
committerHelmut Grohne <grohne@cs.uni-bonn.de>2014-10-15 10:35:43 +0200
commitd2548922c7abb20fee5633be6e654430517555af (patch)
tree1d4d3c38c6f0f3b4832cb4d5135f6fea8b7f057a
parentb1b80567288030782231418407e7244b37227450 (diff)
downloadbidiragda-d2548922c7abb20fee5633be6e654430517555af.tar.gz
remove lemma-just≢nothing
Special case of contradiction.
-rw-r--r--CheckInsert.agda2
-rw-r--r--FinMap.agda5
2 files changed, 2 insertions, 5 deletions
diff --git a/CheckInsert.agda b/CheckInsert.agda
index 16bcc8e..9dc8a60 100644
--- a/CheckInsert.agda
+++ b/CheckInsert.agda
@@ -67,7 +67,7 @@ lemma-lookupM-checkInsert : {n : ℕ} → (i j : Fin n) → (x y : Carrier) →
lemma-lookupM-checkInsert i j x y h h' pl ph' with checkInsert j y h | insertionresult j y h
lemma-lookupM-checkInsert i j x y h .h pl refl | ._ | same _ _ _ = pl
lemma-lookupM-checkInsert i j x y h h' pl ph' | ._ | new _ with i ≟ j
-lemma-lookupM-checkInsert i .i x y h h' pl ph' | ._ | new pl' | yes refl = lemma-just≢nothing pl pl'
+lemma-lookupM-checkInsert i .i x y h h' pl ph' | ._ | new pl' | yes refl = contradiction (trans (sym pl) pl') (λ ())
lemma-lookupM-checkInsert i j x y h .(insert j y h) pl refl | ._ | new _ | no i≢j = begin
lookupM i (insert j y h)
≡⟨ sym (lemma-lookupM-insert-other i j y h i≢j) ⟩
diff --git a/FinMap.agda b/FinMap.agda
index c8b078c..05b251e 100644
--- a/FinMap.agda
+++ b/FinMap.agda
@@ -57,9 +57,6 @@ delete i m = m [ i ]≔ nothing
delete-many : {A : Set} {n m : ℕ} → Vec (Fin n) m → FinMapMaybe n A → FinMapMaybe n A
delete-many = flip (foldr (const _) delete)
-lemma-just≢nothing : {A Whatever : Set} {a : A} {ma : Maybe A} → ma ≡ just a → ma ≡ nothing → Whatever
-lemma-just≢nothing refl ()
-
lemma-insert-same : {n : ℕ} {A : Set} → (m : FinMapMaybe n A) → (f : Fin n) → (a : A) → lookupM f m ≡ just a → m ≡ insert f a m
lemma-insert-same [] () a p
lemma-insert-same {suc n} (x ∷ xs) zero a p = cong (flip _∷_ xs) p
@@ -80,7 +77,7 @@ lemma-lookupM-insert-other (suc i) zero a (x ∷ xs) p = refl
lemma-lookupM-insert-other (suc i) (suc j) a (x ∷ xs) p = lemma-lookupM-insert-other i j a xs (p ∘ cong suc)
lemma-lookupM-restrict : {A : Set} {n : ℕ} → (i : Fin n) → (f : Fin n → A) → (is : List (Fin n)) → (a : A) → lookupM i (restrict f is) ≡ just a → f i ≡ a
-lemma-lookupM-restrict i f [] a p = lemma-just≢nothing p (lemma-lookupM-empty i)
+lemma-lookupM-restrict i f [] a p = contradiction (trans (sym p) (lemma-lookupM-empty i)) (λ ())
lemma-lookupM-restrict i f (i' ∷ is) a p with i ≟ i'
lemma-lookupM-restrict i f (.i ∷ is) a p | yes refl = just-injective (begin
just (f i)