MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  lgsquadlem3 Structured version   Visualization version   GIF version

Theorem lgsquadlem3 25007
Description: Lemma for lgsquad 25008. (Contributed by Mario Carneiro, 18-Jun-2015.)
Hypotheses
Ref Expression
lgseisen.1 (𝜑𝑃 ∈ (ℙ ∖ {2}))
lgseisen.2 (𝜑𝑄 ∈ (ℙ ∖ {2}))
lgseisen.3 (𝜑𝑃𝑄)
lgsquad.4 𝑀 = ((𝑃 − 1) / 2)
lgsquad.5 𝑁 = ((𝑄 − 1) / 2)
lgsquad.6 𝑆 = {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄))}
Assertion
Ref Expression
lgsquadlem3 (𝜑 → ((𝑃 /L 𝑄) · (𝑄 /L 𝑃)) = (-1↑(𝑀 · 𝑁)))
Distinct variable groups:   𝑥,𝑦,𝑃   𝜑,𝑥,𝑦   𝑦,𝑀   𝑥,𝑁,𝑦   𝑥,𝑄,𝑦   𝑥,𝑆   𝑥,𝑀   𝑦,𝑆

Proof of Theorem lgsquadlem3
Dummy variables 𝑤 𝑧 are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 lgseisen.2 . . . . 5 (𝜑𝑄 ∈ (ℙ ∖ {2}))
2 lgseisen.1 . . . . 5 (𝜑𝑃 ∈ (ℙ ∖ {2}))
3 lgseisen.3 . . . . . 6 (𝜑𝑃𝑄)
43necomd 2845 . . . . 5 (𝜑𝑄𝑃)
5 lgsquad.5 . . . . 5 𝑁 = ((𝑄 − 1) / 2)
6 lgsquad.4 . . . . 5 𝑀 = ((𝑃 − 1) / 2)
7 eleq1 2686 . . . . . . . . . 10 (𝑥 = 𝑧 → (𝑥 ∈ (1...𝑀) ↔ 𝑧 ∈ (1...𝑀)))
8 eleq1 2686 . . . . . . . . . 10 (𝑦 = 𝑤 → (𝑦 ∈ (1...𝑁) ↔ 𝑤 ∈ (1...𝑁)))
97, 8bi2anan9 916 . . . . . . . . 9 ((𝑥 = 𝑧𝑦 = 𝑤) → ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ↔ (𝑧 ∈ (1...𝑀) ∧ 𝑤 ∈ (1...𝑁))))
10 ancom 466 . . . . . . . . 9 ((𝑧 ∈ (1...𝑀) ∧ 𝑤 ∈ (1...𝑁)) ↔ (𝑤 ∈ (1...𝑁) ∧ 𝑧 ∈ (1...𝑀)))
119, 10syl6bb 276 . . . . . . . 8 ((𝑥 = 𝑧𝑦 = 𝑤) → ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ↔ (𝑤 ∈ (1...𝑁) ∧ 𝑧 ∈ (1...𝑀))))
12 oveq1 6611 . . . . . . . . 9 (𝑥 = 𝑧 → (𝑥 · 𝑄) = (𝑧 · 𝑄))
13 oveq1 6611 . . . . . . . . 9 (𝑦 = 𝑤 → (𝑦 · 𝑃) = (𝑤 · 𝑃))
1412, 13breqan12d 4629 . . . . . . . 8 ((𝑥 = 𝑧𝑦 = 𝑤) → ((𝑥 · 𝑄) < (𝑦 · 𝑃) ↔ (𝑧 · 𝑄) < (𝑤 · 𝑃)))
1511, 14anbi12d 746 . . . . . . 7 ((𝑥 = 𝑧𝑦 = 𝑤) → (((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃)) ↔ ((𝑤 ∈ (1...𝑁) ∧ 𝑧 ∈ (1...𝑀)) ∧ (𝑧 · 𝑄) < (𝑤 · 𝑃))))
1615ancoms 469 . . . . . 6 ((𝑦 = 𝑤𝑥 = 𝑧) → (((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃)) ↔ ((𝑤 ∈ (1...𝑁) ∧ 𝑧 ∈ (1...𝑀)) ∧ (𝑧 · 𝑄) < (𝑤 · 𝑃))))
1716cbvopabv 4684 . . . . 5 {⟨𝑦, 𝑥⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} = {⟨𝑤, 𝑧⟩ ∣ ((𝑤 ∈ (1...𝑁) ∧ 𝑧 ∈ (1...𝑀)) ∧ (𝑧 · 𝑄) < (𝑤 · 𝑃))}
181, 2, 4, 5, 6, 17lgsquadlem2 25006 . . . 4 (𝜑 → (𝑃 /L 𝑄) = (-1↑(#‘{⟨𝑦, 𝑥⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))})))
19 relopab 5207 . . . . . . . 8 Rel {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))}
20 fzfid 12712 . . . . . . . . . 10 (𝜑 → (1...𝑀) ∈ Fin)
21 fzfid 12712 . . . . . . . . . 10 (𝜑 → (1...𝑁) ∈ Fin)
22 xpfi 8175 . . . . . . . . . 10 (((1...𝑀) ∈ Fin ∧ (1...𝑁) ∈ Fin) → ((1...𝑀) × (1...𝑁)) ∈ Fin)
2320, 21, 22syl2anc 692 . . . . . . . . 9 (𝜑 → ((1...𝑀) × (1...𝑁)) ∈ Fin)
24 opabssxp 5154 . . . . . . . . 9 {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ⊆ ((1...𝑀) × (1...𝑁))
25 ssfi 8124 . . . . . . . . 9 ((((1...𝑀) × (1...𝑁)) ∈ Fin ∧ {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ⊆ ((1...𝑀) × (1...𝑁))) → {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ∈ Fin)
2623, 24, 25sylancl 693 . . . . . . . 8 (𝜑 → {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ∈ Fin)
27 cnven 7976 . . . . . . . 8 ((Rel {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ∧ {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ∈ Fin) → {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ≈ {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))})
2819, 26, 27sylancr 694 . . . . . . 7 (𝜑 → {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ≈ {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))})
29 cnvopab 5492 . . . . . . 7 {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} = {⟨𝑦, 𝑥⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))}
3028, 29syl6breq 4654 . . . . . 6 (𝜑 → {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ≈ {⟨𝑦, 𝑥⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))})
31 hasheni 13076 . . . . . 6 ({⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ≈ {⟨𝑦, 𝑥⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} → (#‘{⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))}) = (#‘{⟨𝑦, 𝑥⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))}))
3230, 31syl 17 . . . . 5 (𝜑 → (#‘{⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))}) = (#‘{⟨𝑦, 𝑥⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))}))
3332oveq2d 6620 . . . 4 (𝜑 → (-1↑(#‘{⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))})) = (-1↑(#‘{⟨𝑦, 𝑥⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))})))
3418, 33eqtr4d 2658 . . 3 (𝜑 → (𝑃 /L 𝑄) = (-1↑(#‘{⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))})))
35 lgsquad.6 . . . 4 𝑆 = {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄))}
362, 1, 3, 6, 5, 35lgsquadlem2 25006 . . 3 (𝜑 → (𝑄 /L 𝑃) = (-1↑(#‘𝑆)))
3734, 36oveq12d 6622 . 2 (𝜑 → ((𝑃 /L 𝑄) · (𝑄 /L 𝑃)) = ((-1↑(#‘{⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))})) · (-1↑(#‘𝑆))))
38 neg1cn 11068 . . . 4 -1 ∈ ℂ
3938a1i 11 . . 3 (𝜑 → -1 ∈ ℂ)
40 opabssxp 5154 . . . . . 6 {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄))} ⊆ ((1...𝑀) × (1...𝑁))
4135, 40eqsstri 3614 . . . . 5 𝑆 ⊆ ((1...𝑀) × (1...𝑁))
42 ssfi 8124 . . . . 5 ((((1...𝑀) × (1...𝑁)) ∈ Fin ∧ 𝑆 ⊆ ((1...𝑀) × (1...𝑁))) → 𝑆 ∈ Fin)
4323, 41, 42sylancl 693 . . . 4 (𝜑𝑆 ∈ Fin)
44 hashcl 13087 . . . 4 (𝑆 ∈ Fin → (#‘𝑆) ∈ ℕ0)
4543, 44syl 17 . . 3 (𝜑 → (#‘𝑆) ∈ ℕ0)
46 hashcl 13087 . . . 4 ({⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ∈ Fin → (#‘{⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))}) ∈ ℕ0)
4726, 46syl 17 . . 3 (𝜑 → (#‘{⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))}) ∈ ℕ0)
4839, 45, 47expaddd 12950 . 2 (𝜑 → (-1↑((#‘{⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))}) + (#‘𝑆))) = ((-1↑(#‘{⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))})) · (-1↑(#‘𝑆))))
491eldifad 3567 . . . . . . . . . . . . . . . . 17 (𝜑𝑄 ∈ ℙ)
5049adantr 481 . . . . . . . . . . . . . . . 16 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → 𝑄 ∈ ℙ)
51 prmnn 15312 . . . . . . . . . . . . . . . 16 (𝑄 ∈ ℙ → 𝑄 ∈ ℕ)
5250, 51syl 17 . . . . . . . . . . . . . . 15 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → 𝑄 ∈ ℕ)
53 oddprm 15439 . . . . . . . . . . . . . . . . . . . . . 22 (𝑄 ∈ (ℙ ∖ {2}) → ((𝑄 − 1) / 2) ∈ ℕ)
541, 53syl 17 . . . . . . . . . . . . . . . . . . . . 21 (𝜑 → ((𝑄 − 1) / 2) ∈ ℕ)
555, 54syl5eqel 2702 . . . . . . . . . . . . . . . . . . . 20 (𝜑𝑁 ∈ ℕ)
5655adantr 481 . . . . . . . . . . . . . . . . . . 19 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → 𝑁 ∈ ℕ)
5756nnzd 11425 . . . . . . . . . . . . . . . . . 18 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → 𝑁 ∈ ℤ)
58 prmz 15313 . . . . . . . . . . . . . . . . . . . 20 (𝑄 ∈ ℙ → 𝑄 ∈ ℤ)
5950, 58syl 17 . . . . . . . . . . . . . . . . . . 19 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → 𝑄 ∈ ℤ)
60 peano2zm 11364 . . . . . . . . . . . . . . . . . . 19 (𝑄 ∈ ℤ → (𝑄 − 1) ∈ ℤ)
6159, 60syl 17 . . . . . . . . . . . . . . . . . 18 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → (𝑄 − 1) ∈ ℤ)
6256nnred 10979 . . . . . . . . . . . . . . . . . . 19 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → 𝑁 ∈ ℝ)
6361zred 11426 . . . . . . . . . . . . . . . . . . 19 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → (𝑄 − 1) ∈ ℝ)
64 prmuz2 15332 . . . . . . . . . . . . . . . . . . . . . . . 24 (𝑄 ∈ ℙ → 𝑄 ∈ (ℤ‘2))
6550, 64syl 17 . . . . . . . . . . . . . . . . . . . . . . 23 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → 𝑄 ∈ (ℤ‘2))
66 uz2m1nn 11707 . . . . . . . . . . . . . . . . . . . . . . 23 (𝑄 ∈ (ℤ‘2) → (𝑄 − 1) ∈ ℕ)
6765, 66syl 17 . . . . . . . . . . . . . . . . . . . . . 22 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → (𝑄 − 1) ∈ ℕ)
6867nnrpd 11814 . . . . . . . . . . . . . . . . . . . . 21 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → (𝑄 − 1) ∈ ℝ+)
69 rphalflt 11804 . . . . . . . . . . . . . . . . . . . . 21 ((𝑄 − 1) ∈ ℝ+ → ((𝑄 − 1) / 2) < (𝑄 − 1))
7068, 69syl 17 . . . . . . . . . . . . . . . . . . . 20 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → ((𝑄 − 1) / 2) < (𝑄 − 1))
715, 70syl5eqbr 4648 . . . . . . . . . . . . . . . . . . 19 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → 𝑁 < (𝑄 − 1))
7262, 63, 71ltled 10129 . . . . . . . . . . . . . . . . . 18 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → 𝑁 ≤ (𝑄 − 1))
73 eluz2 11637 . . . . . . . . . . . . . . . . . 18 ((𝑄 − 1) ∈ (ℤ𝑁) ↔ (𝑁 ∈ ℤ ∧ (𝑄 − 1) ∈ ℤ ∧ 𝑁 ≤ (𝑄 − 1)))
7457, 61, 72, 73syl3anbrc 1244 . . . . . . . . . . . . . . . . 17 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → (𝑄 − 1) ∈ (ℤ𝑁))
75 fzss2 12323 . . . . . . . . . . . . . . . . 17 ((𝑄 − 1) ∈ (ℤ𝑁) → (1...𝑁) ⊆ (1...(𝑄 − 1)))
7674, 75syl 17 . . . . . . . . . . . . . . . 16 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → (1...𝑁) ⊆ (1...(𝑄 − 1)))
77 simprr 795 . . . . . . . . . . . . . . . 16 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → 𝑦 ∈ (1...𝑁))
7876, 77sseldd 3584 . . . . . . . . . . . . . . 15 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → 𝑦 ∈ (1...(𝑄 − 1)))
79 fzm1ndvds 14968 . . . . . . . . . . . . . . 15 ((𝑄 ∈ ℕ ∧ 𝑦 ∈ (1...(𝑄 − 1))) → ¬ 𝑄𝑦)
8052, 78, 79syl2anc 692 . . . . . . . . . . . . . 14 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → ¬ 𝑄𝑦)
814adantr 481 . . . . . . . . . . . . . . . 16 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → 𝑄𝑃)
822eldifad 3567 . . . . . . . . . . . . . . . . . 18 (𝜑𝑃 ∈ ℙ)
8382adantr 481 . . . . . . . . . . . . . . . . 17 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → 𝑃 ∈ ℙ)
84 prmrp 15348 . . . . . . . . . . . . . . . . 17 ((𝑄 ∈ ℙ ∧ 𝑃 ∈ ℙ) → ((𝑄 gcd 𝑃) = 1 ↔ 𝑄𝑃))
8550, 83, 84syl2anc 692 . . . . . . . . . . . . . . . 16 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → ((𝑄 gcd 𝑃) = 1 ↔ 𝑄𝑃))
8681, 85mpbird 247 . . . . . . . . . . . . . . 15 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → (𝑄 gcd 𝑃) = 1)
87 prmz 15313 . . . . . . . . . . . . . . . . 17 (𝑃 ∈ ℙ → 𝑃 ∈ ℤ)
8883, 87syl 17 . . . . . . . . . . . . . . . 16 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → 𝑃 ∈ ℤ)
89 elfzelz 12284 . . . . . . . . . . . . . . . . 17 (𝑦 ∈ (1...𝑁) → 𝑦 ∈ ℤ)
9089ad2antll 764 . . . . . . . . . . . . . . . 16 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → 𝑦 ∈ ℤ)
91 coprmdvds 15290 . . . . . . . . . . . . . . . 16 ((𝑄 ∈ ℤ ∧ 𝑃 ∈ ℤ ∧ 𝑦 ∈ ℤ) → ((𝑄 ∥ (𝑃 · 𝑦) ∧ (𝑄 gcd 𝑃) = 1) → 𝑄𝑦))
9259, 88, 90, 91syl3anc 1323 . . . . . . . . . . . . . . 15 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → ((𝑄 ∥ (𝑃 · 𝑦) ∧ (𝑄 gcd 𝑃) = 1) → 𝑄𝑦))
9386, 92mpan2d 709 . . . . . . . . . . . . . 14 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → (𝑄 ∥ (𝑃 · 𝑦) → 𝑄𝑦))
9480, 93mtod 189 . . . . . . . . . . . . 13 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → ¬ 𝑄 ∥ (𝑃 · 𝑦))
95 prmnn 15312 . . . . . . . . . . . . . . . . 17 (𝑃 ∈ ℙ → 𝑃 ∈ ℕ)
9683, 95syl 17 . . . . . . . . . . . . . . . 16 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → 𝑃 ∈ ℕ)
9796nncnd 10980 . . . . . . . . . . . . . . 15 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → 𝑃 ∈ ℂ)
98 elfznn 12312 . . . . . . . . . . . . . . . . 17 (𝑦 ∈ (1...𝑁) → 𝑦 ∈ ℕ)
9998ad2antll 764 . . . . . . . . . . . . . . . 16 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → 𝑦 ∈ ℕ)
10099nncnd 10980 . . . . . . . . . . . . . . 15 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → 𝑦 ∈ ℂ)
10197, 100mulcomd 10005 . . . . . . . . . . . . . 14 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → (𝑃 · 𝑦) = (𝑦 · 𝑃))
102101breq2d 4625 . . . . . . . . . . . . 13 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → (𝑄 ∥ (𝑃 · 𝑦) ↔ 𝑄 ∥ (𝑦 · 𝑃)))
10394, 102mtbid 314 . . . . . . . . . . . 12 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → ¬ 𝑄 ∥ (𝑦 · 𝑃))
104 elfzelz 12284 . . . . . . . . . . . . . . . 16 (𝑥 ∈ (1...𝑀) → 𝑥 ∈ ℤ)
105104ad2antrl 763 . . . . . . . . . . . . . . 15 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → 𝑥 ∈ ℤ)
106 dvdsmul2 14928 . . . . . . . . . . . . . . 15 ((𝑥 ∈ ℤ ∧ 𝑄 ∈ ℤ) → 𝑄 ∥ (𝑥 · 𝑄))
107105, 59, 106syl2anc 692 . . . . . . . . . . . . . 14 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → 𝑄 ∥ (𝑥 · 𝑄))
108 breq2 4617 . . . . . . . . . . . . . 14 ((𝑥 · 𝑄) = (𝑦 · 𝑃) → (𝑄 ∥ (𝑥 · 𝑄) ↔ 𝑄 ∥ (𝑦 · 𝑃)))
109107, 108syl5ibcom 235 . . . . . . . . . . . . 13 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → ((𝑥 · 𝑄) = (𝑦 · 𝑃) → 𝑄 ∥ (𝑦 · 𝑃)))
110109necon3bd 2804 . . . . . . . . . . . 12 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → (¬ 𝑄 ∥ (𝑦 · 𝑃) → (𝑥 · 𝑄) ≠ (𝑦 · 𝑃)))
111103, 110mpd 15 . . . . . . . . . . 11 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → (𝑥 · 𝑄) ≠ (𝑦 · 𝑃))
112 elfznn 12312 . . . . . . . . . . . . . . 15 (𝑥 ∈ (1...𝑀) → 𝑥 ∈ ℕ)
113112ad2antrl 763 . . . . . . . . . . . . . 14 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → 𝑥 ∈ ℕ)
114113, 52nnmulcld 11012 . . . . . . . . . . . . 13 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → (𝑥 · 𝑄) ∈ ℕ)
115114nnred 10979 . . . . . . . . . . . 12 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → (𝑥 · 𝑄) ∈ ℝ)
11699, 96nnmulcld 11012 . . . . . . . . . . . . 13 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → (𝑦 · 𝑃) ∈ ℕ)
117116nnred 10979 . . . . . . . . . . . 12 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → (𝑦 · 𝑃) ∈ ℝ)
118115, 117lttri2d 10120 . . . . . . . . . . 11 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → ((𝑥 · 𝑄) ≠ (𝑦 · 𝑃) ↔ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∨ (𝑦 · 𝑃) < (𝑥 · 𝑄))))
119111, 118mpbid 222 . . . . . . . . . 10 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∨ (𝑦 · 𝑃) < (𝑥 · 𝑄)))
120119ex 450 . . . . . . . . 9 (𝜑 → ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) → ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∨ (𝑦 · 𝑃) < (𝑥 · 𝑄))))
121120pm4.71rd 666 . . . . . . . 8 (𝜑 → ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ↔ (((𝑥 · 𝑄) < (𝑦 · 𝑃) ∨ (𝑦 · 𝑃) < (𝑥 · 𝑄)) ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)))))
122 ancom 466 . . . . . . . 8 ((((𝑥 · 𝑄) < (𝑦 · 𝑃) ∨ (𝑦 · 𝑃) < (𝑥 · 𝑄)) ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) ↔ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∨ (𝑦 · 𝑃) < (𝑥 · 𝑄))))
123121, 122syl6rbb 277 . . . . . . 7 (𝜑 → (((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∨ (𝑦 · 𝑃) < (𝑥 · 𝑄))) ↔ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))))
124123opabbidv 4678 . . . . . 6 (𝜑 → {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∨ (𝑦 · 𝑃) < (𝑥 · 𝑄)))} = {⟨𝑥, 𝑦⟩ ∣ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))})
125 unopab 4690 . . . . . . 7 ({⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ∪ {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄))}) = {⟨𝑥, 𝑦⟩ ∣ (((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃)) ∨ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄)))}
12635uneq2i 3742 . . . . . . 7 ({⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ∪ 𝑆) = ({⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ∪ {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄))})
127 andi 910 . . . . . . . 8 (((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∨ (𝑦 · 𝑃) < (𝑥 · 𝑄))) ↔ (((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃)) ∨ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄))))
128127opabbii 4679 . . . . . . 7 {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∨ (𝑦 · 𝑃) < (𝑥 · 𝑄)))} = {⟨𝑥, 𝑦⟩ ∣ (((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃)) ∨ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄)))}
129125, 126, 1283eqtr4i 2653 . . . . . 6 ({⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ∪ 𝑆) = {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∨ (𝑦 · 𝑃) < (𝑥 · 𝑄)))}
130 df-xp 5080 . . . . . 6 ((1...𝑀) × (1...𝑁)) = {⟨𝑥, 𝑦⟩ ∣ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))}
131124, 129, 1303eqtr4g 2680 . . . . 5 (𝜑 → ({⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ∪ 𝑆) = ((1...𝑀) × (1...𝑁)))
132131fveq2d 6152 . . . 4 (𝜑 → (#‘({⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ∪ 𝑆)) = (#‘((1...𝑀) × (1...𝑁))))
133 inopab 5212 . . . . . . 7 ({⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ∩ {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄))}) = {⟨𝑥, 𝑦⟩ ∣ (((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃)) ∧ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄)))}
13435ineq2i 3789 . . . . . . 7 ({⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ∩ 𝑆) = ({⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ∩ {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄))})
135 anandi 870 . . . . . . . 8 (((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄))) ↔ (((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃)) ∧ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄))))
136135opabbii 4679 . . . . . . 7 {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄)))} = {⟨𝑥, 𝑦⟩ ∣ (((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃)) ∧ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄)))}
137133, 134, 1363eqtr4i 2653 . . . . . 6 ({⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ∩ 𝑆) = {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄)))}
138 ltnsym2 10080 . . . . . . . . . . . 12 (((𝑥 · 𝑄) ∈ ℝ ∧ (𝑦 · 𝑃) ∈ ℝ) → ¬ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄)))
139115, 117, 138syl2anc 692 . . . . . . . . . . 11 ((𝜑 ∧ (𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁))) → ¬ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄)))
140139ex 450 . . . . . . . . . 10 (𝜑 → ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) → ¬ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄))))
141 imnan 438 . . . . . . . . . 10 (((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) → ¬ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄))) ↔ ¬ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄))))
142140, 141sylib 208 . . . . . . . . 9 (𝜑 → ¬ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄))))
143142nexdv 1861 . . . . . . . 8 (𝜑 → ¬ ∃𝑦((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄))))
144143nexdv 1861 . . . . . . 7 (𝜑 → ¬ ∃𝑥𝑦((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄))))
145 opabn0 4966 . . . . . . . 8 ({⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄)))} ≠ ∅ ↔ ∃𝑥𝑦((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄))))
146145necon1bbii 2839 . . . . . . 7 (¬ ∃𝑥𝑦((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄))) ↔ {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄)))} = ∅)
147144, 146sylib 208 . . . . . 6 (𝜑 → {⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ ((𝑥 · 𝑄) < (𝑦 · 𝑃) ∧ (𝑦 · 𝑃) < (𝑥 · 𝑄)))} = ∅)
148137, 147syl5eq 2667 . . . . 5 (𝜑 → ({⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ∩ 𝑆) = ∅)
149 hashun 13111 . . . . 5 (({⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ∈ Fin ∧ 𝑆 ∈ Fin ∧ ({⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ∩ 𝑆) = ∅) → (#‘({⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ∪ 𝑆)) = ((#‘{⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))}) + (#‘𝑆)))
15026, 43, 148, 149syl3anc 1323 . . . 4 (𝜑 → (#‘({⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))} ∪ 𝑆)) = ((#‘{⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))}) + (#‘𝑆)))
151 hashxp 13161 . . . . . 6 (((1...𝑀) ∈ Fin ∧ (1...𝑁) ∈ Fin) → (#‘((1...𝑀) × (1...𝑁))) = ((#‘(1...𝑀)) · (#‘(1...𝑁))))
15220, 21, 151syl2anc 692 . . . . 5 (𝜑 → (#‘((1...𝑀) × (1...𝑁))) = ((#‘(1...𝑀)) · (#‘(1...𝑁))))
153 oddprm 15439 . . . . . . . . . 10 (𝑃 ∈ (ℙ ∖ {2}) → ((𝑃 − 1) / 2) ∈ ℕ)
1542, 153syl 17 . . . . . . . . 9 (𝜑 → ((𝑃 − 1) / 2) ∈ ℕ)
1556, 154syl5eqel 2702 . . . . . . . 8 (𝜑𝑀 ∈ ℕ)
156155nnnn0d 11295 . . . . . . 7 (𝜑𝑀 ∈ ℕ0)
157 hashfz1 13074 . . . . . . 7 (𝑀 ∈ ℕ0 → (#‘(1...𝑀)) = 𝑀)
158156, 157syl 17 . . . . . 6 (𝜑 → (#‘(1...𝑀)) = 𝑀)
15955nnnn0d 11295 . . . . . . 7 (𝜑𝑁 ∈ ℕ0)
160 hashfz1 13074 . . . . . . 7 (𝑁 ∈ ℕ0 → (#‘(1...𝑁)) = 𝑁)
161159, 160syl 17 . . . . . 6 (𝜑 → (#‘(1...𝑁)) = 𝑁)
162158, 161oveq12d 6622 . . . . 5 (𝜑 → ((#‘(1...𝑀)) · (#‘(1...𝑁))) = (𝑀 · 𝑁))
163152, 162eqtrd 2655 . . . 4 (𝜑 → (#‘((1...𝑀) × (1...𝑁))) = (𝑀 · 𝑁))
164132, 150, 1633eqtr3d 2663 . . 3 (𝜑 → ((#‘{⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))}) + (#‘𝑆)) = (𝑀 · 𝑁))
165164oveq2d 6620 . 2 (𝜑 → (-1↑((#‘{⟨𝑥, 𝑦⟩ ∣ ((𝑥 ∈ (1...𝑀) ∧ 𝑦 ∈ (1...𝑁)) ∧ (𝑥 · 𝑄) < (𝑦 · 𝑃))}) + (#‘𝑆))) = (-1↑(𝑀 · 𝑁)))
16637, 48, 1653eqtr2d 2661 1 (𝜑 → ((𝑃 /L 𝑄) · (𝑄 /L 𝑃)) = (-1↑(𝑀 · 𝑁)))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wb 196  wo 383  wa 384   = wceq 1480  wex 1701  wcel 1987  wne 2790  cdif 3552  cun 3553  cin 3554  wss 3555  c0 3891  {csn 4148   class class class wbr 4613  {copab 4672   × cxp 5072  ccnv 5073  Rel wrel 5079  cfv 5847  (class class class)co 6604  cen 7896  Fincfn 7899  cc 9878  cr 9879  1c1 9881   + caddc 9883   · cmul 9885   < clt 10018  cle 10019  cmin 10210  -cneg 10211   / cdiv 10628  cn 10964  2c2 11014  0cn0 11236  cz 11321  cuz 11631  +crp 11776  ...cfz 12268  cexp 12800  #chash 13057  cdvds 14907   gcd cgcd 15140  cprime 15309   /L clgs 24919
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1719  ax-4 1734  ax-5 1836  ax-6 1885  ax-7 1932  ax-8 1989  ax-9 1996  ax-10 2016  ax-11 2031  ax-12 2044  ax-13 2245  ax-ext 2601  ax-rep 4731  ax-sep 4741  ax-nul 4749  ax-pow 4803  ax-pr 4867  ax-un 6902  ax-inf2 8482  ax-cnex 9936  ax-resscn 9937  ax-1cn 9938  ax-icn 9939  ax-addcl 9940  ax-addrcl 9941  ax-mulcl 9942  ax-mulrcl 9943  ax-mulcom 9944  ax-addass 9945  ax-mulass 9946  ax-distr 9947  ax-i2m1 9948  ax-1ne0 9949  ax-1rid 9950  ax-rnegex 9951  ax-rrecex 9952  ax-cnre 9953  ax-pre-lttri 9954  ax-pre-lttrn 9955  ax-pre-ltadd 9956  ax-pre-mulgt0 9957  ax-pre-sup 9958  ax-addf 9959  ax-mulf 9960
This theorem depends on definitions:  df-bi 197  df-or 385  df-an 386  df-3or 1037  df-3an 1038  df-tru 1483  df-fal 1486  df-ex 1702  df-nf 1707  df-sb 1878  df-eu 2473  df-mo 2474  df-clab 2608  df-cleq 2614  df-clel 2617  df-nfc 2750  df-ne 2791  df-nel 2894  df-ral 2912  df-rex 2913  df-reu 2914  df-rmo 2915  df-rab 2916  df-v 3188  df-sbc 3418  df-csb 3515  df-dif 3558  df-un 3560  df-in 3562  df-ss 3569  df-pss 3571  df-nul 3892  df-if 4059  df-pw 4132  df-sn 4149  df-pr 4151  df-tp 4153  df-op 4155  df-uni 4403  df-int 4441  df-iun 4487  df-disj 4584  df-br 4614  df-opab 4674  df-mpt 4675  df-tr 4713  df-eprel 4985  df-id 4989  df-po 4995  df-so 4996  df-fr 5033  df-se 5034  df-we 5035  df-xp 5080  df-rel 5081  df-cnv 5082  df-co 5083  df-dm 5084  df-rn 5085  df-res 5086  df-ima 5087  df-pred 5639  df-ord 5685  df-on 5686  df-lim 5687  df-suc 5688  df-iota 5810  df-fun 5849  df-fn 5850  df-f 5851  df-f1 5852  df-fo 5853  df-f1o 5854  df-fv 5855  df-isom 5856  df-riota 6565  df-ov 6607  df-oprab 6608  df-mpt2 6609  df-of 6850  df-om 7013  df-1st 7113  df-2nd 7114  df-supp 7241  df-tpos 7297  df-wrecs 7352  df-recs 7413  df-rdg 7451  df-1o 7505  df-2o 7506  df-oadd 7509  df-er 7687  df-ec 7689  df-qs 7693  df-map 7804  df-en 7900  df-dom 7901  df-sdom 7902  df-fin 7903  df-fsupp 8220  df-sup 8292  df-inf 8293  df-oi 8359  df-card 8709  df-cda 8934  df-pnf 10020  df-mnf 10021  df-xr 10022  df-ltxr 10023  df-le 10024  df-sub 10212  df-neg 10213  df-div 10629  df-nn 10965  df-2 11023  df-3 11024  df-4 11025  df-5 11026  df-6 11027  df-7 11028  df-8 11029  df-9 11030  df-n0 11237  df-xnn0 11308  df-z 11322  df-dec 11438  df-uz 11632  df-q 11733  df-rp 11777  df-fz 12269  df-fzo 12407  df-fl 12533  df-mod 12609  df-seq 12742  df-exp 12801  df-hash 13058  df-cj 13773  df-re 13774  df-im 13775  df-sqrt 13909  df-abs 13910  df-clim 14153  df-sum 14351  df-dvds 14908  df-gcd 15141  df-prm 15310  df-phi 15395  df-pc 15466  df-struct 15783  df-ndx 15784  df-slot 15785  df-base 15786  df-sets 15787  df-ress 15788  df-plusg 15875  df-mulr 15876  df-starv 15877  df-sca 15878  df-vsca 15879  df-ip 15880  df-tset 15881  df-ple 15882  df-ds 15885  df-unif 15886  df-0g 16023  df-gsum 16024  df-imas 16089  df-qus 16090  df-mgm 17163  df-sgrp 17205  df-mnd 17216  df-mhm 17256  df-submnd 17257  df-grp 17346  df-minusg 17347  df-sbg 17348  df-mulg 17462  df-subg 17512  df-nsg 17513  df-eqg 17514  df-ghm 17579  df-cntz 17671  df-cmn 18116  df-abl 18117  df-mgp 18411  df-ur 18423  df-ring 18470  df-cring 18471  df-oppr 18544  df-dvdsr 18562  df-unit 18563  df-invr 18593  df-dvr 18604  df-rnghom 18636  df-drng 18670  df-field 18671  df-subrg 18699  df-lmod 18786  df-lss 18852  df-lsp 18891  df-sra 19091  df-rgmod 19092  df-lidl 19093  df-rsp 19094  df-2idl 19151  df-nzr 19177  df-rlreg 19202  df-domn 19203  df-idom 19204  df-cnfld 19666  df-zring 19738  df-zrh 19771  df-zn 19774  df-lgs 24920
This theorem is referenced by:  lgsquad  25008
  Copyright terms: Public domain W3C validator