Metamath Proof Explorer


Theorem 2addsub

Description: Law for subtraction and addition. (Contributed by NM, 20-Nov-2005)

Ref Expression
Assertion 2addsub
|- ( ( ( A e. CC /\ B e. CC ) /\ ( C e. CC /\ D e. CC ) ) -> ( ( ( A + B ) + C ) - D ) = ( ( ( A + C ) - D ) + B ) )

Proof

Step Hyp Ref Expression
1 add32
 |-  ( ( A e. CC /\ B e. CC /\ C e. CC ) -> ( ( A + B ) + C ) = ( ( A + C ) + B ) )
2 1 3expa
 |-  ( ( ( A e. CC /\ B e. CC ) /\ C e. CC ) -> ( ( A + B ) + C ) = ( ( A + C ) + B ) )
3 2 adantrr
 |-  ( ( ( A e. CC /\ B e. CC ) /\ ( C e. CC /\ D e. CC ) ) -> ( ( A + B ) + C ) = ( ( A + C ) + B ) )
4 3 oveq1d
 |-  ( ( ( A e. CC /\ B e. CC ) /\ ( C e. CC /\ D e. CC ) ) -> ( ( ( A + B ) + C ) - D ) = ( ( ( A + C ) + B ) - D ) )
5 addcl
 |-  ( ( A e. CC /\ C e. CC ) -> ( A + C ) e. CC )
6 addsub
 |-  ( ( ( A + C ) e. CC /\ B e. CC /\ D e. CC ) -> ( ( ( A + C ) + B ) - D ) = ( ( ( A + C ) - D ) + B ) )
7 6 3expb
 |-  ( ( ( A + C ) e. CC /\ ( B e. CC /\ D e. CC ) ) -> ( ( ( A + C ) + B ) - D ) = ( ( ( A + C ) - D ) + B ) )
8 5 7 sylan
 |-  ( ( ( A e. CC /\ C e. CC ) /\ ( B e. CC /\ D e. CC ) ) -> ( ( ( A + C ) + B ) - D ) = ( ( ( A + C ) - D ) + B ) )
9 8 an4s
 |-  ( ( ( A e. CC /\ B e. CC ) /\ ( C e. CC /\ D e. CC ) ) -> ( ( ( A + C ) + B ) - D ) = ( ( ( A + C ) - D ) + B ) )
10 4 9 eqtrd
 |-  ( ( ( A e. CC /\ B e. CC ) /\ ( C e. CC /\ D e. CC ) ) -> ( ( ( A + B ) + C ) - D ) = ( ( ( A + C ) - D ) + B ) )