Metamath Proof Explorer


Theorem modsub12d

Description: Subtraction property of the modulo operation. (Contributed by Mario Carneiro, 9-Sep-2016)

Ref Expression
Hypotheses modadd12d.1 φ A
modadd12d.2 φ B
modadd12d.3 φ C
modadd12d.4 φ D
modadd12d.5 φ E +
modadd12d.6 φ A mod E = B mod E
modadd12d.7 φ C mod E = D mod E
Assertion modsub12d φ A C mod E = B D mod E

Proof

Step Hyp Ref Expression
1 modadd12d.1 φ A
2 modadd12d.2 φ B
3 modadd12d.3 φ C
4 modadd12d.4 φ D
5 modadd12d.5 φ E +
6 modadd12d.6 φ A mod E = B mod E
7 modadd12d.7 φ C mod E = D mod E
8 3 renegcld φ C
9 4 renegcld φ D
10 3 4 5 7 modnegd φ C mod E = D mod E
11 1 2 8 9 5 6 10 modadd12d φ A + C mod E = B + D mod E
12 1 recnd φ A
13 3 recnd φ C
14 12 13 negsubd φ A + C = A C
15 14 oveq1d φ A + C mod E = A C mod E
16 2 recnd φ B
17 4 recnd φ D
18 16 17 negsubd φ B + D = B D
19 18 oveq1d φ B + D mod E = B D mod E
20 11 15 19 3eqtr3d φ A C mod E = B D mod E