Is there a method to programmatically construct (sub)proofs in Agda? Because some proofs are very similar and it's better to simplify them... but i don't know how to do this. Consider for example the following code
{-
At first we reaname Set to ???? (as in Universe)
-}
???? = Set
{-
We define also a polymorphic idenity
-}
data _==_ {A : ????} (a : A) : A → ???? where
definition-of-idenity : a == a
infix 30 _==_
{-
The finite set Ω
-}
data Ω : ???? where
A B : Ω
Operation = Ω → Ω → Ω
{-
symmetry is a function that takes an Operation
op and returns a proposition about this operation
-}
symmetry : Operation → ????
symmetry op = ∀ x y → op x y == op y x
ope : Operation
ope A A = A
ope A B = B
ope B A = B
ope B B = B
proof-of-symmetry-of-operator-ope : symmetry ope
proof-of-symmetry-of-operator-ope A A = definition-of-idenity
proof-of-symmetry-of-operator-ope B B = definition-of-idenity
proof-of-symmetry-of-operator-ope A B = definition-of-idenity
proof-of-symmetry-of-operator-ope B A = definition-of-idenity
Why I cannot just use the following simplified one-line proof ?
proof-of-symmetry-of-operator-ope _ _ = definition-of-idenity
It seems that pattern matching is the cause of such behaviour. But I don't understand why.