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 ( ( 𝐴 ∈ ( N × N ) ∧ 𝐵 ∈ ( N × N ) ) → ( 𝐴 +pQ 𝐵 ) = ⟨ ( ( ( 1st𝐴 ) ·N ( 2nd𝐵 ) ) +N ( ( 1st𝐵 ) ·N ( 2nd𝐴 ) ) ) , ( ( 2nd𝐴 ) ·N ( 2nd𝐵 ) ) ⟩ )

Proof

Step Hyp Ref Expression
1 fveq2 ( 𝑥 = 𝐴 → ( 1st𝑥 ) = ( 1st𝐴 ) )
2 1 oveq1d ( 𝑥 = 𝐴 → ( ( 1st𝑥 ) ·N ( 2nd𝑦 ) ) = ( ( 1st𝐴 ) ·N ( 2nd𝑦 ) ) )
3 fveq2 ( 𝑥 = 𝐴 → ( 2nd𝑥 ) = ( 2nd𝐴 ) )
4 3 oveq2d ( 𝑥 = 𝐴 → ( ( 1st𝑦 ) ·N ( 2nd𝑥 ) ) = ( ( 1st𝑦 ) ·N ( 2nd𝐴 ) ) )
5 2 4 oveq12d ( 𝑥 = 𝐴 → ( ( ( 1st𝑥 ) ·N ( 2nd𝑦 ) ) +N ( ( 1st𝑦 ) ·N ( 2nd𝑥 ) ) ) = ( ( ( 1st𝐴 ) ·N ( 2nd𝑦 ) ) +N ( ( 1st𝑦 ) ·N ( 2nd𝐴 ) ) ) )
6 3 oveq1d ( 𝑥 = 𝐴 → ( ( 2nd𝑥 ) ·N ( 2nd𝑦 ) ) = ( ( 2nd𝐴 ) ·N ( 2nd𝑦 ) ) )
7 5 6 opeq12d ( 𝑥 = 𝐴 → ⟨ ( ( ( 1st𝑥 ) ·N ( 2nd𝑦 ) ) +N ( ( 1st𝑦 ) ·N ( 2nd𝑥 ) ) ) , ( ( 2nd𝑥 ) ·N ( 2nd𝑦 ) ) ⟩ = ⟨ ( ( ( 1st𝐴 ) ·N ( 2nd𝑦 ) ) +N ( ( 1st𝑦 ) ·N ( 2nd𝐴 ) ) ) , ( ( 2nd𝐴 ) ·N ( 2nd𝑦 ) ) ⟩ )
8 fveq2 ( 𝑦 = 𝐵 → ( 2nd𝑦 ) = ( 2nd𝐵 ) )
9 8 oveq2d ( 𝑦 = 𝐵 → ( ( 1st𝐴 ) ·N ( 2nd𝑦 ) ) = ( ( 1st𝐴 ) ·N ( 2nd𝐵 ) ) )
10 fveq2 ( 𝑦 = 𝐵 → ( 1st𝑦 ) = ( 1st𝐵 ) )
11 10 oveq1d ( 𝑦 = 𝐵 → ( ( 1st𝑦 ) ·N ( 2nd𝐴 ) ) = ( ( 1st𝐵 ) ·N ( 2nd𝐴 ) ) )
12 9 11 oveq12d ( 𝑦 = 𝐵 → ( ( ( 1st𝐴 ) ·N ( 2nd𝑦 ) ) +N ( ( 1st𝑦 ) ·N ( 2nd𝐴 ) ) ) = ( ( ( 1st𝐴 ) ·N ( 2nd𝐵 ) ) +N ( ( 1st𝐵 ) ·N ( 2nd𝐴 ) ) ) )
13 8 oveq2d ( 𝑦 = 𝐵 → ( ( 2nd𝐴 ) ·N ( 2nd𝑦 ) ) = ( ( 2nd𝐴 ) ·N ( 2nd𝐵 ) ) )
14 12 13 opeq12d ( 𝑦 = 𝐵 → ⟨ ( ( ( 1st𝐴 ) ·N ( 2nd𝑦 ) ) +N ( ( 1st𝑦 ) ·N ( 2nd𝐴 ) ) ) , ( ( 2nd𝐴 ) ·N ( 2nd𝑦 ) ) ⟩ = ⟨ ( ( ( 1st𝐴 ) ·N ( 2nd𝐵 ) ) +N ( ( 1st𝐵 ) ·N ( 2nd𝐴 ) ) ) , ( ( 2nd𝐴 ) ·N ( 2nd𝐵 ) ) ⟩ )
15 df-plpq +pQ = ( 𝑥 ∈ ( N × N ) , 𝑦 ∈ ( N × N ) ↦ ⟨ ( ( ( 1st𝑥 ) ·N ( 2nd𝑦 ) ) +N ( ( 1st𝑦 ) ·N ( 2nd𝑥 ) ) ) , ( ( 2nd𝑥 ) ·N ( 2nd𝑦 ) ) ⟩ )
16 opex ⟨ ( ( ( 1st𝐴 ) ·N ( 2nd𝐵 ) ) +N ( ( 1st𝐵 ) ·N ( 2nd𝐴 ) ) ) , ( ( 2nd𝐴 ) ·N ( 2nd𝐵 ) ) ⟩ ∈ V
17 7 14 15 16 ovmpo ( ( 𝐴 ∈ ( N × N ) ∧ 𝐵 ∈ ( N × N ) ) → ( 𝐴 +pQ 𝐵 ) = ⟨ ( ( ( 1st𝐴 ) ·N ( 2nd𝐵 ) ) +N ( ( 1st𝐵 ) ·N ( 2nd𝐴 ) ) ) , ( ( 2nd𝐴 ) ·N ( 2nd𝐵 ) ) ⟩ )