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

Theorem lgsqrmod 26703
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 26702 . 2 ((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) → ((𝐴 /L 𝑃) = 1 ↔ (¬ 𝑃𝐴 ∧ ∃𝑥 ∈ ℤ 𝑃 ∥ ((𝑥↑2) − 𝐴))))
2 eldifi 4087 . . . . . . . 8 (𝑃 ∈ (ℙ ∖ {2}) → 𝑃 ∈ ℙ)
3 prmnn 16551 . . . . . . . 8 (𝑃 ∈ ℙ → 𝑃 ∈ ℕ)
42, 3syl 17 . . . . . . 7 (𝑃 ∈ (ℙ ∖ {2}) → 𝑃 ∈ ℕ)
54ad2antlr 726 . . . . . 6 (((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) ∧ 𝑥 ∈ ℤ) → 𝑃 ∈ ℕ)
6 zsqcl 14035 . . . . . . 7 (𝑥 ∈ ℤ → (𝑥↑2) ∈ ℤ)
76adantl 483 . . . . . 6 (((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) ∧ 𝑥 ∈ ℤ) → (𝑥↑2) ∈ ℤ)
8 simpll 766 . . . . . 6 (((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) ∧ 𝑥 ∈ ℤ) → 𝐴 ∈ ℤ)
9 moddvds 16148 . . . . . 6 ((𝑃 ∈ ℕ ∧ (𝑥↑2) ∈ ℤ ∧ 𝐴 ∈ ℤ) → (((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃) ↔ 𝑃 ∥ ((𝑥↑2) − 𝐴)))
105, 7, 8, 9syl3anc 1372 . . . . 5 (((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) ∧ 𝑥 ∈ ℤ) → (((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃) ↔ 𝑃 ∥ ((𝑥↑2) − 𝐴)))
1110biimprd 248 . . . 4 (((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) ∧ 𝑥 ∈ ℤ) → (𝑃 ∥ ((𝑥↑2) − 𝐴) → ((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃)))
1211reximdva 3166 . . 3 ((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) → (∃𝑥 ∈ ℤ 𝑃 ∥ ((𝑥↑2) − 𝐴) → ∃𝑥 ∈ ℤ ((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃)))
1312adantld 492 . 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 397   = wceq 1542  wcel 2107  wrex 3074  cdif 3908  {csn 4587   class class class wbr 5106  (class class class)co 7358  1c1 11053  cmin 11386  cn 12154  2c2 12209  cz 12500   mod cmo 13775  cexp 13968  cdvds 16137  cprime 16548   /L clgs 26645
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1798  ax-4 1812  ax-5 1914  ax-6 1972  ax-7 2012  ax-8 2109  ax-9 2117  ax-10 2138  ax-11 2155  ax-12 2172  ax-ext 2708  ax-rep 5243  ax-sep 5257  ax-nul 5264  ax-pow 5321  ax-pr 5385  ax-un 7673  ax-cnex 11108  ax-resscn 11109  ax-1cn 11110  ax-icn 11111  ax-addcl 11112  ax-addrcl 11113  ax-mulcl 11114  ax-mulrcl 11115  ax-mulcom 11116  ax-addass 11117  ax-mulass 11118  ax-distr 11119  ax-i2m1 11120  ax-1ne0 11121  ax-1rid 11122  ax-rnegex 11123  ax-rrecex 11124  ax-cnre 11125  ax-pre-lttri 11126  ax-pre-lttrn 11127  ax-pre-ltadd 11128  ax-pre-mulgt0 11129  ax-pre-sup 11130  ax-addf 11131  ax-mulf 11132
This theorem depends on definitions:  df-bi 206  df-an 398  df-or 847  df-3or 1089  df-3an 1090  df-tru 1545  df-fal 1555  df-ex 1783  df-nf 1787  df-sb 2069  df-mo 2539  df-eu 2568  df-clab 2715  df-cleq 2729  df-clel 2815  df-nfc 2890  df-ne 2945  df-nel 3051  df-ral 3066  df-rex 3075  df-rmo 3354  df-reu 3355  df-rab 3409  df-v 3448  df-sbc 3741  df-csb 3857  df-dif 3914  df-un 3916  df-in 3918  df-ss 3928  df-pss 3930  df-nul 4284  df-if 4488  df-pw 4563  df-sn 4588  df-pr 4590  df-tp 4592  df-op 4594  df-uni 4867  df-int 4909  df-iun 4957  df-iin 4958  df-br 5107  df-opab 5169  df-mpt 5190  df-tr 5224  df-id 5532  df-eprel 5538  df-po 5546  df-so 5547  df-fr 5589  df-se 5590  df-we 5591  df-xp 5640  df-rel 5641  df-cnv 5642  df-co 5643  df-dm 5644  df-rn 5645  df-res 5646  df-ima 5647  df-pred 6254  df-ord 6321  df-on 6322  df-lim 6323  df-suc 6324  df-iota 6449  df-fun 6499  df-fn 6500  df-f 6501  df-f1 6502  df-fo 6503  df-f1o 6504  df-fv 6505  df-isom 6506  df-riota 7314  df-ov 7361  df-oprab 7362  df-mpo 7363  df-of 7618  df-ofr 7619  df-om 7804  df-1st 7922  df-2nd 7923  df-supp 8094  df-tpos 8158  df-frecs 8213  df-wrecs 8244  df-recs 8318  df-rdg 8357  df-1o 8413  df-2o 8414  df-oadd 8417  df-er 8649  df-ec 8651  df-qs 8655  df-map 8768  df-pm 8769  df-ixp 8837  df-en 8885  df-dom 8886  df-sdom 8887  df-fin 8888  df-fsupp 9307  df-sup 9379  df-inf 9380  df-oi 9447  df-dju 9838  df-card 9876  df-pnf 11192  df-mnf 11193  df-xr 11194  df-ltxr 11195  df-le 11196  df-sub 11388  df-neg 11389  df-div 11814  df-nn 12155  df-2 12217  df-3 12218  df-4 12219  df-5 12220  df-6 12221  df-7 12222  df-8 12223  df-9 12224  df-n0 12415  df-xnn0 12487  df-z 12501  df-dec 12620  df-uz 12765  df-q 12875  df-rp 12917  df-fz 13426  df-fzo 13569  df-fl 13698  df-mod 13776  df-seq 13908  df-exp 13969  df-hash 14232  df-cj 14985  df-re 14986  df-im 14987  df-sqrt 15121  df-abs 15122  df-dvds 16138  df-gcd 16376  df-prm 16549  df-phi 16639  df-pc 16710  df-struct 17020  df-sets 17037  df-slot 17055  df-ndx 17067  df-base 17085  df-ress 17114  df-plusg 17147  df-mulr 17148  df-starv 17149  df-sca 17150  df-vsca 17151  df-ip 17152  df-tset 17153  df-ple 17154  df-ds 17156  df-unif 17157  df-hom 17158  df-cco 17159  df-0g 17324  df-gsum 17325  df-prds 17330  df-pws 17332  df-imas 17391  df-qus 17392  df-mre 17467  df-mrc 17468  df-acs 17470  df-mgm 18498  df-sgrp 18547  df-mnd 18558  df-mhm 18602  df-submnd 18603  df-grp 18752  df-minusg 18753  df-sbg 18754  df-mulg 18874  df-subg 18926  df-nsg 18927  df-eqg 18928  df-ghm 19007  df-cntz 19098  df-cmn 19565  df-abl 19566  df-mgp 19898  df-ur 19915  df-srg 19919  df-ring 19967  df-cring 19968  df-oppr 20050  df-dvdsr 20071  df-unit 20072  df-invr 20102  df-dvr 20113  df-rnghom 20147  df-drng 20188  df-field 20189  df-subrg 20223  df-lmod 20327  df-lss 20396  df-lsp 20436  df-sra 20636  df-rgmod 20637  df-lidl 20638  df-rsp 20639  df-2idl 20705  df-nzr 20731  df-rlreg 20756  df-domn 20757  df-idom 20758  df-cnfld 20800  df-zring 20873  df-zrh 20907  df-zn 20910  df-assa 21262  df-asp 21263  df-ascl 21264  df-psr 21314  df-mvr 21315  df-mpl 21316  df-opsr 21318  df-evls 21485  df-evl 21486  df-psr1 21554  df-vr1 21555  df-ply1 21556  df-coe1 21557  df-evl1 21685  df-mdeg 25420  df-deg1 25421  df-mon1 25498  df-uc1p 25499  df-q1p 25500  df-r1p 25501  df-lgs 26646
This theorem is referenced by:  lgsqrmodndvds  26704
  Copyright terms: Public domain W3C validator