A piece of code here:
-- transitivity
trans : {A : Set} {x y z : A} -> x == y -> y == z -> x == z
trans refl refl = refl
union-pair\' : {A : Set} -
It looks like you need to remember the fact that the following expression
ismember (set-union (set-pair m n)) x
is indeed equal to
false
This is a very common problem that comes from the way the 'with' construct works. By default, you don't have access to the proof element that connects the element on which you pattern match with the result of the pattern matching, that is, in your example, an element of type:
ismember (set-union (set-pair m n)) x == false
In order to get an element of this type, you need to use the 'inspect' idiom that is defined alongside the propositional equality in the standard library. More concretely, this means you'll have to add a new element to your pattern matching as follows:
... | ismember (set-union (set-pair m n)) x | inspect (ismember (set-union (set-pair m n)) x
This will result in you having access both to 'false' and the proof element you require. For more information about the inspect idiom, see :