I have the following code which I want to prove:

data Pair (A : Set) (B : A → Set) : Set where
  pair : (a : A) → (B a) → Pair A B

pairEq : (A : Set) → (B : A → Set) → (a : A) → (b₁ b₂ : B a) → (pair {A} {B} a b₁ ≡ pair {A} {B} a b₂) → b₁ ≡ b₂
pairEq A B a b₁ b₂ refl = {!!}

How can I prove this is agda? entering refl leads to an error. How can I work this around?

有帮助吗?

解决方案

I done it myself:

data Pair (A : Set) (B : A → Set) : Set where
  pair : (a : A) → (B a) → Pair A B

pairEq : (A : Set) → (B : A → Set) → (a : A) → (b₁ b₂ : B a) → (pair {A} {B} a b₁ ≡ pair {A} {B} a b₂) → b₁ ≡ b₂
pairEq A B a .b b refl = refl
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top