diff options
author | Helmut Grohne <helmut@subdivi.de> | 2012-01-26 18:06:42 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2012-01-26 18:06:42 +0100 |
commit | 3b01996ba5cc0037f1375d6784c33b3bbd2b7589 (patch) | |
tree | b39d47d51dce735c24608d306f6dac69570825df /Bidir.agda | |
parent | 5ece23e8705d2ea3128961a24baed6652383b1ad (diff) | |
download | bidiragda-3b01996ba5cc0037f1375d6784c33b3bbd2b7589.tar.gz |
recursion of lemma-2
Diffstat (limited to 'Bidir.agda')
-rw-r--r-- | Bidir.agda | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -73,13 +73,22 @@ lemma-2 : {τ : Set} {n : ℕ} → (eq : EqInst τ) → (is : List (Fin n)) → lemma-2 eq [] [] h p = refl lemma-2 eq [] (x ∷ xs) h () lemma-2 eq (x ∷ xs) [] h () -lemma-2 eq (i ∷ is) (x ∷ xs) h p = begin +lemma-2 eq (i ∷ is) (x ∷ xs) h p with assoc eq is xs | inspect (assoc eq is) xs +lemma-2 eq (i ∷ is) (x ∷ xs) h () | nothing | _ +lemma-2 eq (i ∷ is) (x ∷ xs) h p | just h' | Reveal_is_.[_] ir = begin map (flip lookupM h) (i ∷ is) ≡⟨ refl ⟩ lookup i h ∷ map (flip lookupM h) is - ≡⟨ cong (flip _∷_ (map (flip lookup h) is)) (lemma-lookupM-assoc eq i is x xs h p) ⟩ + ≡⟨ cong (flip _∷_ (map (flip lookup h) is)) (lemma-lookupM-assoc eq i is x xs h (begin + assoc eq (i ∷ is) (x ∷ xs) + ≡⟨ cong (flip _>>=_ (checkInsert eq i x)) ir ⟩ + checkInsert eq i x h' + ≡⟨ p ⟩ + just h ∎) ) ⟩ just x ∷ map (flip lookupM h) is - ≡⟨ cong (_∷_ (just x)) (lemma-2 eq is xs h {!!}) ⟩ + ≡⟨ cong (_∷_ (just x)) {!!} ⟩ + just x ∷ map (flip lookupM h') is + ≡⟨ cong (_∷_ (just x)) (lemma-2 eq is xs h' ir) ⟩ just x ∷ map just xs ≡⟨ refl ⟩ map just (x ∷ xs) ∎ |