Metamath Proof Explorer


Theorem lgsdir

Description: The Legendre symbol is completely multiplicative in its left argument. Generalization of theorem 9.9(a) in ApostolNT p. 188 (which assumes that A and B are odd positive integers). Together with lgsqr this implies that the product of two quadratic residues or nonresidues is a residue, and the product of a residue and a nonresidue is a nonresidue. (Contributed by Mario Carneiro, 4-Feb-2015)

Ref Expression
Assertion lgsdir
|- ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) -> ( ( A x. B ) /L N ) = ( ( A /L N ) x. ( B /L N ) ) )

Proof

Step Hyp Ref Expression
1 ax-1cn
 |-  1 e. CC
2 0cn
 |-  0 e. CC
3 1 2 ifcli
 |-  if ( ( B ^ 2 ) = 1 , 1 , 0 ) e. CC
4 3 mulid2i
 |-  ( 1 x. if ( ( B ^ 2 ) = 1 , 1 , 0 ) ) = if ( ( B ^ 2 ) = 1 , 1 , 0 )
5 iftrue
 |-  ( ( A ^ 2 ) = 1 -> if ( ( A ^ 2 ) = 1 , 1 , 0 ) = 1 )
6 5 adantl
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N = 0 ) /\ ( A ^ 2 ) = 1 ) -> if ( ( A ^ 2 ) = 1 , 1 , 0 ) = 1 )
7 6 oveq1d
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N = 0 ) /\ ( A ^ 2 ) = 1 ) -> ( if ( ( A ^ 2 ) = 1 , 1 , 0 ) x. if ( ( B ^ 2 ) = 1 , 1 , 0 ) ) = ( 1 x. if ( ( B ^ 2 ) = 1 , 1 , 0 ) ) )
8 simpl1
 |-  ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) -> A e. ZZ )
9 8 zcnd
 |-  ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) -> A e. CC )
10 9 ad2antrr
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N = 0 ) /\ ( A ^ 2 ) = 1 ) -> A e. CC )
11 simpl2
 |-  ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) -> B e. ZZ )
12 11 zcnd
 |-  ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) -> B e. CC )
13 12 ad2antrr
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N = 0 ) /\ ( A ^ 2 ) = 1 ) -> B e. CC )
14 10 13 sqmuld
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N = 0 ) /\ ( A ^ 2 ) = 1 ) -> ( ( A x. B ) ^ 2 ) = ( ( A ^ 2 ) x. ( B ^ 2 ) ) )
15 simpr
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N = 0 ) /\ ( A ^ 2 ) = 1 ) -> ( A ^ 2 ) = 1 )
16 15 oveq1d
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N = 0 ) /\ ( A ^ 2 ) = 1 ) -> ( ( A ^ 2 ) x. ( B ^ 2 ) ) = ( 1 x. ( B ^ 2 ) ) )
17 12 sqcld
 |-  ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) -> ( B ^ 2 ) e. CC )
18 17 ad2antrr
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ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^ 2 ) = 1 , 1 , 0 ) = 0 )
26 25 adantl
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N = 0 ) /\ -. ( A ^ 2 ) = 1 ) -> if ( ( A ^ 2 ) = 1 , 1 , 0 ) = 0 )
27 26 oveq1d
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N = 0 ) /\ -. ( A ^ 2 ) = 1 ) -> ( if ( ( A ^ 2 ) = 1 , 1 , 0 ) x. if ( ( B ^ 2 ) = 1 , 1 , 0 ) ) = ( 0 x. if ( ( B ^ 2 ) = 1 , 1 , 0 ) ) )
28 dvdsmul1
 |-  ( ( A e. ZZ /\ B e. ZZ ) -> A || ( A x. B ) )
29 8 11 28 syl2anc
 |-  ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) -> A || ( A x. B ) )
30 8 11 zmulcld
 |-  ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) -> ( A x. B ) e. ZZ )
31 dvdssq
 |-  ( ( A e. ZZ /\ ( A x. B ) e. ZZ ) -> ( A || ( A x. B ) <-> ( A ^ 2 ) || ( ( A x. B ) ^ 2 ) ) )
32 8 30 31 syl2anc
 |-  ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) -> ( A || ( A x. B ) <-> ( A ^ 2 ) || ( ( A x. B ) ^ 2 ) ) )
33 29 32 mpbid
 |-  ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) -> ( A ^ 2 ) || ( ( A x. B ) ^ 2 ) )
34 33 adantr
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N = 0 ) -> ( A ^ 2 ) || ( ( A x. B ) ^ 2 ) )
35 breq2
 |-  ( ( ( A x. B ) ^ 2 ) = 1 -> ( ( A ^ 2 ) || ( ( A x. B ) ^ 2 ) <-> ( A ^ 2 ) || 1 ) )
36 34 35 syl5ibcom
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N = 0 ) -> ( ( ( A x. B ) ^ 2 ) = 1 -> ( A ^ 2 ) || 1 ) )
37 simprl
 |-  ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) -> A =/= 0 )
38 37 neneqd
 |-  ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) -> -. A = 0 )
39 sqeq0
 |-  ( A e. CC -> ( ( A ^ 2 ) = 0 <-> A = 0 ) )
40 9 39 syl
 |-  ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) -> ( ( A ^ 2 ) = 0 <-> A = 0 ) )
41 38 40 mtbird
 |-  ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) -> -. ( A ^ 2 ) = 0 )
42 zsqcl2
 |-  ( A e. ZZ -> ( A ^ 2 ) e. NN0 )
43 8 42 syl
 |-  ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) -> ( A ^ 2 ) e. NN0 )
44 elnn0
 |-  ( ( A ^ 2 ) e. NN0 <-> ( ( A ^ 2 ) e. NN \/ ( A ^ 2 ) = 0 ) )
45 43 44 sylib
 |-  ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) -> ( ( A ^ 2 ) e. NN \/ ( A ^ 2 ) = 0 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( A x. B ) ^ 2 ) = 1 , 1 , 0 ) )
64 23 63 pm2.61dan
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N = 0 ) -> ( if ( ( A ^ 2 ) = 1 , 1 , 0 ) x. if ( ( B ^ 2 ) = 1 , 1 , 0 ) ) = if ( ( ( A x. B ) ^ 2 ) = 1 , 1 , 0 ) )
65 oveq2
 |-  ( N = 0 -> ( A /L N ) = ( A /L 0 ) )
66 lgs0
 |-  ( A e. ZZ -> ( A /L 0 ) = if ( ( A ^ 2 ) = 1 , 1 , 0 ) )
67 8 66 syl
 |-  ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) -> ( A /L 0 ) = if ( ( A ^ 2 ) = 1 , 1 , 0 ) )
68 65 67 sylan9eqr
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N = 0 ) -> ( A /L N ) = if ( ( A ^ 2 ) = 1 , 1 , 0 ) )
69 oveq2
 |-  ( N = 0 -> ( B /L N ) = ( B /L 0 ) )
70 lgs0
 |-  ( B e. ZZ -> ( B /L 0 ) = if ( ( B ^ 2 ) = 1 , 1 , 0 ) )
71 11 70 syl
 |-  ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) -> ( B /L 0 ) = if ( ( B ^ 2 ) = 1 , 1 , 0 ) )
72 69 71 sylan9eqr
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N = 0 ) -> ( B /L N ) = if ( ( B ^ 2 ) = 1 , 1 , 0 ) )
73 68 72 oveq12d
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N = 0 ) -> ( ( A /L N ) x. ( B /L N ) ) = ( if ( ( A ^ 2 ) = 1 , 1 , 0 ) x. if ( ( B ^ 2 ) = 1 , 1 , 0 ) ) )
74 oveq2
 |-  ( N = 0 -> ( ( A x. B ) /L N ) = ( ( A x. B ) /L 0 ) )
75 lgs0
 |-  ( ( A x. B ) e. ZZ -> ( ( A x. B ) /L 0 ) = if ( ( ( A x. B ) ^ 2 ) = 1 , 1 , 0 ) )
76 30 75 syl
 |-  ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) -> ( ( A x. B ) /L 0 ) = if ( ( ( A x. B ) ^ 2 ) = 1 , 1 , 0 ) )
77 74 76 sylan9eqr
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N = 0 ) -> ( ( A x. B ) /L N ) = if ( ( ( A x. B ) ^ 2 ) = 1 , 1 , 0 ) )
78 64 73 77 3eqtr4rd
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N = 0 ) -> ( ( A x. B ) /L N ) = ( ( A /L N ) x. ( B /L N ) ) )
79 lgsdilem
 |-  ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) -> if ( ( N < 0 /\ ( A x. B ) < 0 ) , -u 1 , 1 ) = ( if ( ( N < 0 /\ A < 0 ) , -u 1 , 1 ) x. if ( ( N < 0 /\ B < 0 ) , -u 1 , 1 ) ) )
80 79 adantr
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> if ( ( N < 0 /\ ( A x. B ) < 0 ) , -u 1 , 1 ) = ( if ( ( N < 0 /\ A < 0 ) , -u 1 , 1 ) x. if ( ( N < 0 /\ B < 0 ) , -u 1 , 1 ) ) )
81 simpl3
 |-  ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) -> N e. ZZ )
82 nnabscl
 |-  ( ( N e. ZZ /\ N =/= 0 ) -> ( abs ` N ) e. NN )
83 81 82 sylan
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> ( abs ` N ) e. NN )
84 nnuz
 |-  NN = ( ZZ>= ` 1 )
85 83 84 eleqtrdi
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> ( abs ` N ) e. ( ZZ>= ` 1 ) )
86 simpll1
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> A e. ZZ )
87 simpll3
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> N e. ZZ )
88 simpr
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> N =/= 0 )
89 eqid
 |-  ( n e. NN |-> if ( n e. Prime , ( ( A /L n ) ^ ( n pCnt N ) ) , 1 ) ) = ( n e. NN |-> if ( n e. Prime , ( ( A /L n ) ^ ( n pCnt N ) ) , 1 ) )
90 89 lgsfcl3
 |-  ( ( A e. ZZ /\ N e. ZZ /\ N =/= 0 ) -> ( n e. NN |-> if ( n e. Prime , ( ( A /L n ) ^ ( n pCnt N ) ) , 1 ) ) : NN --> ZZ )
91 86 87 88 90 syl3anc
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> ( n e. NN |-> if ( n e. Prime , ( ( A /L n ) ^ ( n pCnt N ) ) , 1 ) ) : NN --> ZZ )
92 elfznn
 |-  ( k e. ( 1 ... ( abs ` N ) ) -> k e. NN )
93 ffvelrn
 |-  ( ( ( n e. NN |-> if ( n e. Prime , ( ( A /L n ) ^ ( n pCnt N ) ) , 1 ) ) : NN --> ZZ /\ k e. NN ) -> ( ( n e. NN |-> if ( n e. Prime , ( ( A /L n ) ^ ( n pCnt N ) ) , 1 ) ) ` k ) e. ZZ )
94 91 92 93 syl2an
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. ( 1 ... ( abs ` N ) ) ) -> ( ( n e. NN |-> if ( n e. Prime , ( ( A /L n ) ^ ( n pCnt N ) ) , 1 ) ) ` k ) e. ZZ )
95 94 zcnd
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. ( 1 ... ( abs ` N ) ) ) -> ( ( n e. NN |-> if ( n e. Prime , ( ( A /L n ) ^ ( n pCnt N ) ) , 1 ) ) ` k ) e. CC )
96 simpll2
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> B e. ZZ )
97 eqid
 |-  ( n e. NN |-> if ( n e. Prime , ( ( B /L n ) ^ ( n pCnt N ) ) , 1 ) ) = ( n e. NN |-> if ( n e. Prime , ( ( B /L n ) ^ ( n pCnt N ) ) , 1 ) )
98 97 lgsfcl3
 |-  ( ( B e. ZZ /\ N e. ZZ /\ N =/= 0 ) -> ( n e. NN |-> if ( n e. Prime , ( ( B /L n ) ^ ( n pCnt N ) ) , 1 ) ) : NN --> ZZ )
99 96 87 88 98 syl3anc
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> ( n e. NN |-> if ( n e. Prime , ( ( B /L n ) ^ ( n pCnt N ) ) , 1 ) ) : NN --> ZZ )
100 ffvelrn
 |-  ( ( ( n e. NN |-> if ( n e. Prime , ( ( B /L n ) ^ ( n pCnt N ) ) , 1 ) ) : NN --> ZZ /\ k e. NN ) -> ( ( n e. NN |-> if ( n e. Prime , ( ( B /L n ) ^ ( n pCnt N ) ) , 1 ) ) ` k ) e. ZZ )
101 99 92 100 syl2an
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. ( 1 ... ( abs ` N ) ) ) -> ( ( n e. NN |-> if ( n e. Prime , ( ( B /L n ) ^ ( n pCnt N ) ) , 1 ) ) ` k ) e. ZZ )
102 101 zcnd
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. ( 1 ... ( abs ` N ) ) ) -> ( ( n e. NN |-> if ( n e. Prime , ( ( B /L n ) ^ ( n pCnt N ) ) , 1 ) ) ` k ) e. CC )
103 86 adantr
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. Prime ) -> A e. ZZ )
104 96 adantr
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. Prime ) -> B e. ZZ )
105 simpr
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. Prime ) -> k e. Prime )
106 lgsdirprm
 |-  ( ( A e. ZZ /\ B e. ZZ /\ k e. Prime ) -> ( ( A x. B ) /L k ) = ( ( A /L k ) x. ( B /L k ) ) )
107 103 104 105 106 syl3anc
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. Prime ) -> ( ( A x. B ) /L k ) = ( ( A /L k ) x. ( B /L k ) ) )
108 107 oveq1d
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. Prime ) -> ( ( ( A x. B ) /L k ) ^ ( k pCnt N ) ) = ( ( ( A /L k ) x. ( B /L k ) ) ^ ( k pCnt N ) ) )
109 prmz
 |-  ( k e. Prime -> k e. ZZ )
110 lgscl
 |-  ( ( A e. ZZ /\ k e. ZZ ) -> ( A /L k ) e. ZZ )
111 86 109 110 syl2an
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. Prime ) -> ( A /L k ) e. ZZ )
112 111 zcnd
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. Prime ) -> ( A /L k ) e. CC )
113 lgscl
 |-  ( ( B e. ZZ /\ k e. ZZ ) -> ( B /L k ) e. ZZ )
114 96 109 113 syl2an
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. Prime ) -> ( B /L k ) e. ZZ )
115 114 zcnd
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. Prime ) -> ( B /L k ) e. CC )
116 87 adantr
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. Prime ) -> N e. ZZ )
117 88 adantr
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. Prime ) -> N =/= 0 )
118 pczcl
 |-  ( ( k e. Prime /\ ( N e. ZZ /\ N =/= 0 ) ) -> ( k pCnt N ) e. NN0 )
119 105 116 117 118 syl12anc
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. Prime ) -> ( k pCnt N ) e. NN0 )
120 112 115 119 mulexpd
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. Prime ) -> ( ( ( A /L k ) x. ( B /L k ) ) ^ ( k pCnt N ) ) = ( ( ( A /L k ) ^ ( k pCnt N ) ) x. ( ( B /L k ) ^ ( k pCnt N ) ) ) )
121 108 120 eqtrd
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. Prime ) -> ( ( ( A x. B ) /L k ) ^ ( k pCnt N ) ) = ( ( ( A /L k ) ^ ( k pCnt N ) ) x. ( ( B /L k ) ^ ( k pCnt N ) ) ) )
122 iftrue
 |-  ( k e. Prime -> if ( k e. Prime , ( ( ( A x. B ) /L k ) ^ ( k pCnt N ) ) , 1 ) = ( ( ( A x. B ) /L k ) ^ ( k pCnt N ) ) )
123 122 adantl
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. Prime ) -> if ( k e. Prime , ( ( ( A x. B ) /L k ) ^ ( k pCnt N ) ) , 1 ) = ( ( ( A x. B ) /L k ) ^ ( k pCnt N ) ) )
124 iftrue
 |-  ( k e. Prime -> if ( k e. Prime , ( ( A /L k ) ^ ( k pCnt N ) ) , 1 ) = ( ( A /L k ) ^ ( k pCnt N ) ) )
125 iftrue
 |-  ( k e. Prime -> if ( k e. Prime , ( ( B /L k ) ^ ( k pCnt N ) ) , 1 ) = ( ( B /L k ) ^ ( k pCnt N ) ) )
126 124 125 oveq12d
 |-  ( k e. Prime -> ( if ( k e. Prime , ( ( A /L k ) ^ ( k pCnt N ) ) , 1 ) x. if ( k e. Prime , ( ( B /L k ) ^ ( k pCnt N ) ) , 1 ) ) = ( ( ( A /L k ) ^ ( k pCnt N ) ) x. ( ( B /L k ) ^ ( k pCnt N ) ) ) )
127 126 adantl
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. Prime ) -> ( if ( k e. Prime , ( ( A /L k ) ^ ( k pCnt N ) ) , 1 ) x. if ( k e. Prime , ( ( B /L k ) ^ ( k pCnt N ) ) , 1 ) ) = ( ( ( A /L k ) ^ ( k pCnt N ) ) x. ( ( B /L k ) ^ ( k pCnt N ) ) ) )
128 121 123 127 3eqtr4d
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. Prime ) -> if ( k e. Prime , ( ( ( A x. B ) /L k ) ^ ( k pCnt N ) ) , 1 ) = ( if ( k e. Prime , ( ( A /L k ) ^ ( k pCnt N ) ) , 1 ) x. if ( k e. Prime , ( ( B /L k ) ^ ( k pCnt N ) ) , 1 ) ) )
129 1t1e1
 |-  ( 1 x. 1 ) = 1
130 129 eqcomi
 |-  1 = ( 1 x. 1 )
131 iffalse
 |-  ( -. k e. Prime -> if ( k e. Prime , ( ( ( A x. B ) /L k ) ^ ( k pCnt N ) ) , 1 ) = 1 )
132 iffalse
 |-  ( -. k e. Prime -> if ( k e. Prime , ( ( A /L k ) ^ ( k pCnt N ) ) , 1 ) = 1 )
133 iffalse
 |-  ( -. k e. Prime -> if ( k e. Prime , ( ( B /L k ) ^ ( k pCnt N ) ) , 1 ) = 1 )
134 132 133 oveq12d
 |-  ( -. k e. Prime -> ( if ( k e. Prime , ( ( A /L k ) ^ ( k pCnt N ) ) , 1 ) x. if ( k e. Prime , ( ( B /L k ) ^ ( k pCnt N ) ) , 1 ) ) = ( 1 x. 1 ) )
135 130 131 134 3eqtr4a
 |-  ( -. k e. Prime -> if ( k e. Prime , ( ( ( A x. B ) /L k ) ^ ( k pCnt N ) ) , 1 ) = ( if ( k e. Prime , ( ( A /L k ) ^ ( k pCnt N ) ) , 1 ) x. if ( k e. Prime , ( ( B /L k ) ^ ( k pCnt N ) ) , 1 ) ) )
136 135 adantl
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ -. k e. Prime ) -> if ( k e. Prime , ( ( ( A x. B ) /L k ) ^ ( k pCnt N ) ) , 1 ) = ( if ( k e. Prime , ( ( A /L k ) ^ ( k pCnt N ) ) , 1 ) x. if ( k e. Prime , ( ( B /L k ) ^ ( k pCnt N ) ) , 1 ) ) )
137 128 136 pm2.61dan
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> if ( k e. Prime , ( ( ( A x. B ) /L k ) ^ ( k pCnt N ) ) , 1 ) = ( if ( k e. Prime , ( ( A /L k ) ^ ( k pCnt N ) ) , 1 ) x. if ( k e. Prime , ( ( B /L k ) ^ ( k pCnt N ) ) , 1 ) ) )
138 137 adantr
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. ( 1 ... ( abs ` N ) ) ) -> if ( k e. Prime , ( ( ( A x. B ) /L k ) ^ ( k pCnt N ) ) , 1 ) = ( if ( k e. Prime , ( ( A /L k ) ^ ( k pCnt N ) ) , 1 ) x. if ( k e. Prime , ( ( B /L k ) ^ ( k pCnt N ) ) , 1 ) ) )
139 92 adantl
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. ( 1 ... ( abs ` N ) ) ) -> k e. NN )
140 eleq1w
 |-  ( n = k -> ( n e. Prime <-> k e. Prime ) )
141 oveq2
 |-  ( n = k -> ( ( A x. B ) /L n ) = ( ( A x. B ) /L k ) )
142 oveq1
 |-  ( n = k -> ( n pCnt N ) = ( k pCnt N ) )
143 141 142 oveq12d
 |-  ( n = k -> ( ( ( A x. B ) /L n ) ^ ( n pCnt N ) ) = ( ( ( A x. B ) /L k ) ^ ( k pCnt N ) ) )
144 140 143 ifbieq1d
 |-  ( n = k -> if ( n e. Prime , ( ( ( A x. B ) /L n ) ^ ( n pCnt N ) ) , 1 ) = if ( k e. Prime , ( ( ( A x. B ) /L k ) ^ ( k pCnt N ) ) , 1 ) )
145 eqid
 |-  ( n e. NN |-> if ( n e. Prime , ( ( ( A x. B ) /L n ) ^ ( n pCnt N ) ) , 1 ) ) = ( n e. NN |-> if ( n e. Prime , ( ( ( A x. B ) /L n ) ^ ( n pCnt N ) ) , 1 ) )
146 ovex
 |-  ( ( ( A x. B ) /L k ) ^ ( k pCnt N ) ) e. _V
147 1ex
 |-  1 e. _V
148 146 147 ifex
 |-  if ( k e. Prime , ( ( ( A x. B ) /L k ) ^ ( k pCnt N ) ) , 1 ) e. _V
149 144 145 148 fvmpt
 |-  ( k e. NN -> ( ( n e. NN |-> if ( n e. Prime , ( ( ( A x. B ) /L n ) ^ ( n pCnt N ) ) , 1 ) ) ` k ) = if ( k e. Prime , ( ( ( A x. B ) /L k ) ^ ( k pCnt N ) ) , 1 ) )
150 139 149 syl
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. ( 1 ... ( abs ` N ) ) ) -> ( ( n e. NN |-> if ( n e. Prime , ( ( ( A x. B ) /L n ) ^ ( n pCnt N ) ) , 1 ) ) ` k ) = if ( k e. Prime , ( ( ( A x. B ) /L k ) ^ ( k pCnt N ) ) , 1 ) )
151 oveq2
 |-  ( n = k -> ( A /L n ) = ( A /L k ) )
152 151 142 oveq12d
 |-  ( n = k -> ( ( A /L n ) ^ ( n pCnt N ) ) = ( ( A /L k ) ^ ( k pCnt N ) ) )
153 140 152 ifbieq1d
 |-  ( n = k -> if ( n e. Prime , ( ( A /L n ) ^ ( n pCnt N ) ) , 1 ) = if ( k e. Prime , ( ( A /L k ) ^ ( k pCnt N ) ) , 1 ) )
154 ovex
 |-  ( ( A /L k ) ^ ( k pCnt N ) ) e. _V
155 154 147 ifex
 |-  if ( k e. Prime , ( ( A /L k ) ^ ( k pCnt N ) ) , 1 ) e. _V
156 153 89 155 fvmpt
 |-  ( k e. NN -> ( ( n e. NN |-> if ( n e. Prime , ( ( A /L n ) ^ ( n pCnt N ) ) , 1 ) ) ` k ) = if ( k e. Prime , ( ( A /L k ) ^ ( k pCnt N ) ) , 1 ) )
157 139 156 syl
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. ( 1 ... ( abs ` N ) ) ) -> ( ( n e. NN |-> if ( n e. Prime , ( ( A /L n ) ^ ( n pCnt N ) ) , 1 ) ) ` k ) = if ( k e. Prime , ( ( A /L k ) ^ ( k pCnt N ) ) , 1 ) )
158 oveq2
 |-  ( n = k -> ( B /L n ) = ( B /L k ) )
159 158 142 oveq12d
 |-  ( n = k -> ( ( B /L n ) ^ ( n pCnt N ) ) = ( ( B /L k ) ^ ( k pCnt N ) ) )
160 140 159 ifbieq1d
 |-  ( n = k -> if ( n e. Prime , ( ( B /L n ) ^ ( n pCnt N ) ) , 1 ) = if ( k e. Prime , ( ( B /L k ) ^ ( k pCnt N ) ) , 1 ) )
161 ovex
 |-  ( ( B /L k ) ^ ( k pCnt N ) ) e. _V
162 161 147 ifex
 |-  if ( k e. Prime , ( ( B /L k ) ^ ( k pCnt N ) ) , 1 ) e. _V
163 160 97 162 fvmpt
 |-  ( k e. NN -> ( ( n e. NN |-> if ( n e. Prime , ( ( B /L n ) ^ ( n pCnt N ) ) , 1 ) ) ` k ) = if ( k e. Prime , ( ( B /L k ) ^ ( k pCnt N ) ) , 1 ) )
164 139 163 syl
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. ( 1 ... ( abs ` N ) ) ) -> ( ( n e. NN |-> if ( n e. Prime , ( ( B /L n ) ^ ( n pCnt N ) ) , 1 ) ) ` k ) = if ( k e. Prime , ( ( B /L k ) ^ ( k pCnt N ) ) , 1 ) )
165 157 164 oveq12d
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. ( 1 ... ( abs ` N ) ) ) -> ( ( ( n e. NN |-> if ( n e. Prime , ( ( A /L n ) ^ ( n pCnt N ) ) , 1 ) ) ` k ) x. ( ( n e. NN |-> if ( n e. Prime , ( ( B /L n ) ^ ( n pCnt N ) ) , 1 ) ) ` k ) ) = ( if ( k e. Prime , ( ( A /L k ) ^ ( k pCnt N ) ) , 1 ) x. if ( k e. Prime , ( ( B /L k ) ^ ( k pCnt N ) ) , 1 ) ) )
166 138 150 165 3eqtr4d
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ k e. ( 1 ... ( abs ` N ) ) ) -> ( ( n e. NN |-> if ( n e. Prime , ( ( ( A x. B ) /L n ) ^ ( n pCnt N ) ) , 1 ) ) ` k ) = ( ( ( n e. NN |-> if ( n e. Prime , ( ( A /L n ) ^ ( n pCnt N ) ) , 1 ) ) ` k ) x. ( ( n e. NN |-> if ( n e. Prime , ( ( B /L n ) ^ ( n pCnt N ) ) , 1 ) ) ` k ) ) )
167 85 95 102 166 prodfmul
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> ( seq 1 ( x. , ( n e. NN |-> if ( n e. Prime , ( ( ( A x. B ) /L n ) ^ ( n pCnt N ) ) , 1 ) ) ) ` ( abs ` N ) ) = ( ( seq 1 ( x. , ( n e. NN |-> if ( n e. Prime , ( ( A /L n ) ^ ( n pCnt N ) ) , 1 ) ) ) ` ( abs ` N ) ) x. ( seq 1 ( x. , ( n e. NN |-> if ( n e. Prime , ( ( B /L n ) ^ ( n pCnt N ) ) , 1 ) ) ) ` ( abs ` N ) ) ) )
168 80 167 oveq12d
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> ( if ( ( N < 0 /\ ( A x. B ) < 0 ) , -u 1 , 1 ) x. ( seq 1 ( x. , ( n e. NN |-> if ( n e. Prime , ( ( ( A x. B ) /L n ) ^ ( n pCnt N ) ) , 1 ) ) ) ` ( abs ` N ) ) ) = ( ( if ( ( N < 0 /\ A < 0 ) , -u 1 , 1 ) x. if ( ( N < 0 /\ B < 0 ) , -u 1 , 1 ) ) x. ( ( seq 1 ( x. , ( n e. NN |-> if ( n e. Prime , ( ( A /L n ) ^ ( n pCnt N ) ) , 1 ) ) ) ` ( abs ` N ) ) x. ( seq 1 ( x. , ( n e. NN |-> if ( n e. Prime , ( ( B /L n ) ^ ( n pCnt N ) ) , 1 ) ) ) ` ( abs ` N ) ) ) ) )
169 30 adantr
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> ( A x. B ) e. ZZ )
170 145 lgsval4
 |-  ( ( ( A x. B ) e. ZZ /\ N e. ZZ /\ N =/= 0 ) -> ( ( A x. B ) /L N ) = ( if ( ( N < 0 /\ ( A x. B ) < 0 ) , -u 1 , 1 ) x. ( seq 1 ( x. , ( n e. NN |-> if ( n e. Prime , ( ( ( A x. B ) /L n ) ^ ( n pCnt N ) ) , 1 ) ) ) ` ( abs ` N ) ) ) )
171 169 87 88 170 syl3anc
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> ( ( A x. B ) /L N ) = ( if ( ( N < 0 /\ ( A x. B ) < 0 ) , -u 1 , 1 ) x. ( seq 1 ( x. , ( n e. NN |-> if ( n e. Prime , ( ( ( A x. B ) /L n ) ^ ( n pCnt N ) ) , 1 ) ) ) ` ( abs ` N ) ) ) )
172 89 lgsval4
 |-  ( ( A e. ZZ /\ N e. ZZ /\ N =/= 0 ) -> ( A /L N ) = ( if ( ( N < 0 /\ A < 0 ) , -u 1 , 1 ) x. ( seq 1 ( x. , ( n e. NN |-> if ( n e. Prime , ( ( A /L n ) ^ ( n pCnt N ) ) , 1 ) ) ) ` ( abs ` N ) ) ) )
173 86 87 88 172 syl3anc
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> ( A /L N ) = ( if ( ( N < 0 /\ A < 0 ) , -u 1 , 1 ) x. ( seq 1 ( x. , ( n e. NN |-> if ( n e. Prime , ( ( A /L n ) ^ ( n pCnt N ) ) , 1 ) ) ) ` ( abs ` N ) ) ) )
174 97 lgsval4
 |-  ( ( B e. ZZ /\ N e. ZZ /\ N =/= 0 ) -> ( B /L N ) = ( if ( ( N < 0 /\ B < 0 ) , -u 1 , 1 ) x. ( seq 1 ( x. , ( n e. NN |-> if ( n e. Prime , ( ( B /L n ) ^ ( n pCnt N ) ) , 1 ) ) ) ` ( abs ` N ) ) ) )
175 96 87 88 174 syl3anc
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> ( B /L N ) = ( if ( ( N < 0 /\ B < 0 ) , -u 1 , 1 ) x. ( seq 1 ( x. , ( n e. NN |-> if ( n e. Prime , ( ( B /L n ) ^ ( n pCnt N ) ) , 1 ) ) ) ` ( abs ` N ) ) ) )
176 173 175 oveq12d
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> ( ( A /L N ) x. ( B /L N ) ) = ( ( if ( ( N < 0 /\ A < 0 ) , -u 1 , 1 ) x. ( seq 1 ( x. , ( n e. NN |-> if ( n e. Prime , ( ( A /L n ) ^ ( n pCnt N ) ) , 1 ) ) ) ` ( abs ` N ) ) ) x. ( if ( ( N < 0 /\ B < 0 ) , -u 1 , 1 ) x. ( seq 1 ( x. , ( n e. NN |-> if ( n e. Prime , ( ( B /L n ) ^ ( n pCnt N ) ) , 1 ) ) ) ` ( abs ` N ) ) ) ) )
177 neg1cn
 |-  -u 1 e. CC
178 177 1 ifcli
 |-  if ( ( N < 0 /\ A < 0 ) , -u 1 , 1 ) e. CC
179 178 a1i
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> if ( ( N < 0 /\ A < 0 ) , -u 1 , 1 ) e. CC )
180 mulcl
 |-  ( ( k e. CC /\ x e. CC ) -> ( k x. x ) e. CC )
181 180 adantl
 |-  ( ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) /\ ( k e. CC /\ x e. CC ) ) -> ( k x. x ) e. CC )
182 85 95 181 seqcl
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> ( seq 1 ( x. , ( n e. NN |-> if ( n e. Prime , ( ( A /L n ) ^ ( n pCnt N ) ) , 1 ) ) ) ` ( abs ` N ) ) e. CC )
183 177 1 ifcli
 |-  if ( ( N < 0 /\ B < 0 ) , -u 1 , 1 ) e. CC
184 183 a1i
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> if ( ( N < 0 /\ B < 0 ) , -u 1 , 1 ) e. CC )
185 85 102 181 seqcl
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> ( seq 1 ( x. , ( n e. NN |-> if ( n e. Prime , ( ( B /L n ) ^ ( n pCnt N ) ) , 1 ) ) ) ` ( abs ` N ) ) e. CC )
186 179 182 184 185 mul4d
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> ( ( if ( ( N < 0 /\ A < 0 ) , -u 1 , 1 ) x. ( seq 1 ( x. , ( n e. NN |-> if ( n e. Prime , ( ( A /L n ) ^ ( n pCnt N ) ) , 1 ) ) ) ` ( abs ` N ) ) ) x. ( if ( ( N < 0 /\ B < 0 ) , -u 1 , 1 ) x. ( seq 1 ( x. , ( n e. NN |-> if ( n e. Prime , ( ( B /L n ) ^ ( n pCnt N ) ) , 1 ) ) ) ` ( abs ` N ) ) ) ) = ( ( if ( ( N < 0 /\ A < 0 ) , -u 1 , 1 ) x. if ( ( N < 0 /\ B < 0 ) , -u 1 , 1 ) ) x. ( ( seq 1 ( x. , ( n e. NN |-> if ( n e. Prime , ( ( A /L n ) ^ ( n pCnt N ) ) , 1 ) ) ) ` ( abs ` N ) ) x. ( seq 1 ( x. , ( n e. NN |-> if ( n e. Prime , ( ( B /L n ) ^ ( n pCnt N ) ) , 1 ) ) ) ` ( abs ` N ) ) ) ) )
187 176 186 eqtrd
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> ( ( A /L N ) x. ( B /L N ) ) = ( ( if ( ( N < 0 /\ A < 0 ) , -u 1 , 1 ) x. if ( ( N < 0 /\ B < 0 ) , -u 1 , 1 ) ) x. ( ( seq 1 ( x. , ( n e. NN |-> if ( n e. Prime , ( ( A /L n ) ^ ( n pCnt N ) ) , 1 ) ) ) ` ( abs ` N ) ) x. ( seq 1 ( x. , ( n e. NN |-> if ( n e. Prime , ( ( B /L n ) ^ ( n pCnt N ) ) , 1 ) ) ) ` ( abs ` N ) ) ) ) )
188 168 171 187 3eqtr4d
 |-  ( ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) /\ N =/= 0 ) -> ( ( A x. B ) /L N ) = ( ( A /L N ) x. ( B /L N ) ) )
189 78 188 pm2.61dane
 |-  ( ( ( A e. ZZ /\ B e. ZZ /\ N e. ZZ ) /\ ( A =/= 0 /\ B =/= 0 ) ) -> ( ( A x. B ) /L N ) = ( ( A /L N ) x. ( B /L N ) ) )