0

I am trying to prove commutative property for agda. I tried to explore the standard library but there is lot of complex thing which i could not understand. I tried in this way --

comm : (a b : Q) -> (a + b) === (b + a)

the problem here is + which is not defined over Q in library. Can't we proof this without defining + over Q. Please guide me.

ajayv
  • 641
  • 6
  • 21

2 Answers2

2

You cannot prove this without first defining +.

If you get confused exploring the standard library I suggest you try to prove something easier first, in order to become more acquainted with Agda, before tackling this.

Dominic Mulligan
  • 456
  • 2
  • 10
0

Of course you can't prove commutativity of an undefined function _+_; as a stupid counter-example, would you expect to be able to prove (a - b) == (b - a)? If not, why not? _-_ is just as much of an undefined function as _+_ at this point; it just has a different name...

Note that you can define addition for using elementary school math:

n ÷ p + m ÷ q = (n * q + m * p) ÷ (p * q)

and simplifying it by dividing both n * q + m * p and p * q with their GCD. I have already explained the details of this last step in this answer.

Community
  • 1
  • 1
Cactus
  • 27,075
  • 9
  • 69
  • 149