Imports:
open import Data.Nat using (ℕ; zero; suc)
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_)
open import Data.List using (List; _∷_; [])
Example 1:
postulate
a : ℕ
p : a ≡ zero
b : ℕ
b with a
... | zero = zero
... | _ = suc zero
q : b ≡ zero
q = ?
This is a minimum working example. If I want to prove q, how should I fill the hole?
The part that I'm clueless about, is how to reason, in the proof of q, about the pattern matching that happened in b. I don't know of any syntax that allows me to do this (I'm not very familiar with Agda).
Example 2 (slightly more complex):
postulate
a : List ℕ
p : a ≡ zero ∷ []
b : List ℕ
b with a
... | zero ∷ ns = ns
... | _ = []
q : b ≡ []
q = ?
Again, if I want to prove q, how should I fill the hole?
Difference between example 1 & 2: In example 1 we only care about "which branch in the with-abstraction was entered", while in example 2 we also care about "what was the value ns resulted from the pattern matching". I'm not sure if this is a relevant difference though.