Metamath Proof Explorer


Theorem addpipq2

Description: Addition of positive fractions in terms of positive integers. (Contributed by Mario Carneiro, 8-May-2013) (New usage is discouraged.)

Ref Expression
Assertion addpipq2 A𝑵×𝑵B𝑵×𝑵A+𝑝𝑸B=1stA𝑵2ndB+𝑵1stB𝑵2ndA2ndA𝑵2ndB

Proof

Step Hyp Ref Expression
1 fveq2 x=A1stx=1stA
2 1 oveq1d x=A1stx𝑵2ndy=1stA𝑵2ndy
3 fveq2 x=A2ndx=2ndA
4 3 oveq2d x=A1sty𝑵2ndx=1sty𝑵2ndA
5 2 4 oveq12d x=A1stx𝑵2ndy+𝑵1sty𝑵2ndx=1stA𝑵2ndy+𝑵1sty𝑵2ndA
6 3 oveq1d x=A2ndx𝑵2ndy=2ndA𝑵2ndy
7 5 6 opeq12d x=A1stx𝑵2ndy+𝑵1sty𝑵2ndx2ndx𝑵2ndy=1stA𝑵2ndy+𝑵1sty𝑵2ndA2ndA𝑵2ndy
8 fveq2 y=B2ndy=2ndB
9 8 oveq2d y=B1stA𝑵2ndy=1stA𝑵2ndB
10 fveq2 y=B1sty=1stB
11 10 oveq1d y=B1sty𝑵2ndA=1stB𝑵2ndA
12 9 11 oveq12d y=B1stA𝑵2ndy+𝑵1sty𝑵2ndA=1stA𝑵2ndB+𝑵1stB𝑵2ndA
13 8 oveq2d y=B2ndA𝑵2ndy=2ndA𝑵2ndB
14 12 13 opeq12d y=B1stA𝑵2ndy+𝑵1sty𝑵2ndA2ndA𝑵2ndy=1stA𝑵2ndB+𝑵1stB𝑵2ndA2ndA𝑵2ndB
15 df-plpq +𝑝𝑸=x𝑵×𝑵,y𝑵×𝑵1stx𝑵2ndy+𝑵1sty𝑵2ndx2ndx𝑵2ndy
16 opex 1stA𝑵2ndB+𝑵1stB𝑵2ndA2ndA𝑵2ndBV
17 7 14 15 16 ovmpo A𝑵×𝑵B𝑵×𝑵A+𝑝𝑸B=1stA𝑵2ndB+𝑵1stB𝑵2ndA2ndA𝑵2ndB