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

Theorem lgsqrmod 27484
Description: If the Legendre symbol of an integer for an odd prime is 1, then the number is a quadratic residue mod 𝑃. (Contributed by AV, 20-Aug-2021.)
Assertion
Ref Expression
lgsqrmod ((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) → ((𝐴 /L 𝑃) = 1 → ∃𝑥 ∈ ℤ ((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃)))
Distinct variable groups:   𝑥,𝐴   𝑥,𝑃

Proof of Theorem lgsqrmod
StepHypRef Expression
1 lgsqr 27483 . 2 ((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) → ((𝐴 /L 𝑃) = 1 ↔ (¬ 𝑃𝐴 ∧ ∃𝑥 ∈ ℤ 𝑃 ∥ ((𝑥↑2) − 𝐴))))
2 eldifi 4093 . . . . . . . 8 (𝑃 ∈ (ℙ ∖ {2}) → 𝑃 ∈ ℙ)
3 prmnn 16734 . . . . . . . 8 (𝑃 ∈ ℙ → 𝑃 ∈ ℕ)
42, 3syl 18 . . . . . . 7 (𝑃 ∈ (ℙ ∖ {2}) → 𝑃 ∈ ℕ)
54ad2antlr 739 . . . . . 6 (((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) ∧ 𝑥 ∈ ℤ) → 𝑃 ∈ ℕ)
6 zsqcl 14167 . . . . . . 7 (𝑥 ∈ ℤ → (𝑥↑2) ∈ ℤ)
76adantl 486 . . . . . 6 (((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) ∧ 𝑥 ∈ ℤ) → (𝑥↑2) ∈ ℤ)
8 simpll 778 . . . . . 6 (((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) ∧ 𝑥 ∈ ℤ) → 𝐴 ∈ ℤ)
9 moddvds 16323 . . . . . 6 ((𝑃 ∈ ℕ ∧ (𝑥↑2) ∈ ℤ ∧ 𝐴 ∈ ℤ) → (((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃) ↔ 𝑃 ∥ ((𝑥↑2) − 𝐴)))
105, 7, 8, 9syl3anc 1396 . . . . 5 (((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) ∧ 𝑥 ∈ ℤ) → (((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃) ↔ 𝑃 ∥ ((𝑥↑2) − 𝐴)))
1110biimprd 251 . . . 4 (((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) ∧ 𝑥 ∈ ℤ) → (𝑃 ∥ ((𝑥↑2) − 𝐴) → ((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃)))
1211reximdva 3184 . . 3 ((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) → (∃𝑥 ∈ ℤ 𝑃 ∥ ((𝑥↑2) − 𝐴) → ∃𝑥 ∈ ℤ ((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃)))
1312adantld 495 . 2 ((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) → ((¬ 𝑃𝐴 ∧ ∃𝑥 ∈ ℤ 𝑃 ∥ ((𝑥↑2) − 𝐴)) → ∃𝑥 ∈ ℤ ((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃)))
141, 13sylbid 243 1 ((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) → ((𝐴 /L 𝑃) = 1 → ∃𝑥 ∈ ℤ ((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃)))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wb 209  wa 400   = wceq 1567  wcel 2149  wrex 3095  cdif 3910  {csn 4594   class class class wbr 5113  (class class class)co 7413  1c1 11103  cmin 11443  cn 12235  2c2 12297  cz 12593   mod cmo 13904  cexp 14099  cdvds 16312  cprime 16731   /L clgs 27426
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1822  ax-4 1836  ax-5 1937  ax-6 1994  ax-7 2035  ax-8 2151  ax-9 2159  ax-10 2182  ax-11 2198  ax-12 2219  ax-ext 2741  ax-rep 5242  ax-sep 5261  ax-nul 5273  ax-pow 5339  ax-pr 5407  ax-un 7735  ax-cnex 11158  ax-resscn 11159  ax-1cn 11160  ax-icn 11161  ax-addcl 11162  ax-addrcl 11163  ax-mulcl 11164  ax-mulrcl 11165  ax-mulcom 11166  ax-addass 11167  ax-mulass 11168  ax-distr 11169  ax-i2m1 11170  ax-1ne0 11171  ax-1rid 11172  ax-rnegex 11173  ax-rrecex 11174  ax-cnre 11175  ax-pre-lttri 11176  ax-pre-lttrn 11177  ax-pre-ltadd 11178  ax-pre-mulgt0 11179  ax-pre-sup 11180  ax-addf 11181  ax-mulf 11182
This theorem depends on definitions:  df-bi 210  df-an 401  df-or 861  df-3or 1102  df-3an 1103  df-tru 1570  df-fal 1580  df-ex 1807  df-nf 1811  df-sb 2098  df-mo 2573  df-eu 2603  df-clab 2748  df-cleq 2761  df-clel 2844  df-nfc 2918  df-ne 2965  df-nel 3071  df-ral 3086  df-rex 3096  df-rmo 3376  df-reu 3377  df-rab 3424  df-v 3465  df-sbc 3754  df-csb 3862  df-dif 3916  df-un 3918  df-in 3920  df-ss 3930  df-pss 3933  df-nul 4295  df-if 4493  df-pw 4569  df-sn 4595  df-pr 4597  df-tp 4599  df-op 4601  df-uni 4877  df-int 4917  df-iun 4962  df-iin 4963  df-br 5114  df-opab 5178  df-mpt 5197  df-tr 5223  df-id 5559  df-eprel 5564  df-po 5572  df-so 5573  df-fr 5617  df-se 5618  df-we 5619  df-xp 5670  df-rel 5671  df-cnv 5672  df-co 5673  df-dm 5674  df-rn 5675  df-res 5676  df-ima 5677  df-pred 6305  df-ord 6366  df-on 6367  df-lim 6368  df-suc 6369  df-iota 6495  df-fun 6541  df-fn 6542  df-f 6543  df-f1 6544  df-fo 6545  df-f1o 6546  df-fv 6547  df-isom 6548  df-riota 7370  df-ov 7416  df-oprab 7417  df-mpo 7418  df-of 7677  df-ofr 7678  df-om 7865  df-1st 7988  df-2nd 7989  df-supp 8159  df-tpos 8224  df-frecs 8280  df-wrecs 8311  df-recs 8360  df-rdg 8399  df-1o 8455  df-2o 8456  df-oadd 8459  df-er 8696  df-ec 8698  df-qs 8702  df-map 8828  df-pm 8829  df-ixp 8898  df-en 8946  df-dom 8947  df-sdom 8948  df-fin 8949  df-fsupp 9324  df-sup 9404  df-inf 9405  df-oi 9474  df-dju 9889  df-card 9927  df-pnf 11247  df-mnf 11248  df-xr 11249  df-ltxr 11250  df-le 11251  df-sub 11445  df-neg 11446  df-div 11874  df-nn 12236  df-2 12305  df-3 12306  df-4 12307  df-5 12308  df-6 12309  df-7 12310  df-8 12311  df-9 12312  df-n0 12507  df-xnn0 12580  df-z 12594  df-dec 12714  df-uz 12865  df-q 12975  df-rp 13019  df-fz 13538  df-fzo 13685  df-fl 13827  df-mod 13905  df-seq 14040  df-exp 14100  df-hash 14369  df-cj 15152  df-re 15153  df-im 15154  df-sqrt 15288  df-abs 15289  df-dvds 16313  df-gcd 16555  df-prm 16732  df-phi 16827  df-pc 16899  df-struct 17209  df-sets 17226  df-slot 17244  df-ndx 17256  df-base 17272  df-ress 17293  df-plusg 17325  df-mulr 17326  df-starv 17327  df-sca 17328  df-vsca 17329  df-ip 17330  df-tset 17331  df-ple 17332  df-ds 17334  df-unif 17335  df-hom 17336  df-cco 17337  df-0g 17496  df-gsum 17497  df-prds 17502  df-pws 17504  df-imas 17564  df-qus 17565  df-mre 17640  df-mrc 17641  df-acs 17643  df-mgm 18700  df-sgrp 18779  df-mnd 18795  df-mhm 18843  df-submnd 18844  df-grp 19005  df-minusg 19006  df-sbg 19007  df-mulg 19136  df-subg 19191  df-nsg 19192  df-eqg 19193  df-ghm 19286  df-cntz 19389  df-cmn 19854  df-abl 19855  df-mgp 20219  df-rng 20233  df-ur 20266  df-srg 20271  df-ring 20319  df-cring 20320  df-oppr 20421  df-dvdsr 20441  df-unit 20442  df-invr 20472  df-dvr 20485  df-rhm 20556  df-nzr 20598  df-subrng 20633  df-subrg 20657  df-rlreg 20781  df-domn 20782  df-idom 20783  df-drng 20817  df-field 20818  df-lmod 20963  df-lss 21033  df-lsp 21073  df-sra 21274  df-rgmod 21275  df-lidl 21312  df-rsp 21313  df-2idl 21362  df-cnfld 21494  df-zring 21568  df-zrh 21624  df-zn 21627  df-assa 21974  df-asp 21975  df-ascl 21976  df-psr 22030  df-mvr 22031  df-mpl 22032  df-opsr 22034  df-evls 22196  df-evl 22197  df-psr1 22311  df-vr1 22312  df-ply1 22313  df-coe1 22314  df-evl1 22447  df-mdeg 26183  df-deg1 26184  df-mon1 26259  df-uc1p 26260  df-q1p 26261  df-r1p 26262  df-lgs 27427
This theorem is referenced by:  lgsqrmodndvds  27485
  Copyright terms: Public domain W3C validator