Built with Alectryon, running Coq+SerAPI. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus. On Mac, use instead of Ctrl.

x y : Z, [x + y] = [x - y] → y = 0

[=…]’ is an injection pattern

  
x, y: Z
Heq: x + y = x - y

y = 0
Z.add_reg_l: n m p : Z, n + m = n + p → m = p
x, y: Z
Heq: y = - y

y = 0

3 cases: y=0, y<0, y>0

  
x: Z
Heq: 0 = 0

0 = 0
x: Z
p: positive
Heq: Z.pos p = Z.neg p
Z.pos p = 0
x: Z
p: positive
Heq: Z.neg p = Z.pos p
Z.neg p = 0

y=0: trivial

  
x: Z
p: positive
Heq: Z.pos p = Z.neg p

Z.pos p = 0
x: Z
p: positive
Heq: Z.neg p = Z.pos p
Z.neg p = 0

y!=0: contradiction in Heq

  all: discriminate.
Qed.