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

Theorem lgsqrmod 27261
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 27260 . 2 ((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) → ((𝐴 /L 𝑃) = 1 ↔ (¬ 𝑃𝐴 ∧ ∃𝑥 ∈ ℤ 𝑃 ∥ ((𝑥↑2) − 𝐴))))
2 eldifi 4082 . . . . . . . 8 (𝑃 ∈ (ℙ ∖ {2}) → 𝑃 ∈ ℙ)
3 prmnn 16585 . . . . . . . 8 (𝑃 ∈ ℙ → 𝑃 ∈ ℕ)
42, 3syl 17 . . . . . . 7 (𝑃 ∈ (ℙ ∖ {2}) → 𝑃 ∈ ℕ)
54ad2antlr 727 . . . . . 6 (((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) ∧ 𝑥 ∈ ℤ) → 𝑃 ∈ ℕ)
6 zsqcl 14036 . . . . . . 7 (𝑥 ∈ ℤ → (𝑥↑2) ∈ ℤ)
76adantl 481 . . . . . 6 (((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) ∧ 𝑥 ∈ ℤ) → (𝑥↑2) ∈ ℤ)
8 simpll 766 . . . . . 6 (((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) ∧ 𝑥 ∈ ℤ) → 𝐴 ∈ ℤ)
9 moddvds 16174 . . . . . 6 ((𝑃 ∈ ℕ ∧ (𝑥↑2) ∈ ℤ ∧ 𝐴 ∈ ℤ) → (((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃) ↔ 𝑃 ∥ ((𝑥↑2) − 𝐴)))
105, 7, 8, 9syl3anc 1373 . . . . 5 (((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) ∧ 𝑥 ∈ ℤ) → (((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃) ↔ 𝑃 ∥ ((𝑥↑2) − 𝐴)))
1110biimprd 248 . . . 4 (((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) ∧ 𝑥 ∈ ℤ) → (𝑃 ∥ ((𝑥↑2) − 𝐴) → ((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃)))
1211reximdva 3142 . . 3 ((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) → (∃𝑥 ∈ ℤ 𝑃 ∥ ((𝑥↑2) − 𝐴) → ∃𝑥 ∈ ℤ ((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃)))
1312adantld 490 . 2 ((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) → ((¬ 𝑃𝐴 ∧ ∃𝑥 ∈ ℤ 𝑃 ∥ ((𝑥↑2) − 𝐴)) → ∃𝑥 ∈ ℤ ((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃)))
141, 13sylbid 240 1 ((𝐴 ∈ ℤ ∧ 𝑃 ∈ (ℙ ∖ {2})) → ((𝐴 /L 𝑃) = 1 → ∃𝑥 ∈ ℤ ((𝑥↑2) mod 𝑃) = (𝐴 mod 𝑃)))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wb 206  wa 395   = wceq 1540  wcel 2109  wrex 3053  cdif 3900  {csn 4577   class class class wbr 5092  (class class class)co 7349  1c1 11010  cmin 11347  cn 12128  2c2 12183  cz 12471   mod cmo 13773  cexp 13968  cdvds 16163  cprime 16582   /L clgs 27203
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1795  ax-4 1809  ax-5 1910  ax-6 1967  ax-7 2008  ax-8 2111  ax-9 2119  ax-10 2142  ax-11 2158  ax-12 2178  ax-ext 2701  ax-rep 5218  ax-sep 5235  ax-nul 5245  ax-pow 5304  ax-pr 5371  ax-un 7671  ax-cnex 11065  ax-resscn 11066  ax-1cn 11067  ax-icn 11068  ax-addcl 11069  ax-addrcl 11070  ax-mulcl 11071  ax-mulrcl 11072  ax-mulcom 11073  ax-addass 11074  ax-mulass 11075  ax-distr 11076  ax-i2m1 11077  ax-1ne0 11078  ax-1rid 11079  ax-rnegex 11080  ax-rrecex 11081  ax-cnre 11082  ax-pre-lttri 11083  ax-pre-lttrn 11084  ax-pre-ltadd 11085  ax-pre-mulgt0 11086  ax-pre-sup 11087  ax-addf 11088  ax-mulf 11089
This theorem depends on definitions:  df-bi 207  df-an 396  df-or 848  df-3or 1087  df-3an 1088  df-tru 1543  df-fal 1553  df-ex 1780  df-nf 1784  df-sb 2066  df-mo 2533  df-eu 2562  df-clab 2708  df-cleq 2721  df-clel 2803  df-nfc 2878  df-ne 2926  df-nel 3030  df-ral 3045  df-rex 3054  df-rmo 3343  df-reu 3344  df-rab 3395  df-v 3438  df-sbc 3743  df-csb 3852  df-dif 3906  df-un 3908  df-in 3910  df-ss 3920  df-pss 3923  df-nul 4285  df-if 4477  df-pw 4553  df-sn 4578  df-pr 4580  df-tp 4582  df-op 4584  df-uni 4859  df-int 4897  df-iun 4943  df-iin 4944  df-br 5093  df-opab 5155  df-mpt 5174  df-tr 5200  df-id 5514  df-eprel 5519  df-po 5527  df-so 5528  df-fr 5572  df-se 5573  df-we 5574  df-xp 5625  df-rel 5626  df-cnv 5627  df-co 5628  df-dm 5629  df-rn 5630  df-res 5631  df-ima 5632  df-pred 6249  df-ord 6310  df-on 6311  df-lim 6312  df-suc 6313  df-iota 6438  df-fun 6484  df-fn 6485  df-f 6486  df-f1 6487  df-fo 6488  df-f1o 6489  df-fv 6490  df-isom 6491  df-riota 7306  df-ov 7352  df-oprab 7353  df-mpo 7354  df-of 7613  df-ofr 7614  df-om 7800  df-1st 7924  df-2nd 7925  df-supp 8094  df-tpos 8159  df-frecs 8214  df-wrecs 8245  df-recs 8294  df-rdg 8332  df-1o 8388  df-2o 8389  df-oadd 8392  df-er 8625  df-ec 8627  df-qs 8631  df-map 8755  df-pm 8756  df-ixp 8825  df-en 8873  df-dom 8874  df-sdom 8875  df-fin 8876  df-fsupp 9252  df-sup 9332  df-inf 9333  df-oi 9402  df-dju 9797  df-card 9835  df-pnf 11151  df-mnf 11152  df-xr 11153  df-ltxr 11154  df-le 11155  df-sub 11349  df-neg 11350  df-div 11778  df-nn 12129  df-2 12191  df-3 12192  df-4 12193  df-5 12194  df-6 12195  df-7 12196  df-8 12197  df-9 12198  df-n0 12385  df-xnn0 12458  df-z 12472  df-dec 12592  df-uz 12736  df-q 12850  df-rp 12894  df-fz 13411  df-fzo 13558  df-fl 13696  df-mod 13774  df-seq 13909  df-exp 13969  df-hash 14238  df-cj 15006  df-re 15007  df-im 15008  df-sqrt 15142  df-abs 15143  df-dvds 16164  df-gcd 16406  df-prm 16583  df-phi 16677  df-pc 16749  df-struct 17058  df-sets 17075  df-slot 17093  df-ndx 17105  df-base 17121  df-ress 17142  df-plusg 17174  df-mulr 17175  df-starv 17176  df-sca 17177  df-vsca 17178  df-ip 17179  df-tset 17180  df-ple 17181  df-ds 17183  df-unif 17184  df-hom 17185  df-cco 17186  df-0g 17345  df-gsum 17346  df-prds 17351  df-pws 17353  df-imas 17412  df-qus 17413  df-mre 17488  df-mrc 17489  df-acs 17491  df-mgm 18514  df-sgrp 18593  df-mnd 18609  df-mhm 18657  df-submnd 18658  df-grp 18815  df-minusg 18816  df-sbg 18817  df-mulg 18947  df-subg 19002  df-nsg 19003  df-eqg 19004  df-ghm 19092  df-cntz 19196  df-cmn 19661  df-abl 19662  df-mgp 20026  df-rng 20038  df-ur 20067  df-srg 20072  df-ring 20120  df-cring 20121  df-oppr 20222  df-dvdsr 20242  df-unit 20243  df-invr 20273  df-dvr 20286  df-rhm 20357  df-nzr 20398  df-subrng 20431  df-subrg 20455  df-rlreg 20579  df-domn 20580  df-idom 20581  df-drng 20616  df-field 20617  df-lmod 20765  df-lss 20835  df-lsp 20875  df-sra 21077  df-rgmod 21078  df-lidl 21115  df-rsp 21116  df-2idl 21157  df-cnfld 21262  df-zring 21354  df-zrh 21410  df-zn 21413  df-assa 21760  df-asp 21761  df-ascl 21762  df-psr 21816  df-mvr 21817  df-mpl 21818  df-opsr 21820  df-evls 21979  df-evl 21980  df-psr1 22062  df-vr1 22063  df-ply1 22064  df-coe1 22065  df-evl1 22201  df-mdeg 25958  df-deg1 25959  df-mon1 26034  df-uc1p 26035  df-q1p 26036  df-r1p 26037  df-lgs 27204
This theorem is referenced by:  lgsqrmodndvds  27262
  Copyright terms: Public domain W3C validator