我想证明
¬Any≃All¬ : ∀ {A : Set} → {P : A → Set} → (xs : List A) → (¬_ ∘ Any P) xs ≃ All (¬_ ∘ P) xs
我已经定义
to [] t = []
to (x :: xs) v = (v ∘ here) ∷ to xs (v ∘ there)
from [] [] ()
from (x :: xs´) (¬Px ∷ ¬Pxs´) = λ { (here Px) → ¬Px Px ; (there Pxs´) → (from xs´ ¬Pxs´) Pxs´}
问题来自于试图定义
FromTo : ∀ {A : Set} → {P : A → Set} → (xs : List A) → (v : (¬_ ∘ Any P) xs) → ((from xs) ∘ (to xs)) v ≡ v
我的想法是写类似这样的内容:
FromTo [] t = extensionality (λ {()})
FromTo (x :: xs´) v =
begin
((from (x :: xs´)) ∘ (to (x :: xs´))) v
≡⟨⟩
(from (x :: xs´))(to (x :: xs´) v)
≡⟨⟩
(from (x :: xs´))((v ∘ here) ∷ (to xs´ (v ∘ there)))
≡⟨⟩
λ { (here Px´) → (v ∘ here) Px´ ; (there Pxs´) → (from xs´ (to xs´ (v ∘ there))) Pxs´ }
≡⟨⟩ -- PARSE ERROR
λ { (here Px´) → v (here Px´) ; (there Pxs´) → (from xs´ (to xs´ (v ∘ there))) Pxs´ }
≡⟨ FromTo xs´ (λ u → v (there u)) ⟩
λ { (here Px´) → v (here Px´) ; (there Pxs´) → (v ∘ there) Pxs´ }
≡⟨⟩
λ { (here Px´) → v (here Px´) ; (there Pxs´) → v (there Pxs´) }
≡⟨⟩
v
∎
我遇到的问题是我有一个奇怪的解析错误:
Parse error
≡⟨⟩<ERROR>
λ { (here Px´) → v (h...
位于此处:
λ { (here Px´) → (v ∘ here) Px´ ; (there Pxs´) → (from xs´ (to xs´ (v ∘ there))) Pxs´ }
≡⟨⟩
λ { (here Px´) → v (here Px´) ; (there Pxs´) → (from xs´ (to xs´ (v ∘ there))) Pxs´ }
我尝试了各种方法,想看看是不是缺少了空格,制表符是否错误,还是其他什么原因,但都无济于事。当两个 lambda 被 ≡⟨⟩ 分隔时,就会出现问题。
将 lambda 表达式括在括号中: