diff options
author | Helmut Grohne <helmut@subdivi.de> | 2013-01-10 11:18:12 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2013-01-10 11:18:12 +0100 |
commit | 324461eb4184c99c0f1e715c2e65decf3f71a980 (patch) | |
tree | 48b105cf1f30c79c4a9869d954bdeb9c652e30f2 /Bidir.agda | |
parent | ec47ee14b9154410b7c72fb067671ea79fd71523 (diff) | |
parent | d42ffc9d24adb2b416ff73708ae64c1d4ca50c30 (diff) | |
download | bidiragda-324461eb4184c99c0f1e715c2e65decf3f71a980.tar.gz |
Merge branch 'newlemma'
This branch splits lemma-\notin-lookupM-assoc into an offspring
lemma-lookupM-checkInsert-other in the spirit of lemma-lookupM-insert-other.
Diffstat (limited to 'Bidir.agda')
-rw-r--r-- | Bidir.agda | 23 |
1 files changed, 6 insertions, 17 deletions
@@ -60,23 +60,12 @@ lemma-∉-lookupM-assoc : {m n : â„•} → (i : Fin n) → (is : Vec (Fin n) m) â lemma-∉-lookupM-assoc i [] [] .empty refl i∉is = lemma-lookupM-empty i lemma-∉-lookupM-assoc i (i' ∷ is') (x' ∷ xs') h ph i∉is with assoc is' xs' | inspect (assoc is') xs' lemma-∉-lookupM-assoc i (i' ∷ is') (x' ∷ xs') h () i∉is | nothing | [ ph' ] -lemma-∉-lookupM-assoc i (i' ∷ is') (x' ∷ xs') h ph i∉is | just h' | [ ph' ] = apply-checkInsertProof i' x' h' record { - same = λ lookupM-i'-h'≡just-x' → begin - lookupM i h - ≡⟨ cong (lookupM i) (just-injective (trans (sym ph) (lemma-checkInsert-same i' x' h' lookupM-i'-h'≡just-x'))) ⟩ - lookupM i h' - ≡⟨ lemma-∉-lookupM-assoc i is' xs' h' ph' (i∉is ∘ there) ⟩ - nothing ∎ - ; new = λ lookupM-i'-h'≡nothing → begin - lookupM i h - ≡⟨ cong (lookupM i) (just-injective (trans (sym ph) (lemma-checkInsert-new i' x' h' lookupM-i'-h'≡nothing))) ⟩ - lookupM i (insert i' x' h') - ≡⟨ sym (lemma-lookupM-insert-other i i' x' h' (i∉is ∘ here)) ⟩ - lookupM i h' - ≡⟨ lemma-∉-lookupM-assoc i is' xs' h' ph' (i∉is ∘ there) ⟩ - nothing ∎ - ; wrong = λ x'' x'≢x'' lookupM-i'-h'≡just-x'' → lemma-just≢nothing (trans (sym ph) (lemma-checkInsert-wrong i' x' h' x'' x'≢x'' lookupM-i'-h'≡just-x'')) - } +lemma-∉-lookupM-assoc i (i' ∷ is') (x' ∷ xs') h ph i∉is | just h' | [ ph' ] = begin + lookupM i h + ≡⟨ sym (lemma-lookupM-checkInsert-other i i' (i∉is ∘ here) x' h' h ph) ⟩ + lookupM i h' + ≡⟨ lemma-∉-lookupM-assoc i is' xs' h' ph' (i∉is ∘ there) ⟩ + nothing ∎ _in-domain-of_ : {n : â„•} {A : Set} → (is : List (Fin n)) → (FinMapMaybe n A) → Set _in-domain-of_ is h = All (λ i → ∃ λ x → lookupM i h ≡ just x) is |