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

Theorem lgsqrmod 27301
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 27300 . 2 ((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) → ((𝐴 /L 𝑃) = 1 ↔ (¬ 𝑃𝐴 ∧ ∃𝑥 ∈ ℤ 𝑃 ∥ ((𝑥↑2) − 𝐴))))
2 eldifi 4117 . . . . . . . 8 (𝑃 ∈ (ℙ ∖ {2}) → 𝑃 ∈ ℙ)
3 prmnn 16642 . . . . . . . 8 (𝑃 ∈ ℙ → 𝑃 ∈ ℕ)
42, 3syl 17 . . . . . . 7 (𝑃 ∈ (ℙ ∖ {2}) → 𝑃 ∈ ℕ)
54ad2antlr 725 . . . . . 6 (((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) ∧ 𝑥 ∈ ℤ) → 𝑃 ∈ ℕ)
6 zsqcl 14123 . . . . . . 7 (𝑥 ∈ ℤ → (𝑥↑2) ∈ ℤ)
76adantl 480 . . . . . 6 (((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) ∧ 𝑥 ∈ ℤ) → (𝑥↑2) ∈ ℤ)
8 simpll 765 . . . . . 6 (((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) ∧ 𝑥 ∈ ℤ) → 𝐴 ∈ ℤ)
9 moddvds 16239 . . . . . 6 ((𝑃 ∈ ℕ ∧ (𝑥↑2) ∈ ℤ ∧ 𝐴 ∈ ℤ) → (((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃) ↔ 𝑃 ∥ ((𝑥↑2) − 𝐴)))
105, 7, 8, 9syl3anc 1368 . . . . 5 (((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) ∧ 𝑥 ∈ ℤ) → (((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃) ↔ 𝑃 ∥ ((𝑥↑2) − 𝐴)))
1110biimprd 247 . . . 4 (((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) ∧ 𝑥 ∈ ℤ) → (𝑃 ∥ ((𝑥↑2) − 𝐴) → ((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃)))
1211reximdva 3158 . . 3 ((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) → (∃𝑥 ∈ ℤ 𝑃 ∥ ((𝑥↑2) − 𝐴) → ∃𝑥 ∈ ℤ ((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃)))
1312adantld 489 . 2 ((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) → ((¬ 𝑃𝐴 ∧ ∃𝑥 ∈ ℤ 𝑃 ∥ ((𝑥↑2) − 𝐴)) → ∃𝑥 ∈ ℤ ((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃)))
141, 13sylbid 239 1 ((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) → ((𝐴 /L 𝑃) = 1 → ∃𝑥 ∈ ℤ ((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃)))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wb 205  wa 394   = wceq 1533  wcel 2098  wrex 3060  cdif 3936  {csn 4622   class class class wbr 5141  (class class class)co 7414  1c1 11137  cmin 11472  cn 12240  2c2 12295  cz 12586   mod cmo 13864  cexp 14056  cdvds 16228  cprime 16639   /L clgs 27243
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1789  ax-4 1803  ax-5 1905  ax-6 1963  ax-7 2003  ax-8 2100  ax-9 2108  ax-10 2129  ax-11 2146  ax-12 2166  ax-ext 2696  ax-rep 5278  ax-sep 5292  ax-nul 5299  ax-pow 5357  ax-pr 5421  ax-un 7736  ax-cnex 11192  ax-resscn 11193  ax-1cn 11194  ax-icn 11195  ax-addcl 11196  ax-addrcl 11197  ax-mulcl 11198  ax-mulrcl 11199  ax-mulcom 11200  ax-addass 11201  ax-mulass 11202  ax-distr 11203  ax-i2m1 11204  ax-1ne0 11205  ax-1rid 11206  ax-rnegex 11207  ax-rrecex 11208  ax-cnre 11209  ax-pre-lttri 11210  ax-pre-lttrn 11211  ax-pre-ltadd 11212  ax-pre-mulgt0 11213  ax-pre-sup 11214  ax-addf 11215  ax-mulf 11216
This theorem depends on definitions:  df-bi 206  df-an 395  df-or 846  df-3or 1085  df-3an 1086  df-tru 1536  df-fal 1546  df-ex 1774  df-nf 1778  df-sb 2060  df-mo 2528  df-eu 2557  df-clab 2703  df-cleq 2717  df-clel 2802  df-nfc 2877  df-ne 2931  df-nel 3037  df-ral 3052  df-rex 3061  df-rmo 3364  df-reu 3365  df-rab 3420  df-v 3465  df-sbc 3769  df-csb 3885  df-dif 3942  df-un 3944  df-in 3946  df-ss 3956  df-pss 3958  df-nul 4317  df-if 4523  df-pw 4598  df-sn 4623  df-pr 4625  df-tp 4627  df-op 4629  df-uni 4902  df-int 4943  df-iun 4991  df-iin 4992  df-br 5142  df-opab 5204  df-mpt 5225  df-tr 5259  df-id 5568  df-eprel 5574  df-po 5582  df-so 5583  df-fr 5625  df-se 5626  df-we 5627  df-xp 5676  df-rel 5677  df-cnv 5678  df-co 5679  df-dm 5680  df-rn 5681  df-res 5682  df-ima 5683  df-pred 6298  df-ord 6365  df-on 6366  df-lim 6367  df-suc 6368  df-iota 6493  df-fun 6543  df-fn 6544  df-f 6545  df-f1 6546  df-fo 6547  df-f1o 6548  df-fv 6549  df-isom 6550  df-riota 7370  df-ov 7417  df-oprab 7418  df-mpo 7419  df-of 7680  df-ofr 7681  df-om 7867  df-1st 7989  df-2nd 7990  df-supp 8162  df-tpos 8228  df-frecs 8283  df-wrecs 8314  df-recs 8388  df-rdg 8427  df-1o 8483  df-2o 8484  df-oadd 8487  df-er 8721  df-ec 8723  df-qs 8727  df-map 8843  df-pm 8844  df-ixp 8913  df-en 8961  df-dom 8962  df-sdom 8963  df-fin 8964  df-fsupp 9384  df-sup 9463  df-inf 9464  df-oi 9531  df-dju 9922  df-card 9960  df-pnf 11278  df-mnf 11279  df-xr 11280  df-ltxr 11281  df-le 11282  df-sub 11474  df-neg 11475  df-div 11900  df-nn 12241  df-2 12303  df-3 12304  df-4 12305  df-5 12306  df-6 12307  df-7 12308  df-8 12309  df-9 12310  df-n0 12501  df-xnn0 12573  df-z 12587  df-dec 12706  df-uz 12851  df-q 12961  df-rp 13005  df-fz 13515  df-fzo 13658  df-fl 13787  df-mod 13865  df-seq 13997  df-exp 14057  df-hash 14320  df-cj 15076  df-re 15077  df-im 15078  df-sqrt 15212  df-abs 15213  df-dvds 16229  df-gcd 16467  df-prm 16640  df-phi 16732  df-pc 16803  df-struct 17113  df-sets 17130  df-slot 17148  df-ndx 17160  df-base 17178  df-ress 17207  df-plusg 17243  df-mulr 17244  df-starv 17245  df-sca 17246  df-vsca 17247  df-ip 17248  df-tset 17249  df-ple 17250  df-ds 17252  df-unif 17253  df-hom 17254  df-cco 17255  df-0g 17420  df-gsum 17421  df-prds 17426  df-pws 17428  df-imas 17487  df-qus 17488  df-mre 17563  df-mrc 17564  df-acs 17566  df-mgm 18597  df-sgrp 18676  df-mnd 18692  df-mhm 18737  df-submnd 18738  df-grp 18895  df-minusg 18896  df-sbg 18897  df-mulg 19026  df-subg 19080  df-nsg 19081  df-eqg 19082  df-ghm 19170  df-cntz 19270  df-cmn 19739  df-abl 19740  df-mgp 20077  df-rng 20095  df-ur 20124  df-srg 20129  df-ring 20177  df-cring 20178  df-oppr 20275  df-dvdsr 20298  df-unit 20299  df-invr 20329  df-dvr 20342  df-rhm 20413  df-nzr 20454  df-subrng 20485  df-subrg 20510  df-drng 20628  df-field 20629  df-lmod 20747  df-lss 20818  df-lsp 20858  df-sra 21060  df-rgmod 21061  df-lidl 21106  df-rsp 21107  df-2idl 21146  df-rlreg 21232  df-domn 21233  df-idom 21234  df-cnfld 21282  df-zring 21375  df-zrh 21431  df-zn 21434  df-assa 21789  df-asp 21790  df-ascl 21791  df-psr 21844  df-mvr 21845  df-mpl 21846  df-opsr 21848  df-evls 22023  df-evl 22024  df-psr1 22105  df-vr1 22106  df-ply1 22107  df-coe1 22108  df-evl1 22242  df-mdeg 26004  df-deg1 26005  df-mon1 26082  df-uc1p 26083  df-q1p 26084  df-r1p 26085  df-lgs 27244
This theorem is referenced by:  lgsqrmodndvds  27302
  Copyright terms: Public domain W3C validator