HomeHome Intuitionistic Logic Explorer
Theorem List (p. 153 of 157)
< Previous  Next >
Browser slow? Try the
Unicode version.

Mirrors  >  Metamath Home Page  >  ILE Home Page  >  Theorem List Contents  >  Recent Proofs       This page: Page List

Theorem List for Intuitionistic Logic Explorer - 15201-15300   *Has distinct variable group(s)
TypeLabelDescription
Statement
 
Theoremlgs1 15201 The Legendre symbol at  1. See definition in [ApostolNT] p. 188. (Contributed by Mario Carneiro, 28-Apr-2016.)
 |-  ( A  e.  ZZ  ->  ( A  /L
 1 )  =  1 )
 
Theoremlgsmodeq 15202 The Legendre (Jacobi) symbol is preserved under reduction  mod  n when  n is odd. Theorem 9.9(c) in [ApostolNT] p. 188. (Contributed by AV, 20-Jul-2021.)
 |-  ( ( A  e.  ZZ  /\  B  e.  ZZ  /\  ( N  e.  NN  /\ 
 -.  2  ||  N ) )  ->  ( ( A  mod  N )  =  ( B  mod  N )  ->  ( A  /L N )  =  ( B  /L N ) ) )
 
Theoremlgsmulsqcoprm 15203 The Legendre (Jacobi) symbol is preserved under multiplication with a square of an integer coprime to the second argument. Theorem 9.9(d) in [ApostolNT] p. 188. (Contributed by AV, 20-Jul-2021.)
 |-  ( ( ( A  e.  ZZ  /\  A  =/=  0 )  /\  ( B  e.  ZZ  /\  B  =/=  0 )  /\  ( N  e.  ZZ  /\  ( A  gcd  N )  =  1 ) )  ->  ( ( ( A ^ 2 )  x.  B )  /L N )  =  ( B  /L N ) )
 
Theoremlgsdirnn0 15204 Variation on lgsdir 15192 valid for all  A ,  B but only for positive  N. (The exact location of the failure of this law is for  A  =  0,  B  <  0,  N  =  -u 1 in which case  ( 0  /L -u 1
)  =  1 but  ( B  /L -u 1 )  = 
-u 1.) (Contributed by Mario Carneiro, 28-Apr-2016.)
 |-  ( ( A  e.  ZZ  /\  B  e.  ZZ  /\  N  e.  NN0 )  ->  ( ( A  x.  B )  /L N )  =  ( ( A  /L N )  x.  ( B  /L N ) ) )
 
Theoremlgsdinn0 15205 Variation on lgsdi 15194 valid for all  M ,  N but only for positive  A. (The exact location of the failure of this law is for  A  =  -u
1,  M  =  0, and some  N in which case  ( -u 1  /L 0 )  =  1 but  ( -u 1  /L N )  = 
-u 1 when  -u 1 is not a quadratic residue mod  N.) (Contributed by Mario Carneiro, 28-Apr-2016.)
 |-  ( ( A  e.  NN0  /\  M  e.  ZZ  /\  N  e.  ZZ )  ->  ( A  /L
 ( M  x.  N ) )  =  (
 ( A  /L M )  x.  ( A  /L N ) ) )
 
11.3.3  Gauss' Lemma

Gauss' Lemma is valid for any integer not dividing the given prime number. In the following, only the special case for 2 (not dividing any odd prime) is proven, see gausslemma2d 15226. The general case is still to prove.

 
Theoremgausslemma2dlem0a 15206 Auxiliary lemma 1 for gausslemma2d 15226. (Contributed by AV, 9-Jul-2021.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   =>    |-  ( ph  ->  P  e.  NN )
 
Theoremgausslemma2dlem0b 15207 Auxiliary lemma 2 for gausslemma2d 15226. (Contributed by AV, 9-Jul-2021.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  H  =  ( ( P  -  1 )  /  2
 )   =>    |-  ( ph  ->  H  e.  NN )
 
Theoremgausslemma2dlem0c 15208 Auxiliary lemma 3 for gausslemma2d 15226. (Contributed by AV, 13-Jul-2021.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  H  =  ( ( P  -  1 )  /  2
 )   =>    |-  ( ph  ->  (
 ( ! `  H )  gcd  P )  =  1 )
 
Theoremgausslemma2dlem0d 15209 Auxiliary lemma 4 for gausslemma2d 15226. (Contributed by AV, 9-Jul-2021.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  M  =  ( |_ `  ( P  /  4 ) )   =>    |-  ( ph  ->  M  e.  NN0 )
 
Theoremgausslemma2dlem0e 15210 Auxiliary lemma 5 for gausslemma2d 15226. (Contributed by AV, 9-Jul-2021.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  M  =  ( |_ `  ( P  /  4 ) )   =>    |-  ( ph  ->  ( M  x.  2 )  <  ( P  /  2 ) )
 
Theoremgausslemma2dlem0f 15211 Auxiliary lemma 6 for gausslemma2d 15226. (Contributed by AV, 9-Jul-2021.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  M  =  ( |_ `  ( P  /  4 ) )   &    |-  H  =  ( ( P  -  1 )  / 
 2 )   =>    |-  ( ph  ->  ( M  +  1 )  <_  H )
 
Theoremgausslemma2dlem0g 15212 Auxiliary lemma 7 for gausslemma2d 15226. (Contributed by AV, 9-Jul-2021.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  M  =  ( |_ `  ( P  /  4 ) )   &    |-  H  =  ( ( P  -  1 )  / 
 2 )   =>    |-  ( ph  ->  M  <_  H )
 
Theoremgausslemma2dlem0h 15213 Auxiliary lemma 8 for gausslemma2d 15226. (Contributed by AV, 9-Jul-2021.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  M  =  ( |_ `  ( P  /  4 ) )   &    |-  H  =  ( ( P  -  1 )  / 
 2 )   &    |-  N  =  ( H  -  M )   =>    |-  ( ph  ->  N  e.  NN0 )
 
Theoremgausslemma2dlem0i 15214 Auxiliary lemma 9 for gausslemma2d 15226. (Contributed by AV, 14-Jul-2021.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  M  =  ( |_ `  ( P  /  4 ) )   &    |-  H  =  ( ( P  -  1 )  / 
 2 )   &    |-  N  =  ( H  -  M )   =>    |-  ( ph  ->  ( (
 ( 2  /L P )  mod  P )  =  ( ( -u 1 ^ N )  mod  P )  ->  ( 2  /L P )  =  ( -u 1 ^ N ) ) )
 
Theoremgausslemma2dlem1a 15215* Lemma for gausslemma2dlem1 15218. (Contributed by AV, 1-Jul-2021.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  H  =  ( ( P  -  1 )  /  2
 )   &    |-  R  =  ( x  e.  ( 1 ...
 H )  |->  if (
 ( x  x.  2
 )  <  ( P  /  2 ) ,  ( x  x.  2 ) ,  ( P  -  ( x  x.  2 ) ) ) )   =>    |-  ( ph  ->  ran  R  =  ( 1 ... H ) )
 
Theoremgausslemma2dlem1cl 15216 Lemma for gausslemma2dlem1 15218. Closure of the body of the definition of  R. (Contributed by Jim Kingdon, 10-Aug-2025.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  H  =  ( ( P  -  1 )  /  2
 )   &    |-  R  =  ( x  e.  ( 1 ...
 H )  |->  if (
 ( x  x.  2
 )  <  ( P  /  2 ) ,  ( x  x.  2 ) ,  ( P  -  ( x  x.  2 ) ) ) )   &    |-  ( ph  ->  A  e.  ( 1 ...
 H ) )   =>    |-  ( ph  ->  if ( ( A  x.  2 )  <  ( P 
 /  2 ) ,  ( A  x.  2
 ) ,  ( P  -  ( A  x.  2 ) ) )  e.  ZZ )
 
Theoremgausslemma2dlem1f1o 15217* Lemma for gausslemma2dlem1 15218. (Contributed by Jim Kingdon, 9-Aug-2025.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  H  =  ( ( P  -  1 )  /  2
 )   &    |-  R  =  ( x  e.  ( 1 ...
 H )  |->  if (
 ( x  x.  2
 )  <  ( P  /  2 ) ,  ( x  x.  2 ) ,  ( P  -  ( x  x.  2 ) ) ) )   =>    |-  ( ph  ->  R : ( 1 ...
 H ) -1-1-onto-> ( 1 ... H ) )
 
Theoremgausslemma2dlem1 15218* Lemma 1 for gausslemma2d 15226. (Contributed by AV, 5-Jul-2021.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  H  =  ( ( P  -  1 )  /  2
 )   &    |-  R  =  ( x  e.  ( 1 ...
 H )  |->  if (
 ( x  x.  2
 )  <  ( P  /  2 ) ,  ( x  x.  2 ) ,  ( P  -  ( x  x.  2 ) ) ) )   =>    |-  ( ph  ->  ( ! `  H )  = 
 prod_ k  e.  (
 1 ... H ) ( R `  k ) )
 
Theoremgausslemma2dlem2 15219* Lemma 2 for gausslemma2d 15226. (Contributed by AV, 4-Jul-2021.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  H  =  ( ( P  -  1 )  /  2
 )   &    |-  R  =  ( x  e.  ( 1 ...
 H )  |->  if (
 ( x  x.  2
 )  <  ( P  /  2 ) ,  ( x  x.  2 ) ,  ( P  -  ( x  x.  2 ) ) ) )   &    |-  M  =  ( |_ `  ( P 
 /  4 ) )   =>    |-  ( ph  ->  A. k  e.  ( 1 ... M ) ( R `  k )  =  (
 k  x.  2 ) )
 
Theoremgausslemma2dlem3 15220* Lemma 3 for gausslemma2d 15226. (Contributed by AV, 4-Jul-2021.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  H  =  ( ( P  -  1 )  /  2
 )   &    |-  R  =  ( x  e.  ( 1 ...
 H )  |->  if (
 ( x  x.  2
 )  <  ( P  /  2 ) ,  ( x  x.  2 ) ,  ( P  -  ( x  x.  2 ) ) ) )   &    |-  M  =  ( |_ `  ( P 
 /  4 ) )   =>    |-  ( ph  ->  A. k  e.  ( ( M  +  1 ) ... H ) ( R `  k )  =  ( P  -  ( k  x.  2 ) ) )
 
Theoremgausslemma2dlem4 15221* Lemma 4 for gausslemma2d 15226. (Contributed by AV, 16-Jun-2021.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  H  =  ( ( P  -  1 )  /  2
 )   &    |-  R  =  ( x  e.  ( 1 ...
 H )  |->  if (
 ( x  x.  2
 )  <  ( P  /  2 ) ,  ( x  x.  2 ) ,  ( P  -  ( x  x.  2 ) ) ) )   &    |-  M  =  ( |_ `  ( P 
 /  4 ) )   =>    |-  ( ph  ->  ( ! `  H )  =  (
 prod_ k  e.  (
 1 ... M ) ( R `  k )  x.  prod_ k  e.  (
 ( M  +  1 ) ... H ) ( R `  k
 ) ) )
 
Theoremgausslemma2dlem5a 15222* Lemma for gausslemma2dlem5 15223. (Contributed by AV, 8-Jul-2021.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  H  =  ( ( P  -  1 )  /  2
 )   &    |-  R  =  ( x  e.  ( 1 ...
 H )  |->  if (
 ( x  x.  2
 )  <  ( P  /  2 ) ,  ( x  x.  2 ) ,  ( P  -  ( x  x.  2 ) ) ) )   &    |-  M  =  ( |_ `  ( P 
 /  4 ) )   =>    |-  ( ph  ->  ( prod_ k  e.  ( ( M  +  1 ) ... H ) ( R `  k )  mod  P )  =  ( prod_ k  e.  ( ( M  +  1 ) ... H ) ( -u 1  x.  ( k  x.  2
 ) )  mod  P ) )
 
Theoremgausslemma2dlem5 15223* Lemma 5 for gausslemma2d 15226. (Contributed by AV, 9-Jul-2021.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  H  =  ( ( P  -  1 )  /  2
 )   &    |-  R  =  ( x  e.  ( 1 ...
 H )  |->  if (
 ( x  x.  2
 )  <  ( P  /  2 ) ,  ( x  x.  2 ) ,  ( P  -  ( x  x.  2 ) ) ) )   &    |-  M  =  ( |_ `  ( P 
 /  4 ) )   &    |-  N  =  ( H  -  M )   =>    |-  ( ph  ->  ( prod_ k  e.  ( ( M  +  1 )
 ... H ) ( R `  k ) 
 mod  P )  =  ( ( ( -u 1 ^ N )  x.  prod_ k  e.  ( ( M  +  1 ) ... H ) ( k  x.  2 ) )  mod  P ) )
 
Theoremgausslemma2dlem6 15224* Lemma 6 for gausslemma2d 15226. (Contributed by AV, 16-Jun-2021.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  H  =  ( ( P  -  1 )  /  2
 )   &    |-  R  =  ( x  e.  ( 1 ...
 H )  |->  if (
 ( x  x.  2
 )  <  ( P  /  2 ) ,  ( x  x.  2 ) ,  ( P  -  ( x  x.  2 ) ) ) )   &    |-  M  =  ( |_ `  ( P 
 /  4 ) )   &    |-  N  =  ( H  -  M )   =>    |-  ( ph  ->  (
 ( ! `  H )  mod  P )  =  ( ( ( (
 -u 1 ^ N )  x.  ( 2 ^ H ) )  x.  ( ! `  H ) )  mod  P ) )
 
Theoremgausslemma2dlem7 15225* Lemma 7 for gausslemma2d 15226. (Contributed by AV, 13-Jul-2021.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  H  =  ( ( P  -  1 )  /  2
 )   &    |-  R  =  ( x  e.  ( 1 ...
 H )  |->  if (
 ( x  x.  2
 )  <  ( P  /  2 ) ,  ( x  x.  2 ) ,  ( P  -  ( x  x.  2 ) ) ) )   &    |-  M  =  ( |_ `  ( P 
 /  4 ) )   &    |-  N  =  ( H  -  M )   =>    |-  ( ph  ->  (
 ( ( -u 1 ^ N )  x.  (
 2 ^ H ) )  mod  P )  =  1 )
 
Theoremgausslemma2d 15226* Gauss' Lemma (see also theorem 9.6 in [ApostolNT] p. 182) for integer  2: Let p be an odd prime. Let S = {2, 4, 6, ..., p - 1}. Let n denote the number of elements of S whose least positive residue modulo p is greater than p/2. Then ( 2 | p ) = (-1)^n. (Contributed by AV, 14-Jul-2021.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  H  =  ( ( P  -  1 )  /  2
 )   &    |-  R  =  ( x  e.  ( 1 ...
 H )  |->  if (
 ( x  x.  2
 )  <  ( P  /  2 ) ,  ( x  x.  2 ) ,  ( P  -  ( x  x.  2 ) ) ) )   &    |-  M  =  ( |_ `  ( P 
 /  4 ) )   &    |-  N  =  ( H  -  M )   =>    |-  ( ph  ->  (
 2  /L P )  =  ( -u 1 ^ N ) )
 
11.3.4  Quadratic reciprocity
 
Theoremlgseisenlem1 15227* Lemma for lgseisen 15231. If  R ( u )  =  ( Q  x.  u )  mod  P and  M ( u )  =  ( -u
1 ^ R ( u ) )  x.  R ( u ), then for any even  1  <_  u  <_  P  -  1,  M ( u ) is also an even integer  1  <_  M
( u )  <_  P  -  1. To simplify these statements, we divide all the even numbers by  2, so that it becomes the statement that  M ( x  /  2 )  =  ( -u 1 ^ R ( x  / 
2 ) )  x.  R ( x  / 
2 )  /  2 is an integer between  1 and  ( P  -  1 )  / 
2. (Contributed by Mario Carneiro, 17-Jun-2015.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  ( ph  ->  Q  e.  ( Prime  \  { 2 } ) )   &    |-  ( ph  ->  P  =/=  Q )   &    |-  R  =  ( ( Q  x.  ( 2  x.  x ) )  mod  P )   &    |-  M  =  ( x  e.  ( 1 ... (
 ( P  -  1
 )  /  2 )
 )  |->  ( ( ( ( -u 1 ^ R )  x.  R )  mod  P )  /  2 ) )   =>    |-  ( ph  ->  M : ( 1 ... ( ( P  -  1 )  /  2
 ) ) --> ( 1
 ... ( ( P  -  1 )  / 
 2 ) ) )
 
Theoremlgseisenlem2 15228* Lemma for lgseisen 15231. The function  M is an injection (and hence a bijection by the pigeonhole principle). (Contributed by Mario Carneiro, 17-Jun-2015.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  ( ph  ->  Q  e.  ( Prime  \  { 2 } ) )   &    |-  ( ph  ->  P  =/=  Q )   &    |-  R  =  ( ( Q  x.  ( 2  x.  x ) )  mod  P )   &    |-  M  =  ( x  e.  ( 1 ... (
 ( P  -  1
 )  /  2 )
 )  |->  ( ( ( ( -u 1 ^ R )  x.  R )  mod  P )  /  2 ) )   &    |-  S  =  ( ( Q  x.  (
 2  x.  y ) )  mod  P )   =>    |-  ( ph  ->  M :
 ( 1 ... (
 ( P  -  1
 )  /  2 )
 )
 -1-1-onto-> ( 1 ... (
 ( P  -  1
 )  /  2 )
 ) )
 
Theoremlgseisenlem3 15229* Lemma for lgseisen 15231. (Contributed by Mario Carneiro, 17-Jun-2015.) (Proof shortened by AV, 28-Jul-2019.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  ( ph  ->  Q  e.  ( Prime  \  { 2 } ) )   &    |-  ( ph  ->  P  =/=  Q )   &    |-  R  =  ( ( Q  x.  ( 2  x.  x ) )  mod  P )   &    |-  M  =  ( x  e.  ( 1 ... (
 ( P  -  1
 )  /  2 )
 )  |->  ( ( ( ( -u 1 ^ R )  x.  R )  mod  P )  /  2 ) )   &    |-  S  =  ( ( Q  x.  (
 2  x.  y ) )  mod  P )   &    |-  Y  =  (ℤ/n `  P )   &    |-  G  =  (mulGrp `  Y )   &    |-  L  =  ( ZRHom `  Y )   =>    |-  ( ph  ->  ( G  gsumg  ( x  e.  ( 1 ... ( ( P  -  1 )  /  2
 ) )  |->  ( L `
  ( ( -u 1 ^ R )  x.  Q ) ) ) )  =  ( 1r
 `  Y ) )
 
Theoremlgseisenlem4 15230* Lemma for lgseisen 15231. (Contributed by Mario Carneiro, 18-Jun-2015.) (Proof shortened by AV, 15-Jun-2019.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  ( ph  ->  Q  e.  ( Prime  \  { 2 } ) )   &    |-  ( ph  ->  P  =/=  Q )   &    |-  R  =  ( ( Q  x.  ( 2  x.  x ) )  mod  P )   &    |-  M  =  ( x  e.  ( 1 ... (
 ( P  -  1
 )  /  2 )
 )  |->  ( ( ( ( -u 1 ^ R )  x.  R )  mod  P )  /  2 ) )   &    |-  S  =  ( ( Q  x.  (
 2  x.  y ) )  mod  P )   &    |-  Y  =  (ℤ/n `  P )   &    |-  G  =  (mulGrp `  Y )   &    |-  L  =  ( ZRHom `  Y )   =>    |-  ( ph  ->  ( ( Q ^ ( ( P  -  1 )  / 
 2 ) )  mod  P )  =  ( (
 -u 1 ^ sum_ x  e.  ( 1 ... ( ( P  -  1 )  /  2
 ) ) ( |_ `  ( ( Q  /  P )  x.  (
 2  x.  x ) ) ) )  mod  P ) )
 
Theoremlgseisen 15231* Eisenstein's lemma, an expression for 
( P  /L
Q ) when  P ,  Q are distinct odd primes. (Contributed by Mario Carneiro, 18-Jun-2015.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  ( ph  ->  Q  e.  ( Prime  \  { 2 } ) )   &    |-  ( ph  ->  P  =/=  Q )   =>    |-  ( ph  ->  ( Q  /L P )  =  ( -u 1 ^ sum_ x  e.  (
 1 ... ( ( P  -  1 )  / 
 2 ) ) ( |_ `  ( ( Q  /  P )  x.  ( 2  x.  x ) ) ) ) )
 
Theoremlgsquadlemsfi 15232* Lemma for lgsquad 15237. 
S is finite. (Contributed by Jim Kingdon, 16-Sep-2025.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  ( ph  ->  Q  e.  ( Prime  \  { 2 } ) )   &    |-  ( ph  ->  P  =/=  Q )   &    |-  M  =  ( ( P  -  1 )  /  2
 )   &    |-  N  =  ( ( Q  -  1 ) 
 /  2 )   &    |-  S  =  { <. x ,  y >.  |  ( ( x  e.  ( 1 ...
 M )  /\  y  e.  ( 1 ... N ) )  /\  ( y  x.  P )  < 
 ( x  x.  Q ) ) }   =>    |-  ( ph  ->  S  e.  Fin )
 
Theoremlgsquadlemofi 15233* Lemma for lgsquad 15237. There are finitely many members of  S with odd first part. (Contributed by Jim Kingdon, 16-Sep-2025.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  ( ph  ->  Q  e.  ( Prime  \  { 2 } ) )   &    |-  ( ph  ->  P  =/=  Q )   &    |-  M  =  ( ( P  -  1 )  /  2
 )   &    |-  N  =  ( ( Q  -  1 ) 
 /  2 )   &    |-  S  =  { <. x ,  y >.  |  ( ( x  e.  ( 1 ...
 M )  /\  y  e.  ( 1 ... N ) )  /\  ( y  x.  P )  < 
 ( x  x.  Q ) ) }   =>    |-  ( ph  ->  { z  e.  S  |  -.  2  ||  ( 1st `  z ) }  e.  Fin )
 
Theoremlgsquadlem1 15234* Lemma for lgsquad 15237. Count the members of  S with odd coordinates. (Contributed by Mario Carneiro, 19-Jun-2015.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  ( ph  ->  Q  e.  ( Prime  \  { 2 } ) )   &    |-  ( ph  ->  P  =/=  Q )   &    |-  M  =  ( ( P  -  1 )  /  2
 )   &    |-  N  =  ( ( Q  -  1 ) 
 /  2 )   &    |-  S  =  { <. x ,  y >.  |  ( ( x  e.  ( 1 ...
 M )  /\  y  e.  ( 1 ... N ) )  /\  ( y  x.  P )  < 
 ( x  x.  Q ) ) }   =>    |-  ( ph  ->  (
 -u 1 ^ sum_ u  e.  ( ( ( |_ `  ( M 
 /  2 ) )  +  1 ) ... M ) ( |_ `  (
 ( Q  /  P )  x.  ( 2  x.  u ) ) ) )  =  ( -u 1 ^ ( `  { z  e.  S  |  -.  2  ||  ( 1st `  z
 ) } ) ) )
 
Theoremlgsquadlem2 15235* Lemma for lgsquad 15237. Count the members of  S with even coordinates, and combine with lgsquadlem1 15234 to get the total count of lattice points in  S (up to parity). (Contributed by Mario Carneiro, 18-Jun-2015.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  ( ph  ->  Q  e.  ( Prime  \  { 2 } ) )   &    |-  ( ph  ->  P  =/=  Q )   &    |-  M  =  ( ( P  -  1 )  /  2
 )   &    |-  N  =  ( ( Q  -  1 ) 
 /  2 )   &    |-  S  =  { <. x ,  y >.  |  ( ( x  e.  ( 1 ...
 M )  /\  y  e.  ( 1 ... N ) )  /\  ( y  x.  P )  < 
 ( x  x.  Q ) ) }   =>    |-  ( ph  ->  ( Q  /L P )  =  ( -u 1 ^ ( `  S )
 ) )
 
Theoremlgsquadlem3 15236* Lemma for lgsquad 15237. (Contributed by Mario Carneiro, 18-Jun-2015.)
 |-  ( ph  ->  P  e.  ( Prime  \  { 2 } ) )   &    |-  ( ph  ->  Q  e.  ( Prime  \  { 2 } ) )   &    |-  ( ph  ->  P  =/=  Q )   &    |-  M  =  ( ( P  -  1 )  /  2
 )   &    |-  N  =  ( ( Q  -  1 ) 
 /  2 )   &    |-  S  =  { <. x ,  y >.  |  ( ( x  e.  ( 1 ...
 M )  /\  y  e.  ( 1 ... N ) )  /\  ( y  x.  P )  < 
 ( x  x.  Q ) ) }   =>    |-  ( ph  ->  ( ( P  /L Q )  x.  ( Q  /L P ) )  =  ( -u 1 ^ ( M  x.  N ) ) )
 
Theoremlgsquad 15237 The Law of Quadratic Reciprocity, see also theorem 9.8 in [ApostolNT] p. 185. If  P and  Q are distinct odd primes, then the product of the Legendre symbols  ( P  /L
Q ) and  ( Q  /L P ) is the parity of  ( ( P  -  1 )  /  2 )  x.  ( ( Q  - 
1 )  /  2
). This uses Eisenstein's proof, which also has a nice geometric interpretation - see https://en.wikipedia.org/wiki/Proofs_of_quadratic_reciprocity. This is Metamath 100 proof #7. (Contributed by Mario Carneiro, 19-Jun-2015.)
 |-  ( ( P  e.  ( Prime  \  { 2 } )  /\  Q  e.  ( Prime  \  { 2 } )  /\  P  =/=  Q )  ->  ( ( P  /L Q )  x.  ( Q  /L P ) )  =  ( -u 1 ^ (
 ( ( P  -  1 )  /  2
 )  x.  ( ( Q  -  1 ) 
 /  2 ) ) ) )
 
Theoremlgsquad2lem1 15238 Lemma for lgsquad2 15240. (Contributed by Mario Carneiro, 19-Jun-2015.)
 |-  ( ph  ->  M  e.  NN )   &    |-  ( ph  ->  -.  2  ||  M )   &    |-  ( ph  ->  N  e.  NN )   &    |-  ( ph  ->  -.  2  ||  N )   &    |-  ( ph  ->  ( M  gcd  N )  =  1 )   &    |-  ( ph  ->  A  e.  NN )   &    |-  ( ph  ->  B  e.  NN )   &    |-  ( ph  ->  ( A  x.  B )  =  M )   &    |-  ( ph  ->  ( ( A 
 /L N )  x.  ( N  /L A ) )  =  ( -u 1 ^ (
 ( ( A  -  1 )  /  2
 )  x.  ( ( N  -  1 ) 
 /  2 ) ) ) )   &    |-  ( ph  ->  ( ( B  /L N )  x.  ( N  /L B ) )  =  ( -u 1 ^ ( ( ( B  -  1 ) 
 /  2 )  x.  ( ( N  -  1 )  /  2
 ) ) ) )   =>    |-  ( ph  ->  ( ( M  /L N )  x.  ( N  /L M ) )  =  ( -u 1 ^ (
 ( ( M  -  1 )  /  2
 )  x.  ( ( N  -  1 ) 
 /  2 ) ) ) )
 
Theoremlgsquad2lem2 15239* Lemma for lgsquad2 15240. (Contributed by Mario Carneiro, 19-Jun-2015.)
 |-  ( ph  ->  M  e.  NN )   &    |-  ( ph  ->  -.  2  ||  M )   &    |-  ( ph  ->  N  e.  NN )   &    |-  ( ph  ->  -.  2  ||  N )   &    |-  ( ph  ->  ( M  gcd  N )  =  1 )   &    |-  (
 ( ph  /\  ( m  e.  ( Prime  \  {
 2 } )  /\  ( m  gcd  N )  =  1 ) ) 
 ->  ( ( m  /L N )  x.  ( N  /L m ) )  =  ( -u 1 ^ ( ( ( m  -  1 ) 
 /  2 )  x.  ( ( N  -  1 )  /  2
 ) ) ) )   &    |-  ( ps  <->  A. x  e.  (
 1 ... k ) ( ( x  gcd  (
 2  x.  N ) )  =  1  ->  ( ( x  /L N )  x.  ( N  /L x ) )  =  ( -u 1 ^ ( ( ( x  -  1 ) 
 /  2 )  x.  ( ( N  -  1 )  /  2
 ) ) ) ) )   =>    |-  ( ph  ->  (
 ( M  /L N )  x.  ( N  /L M ) )  =  ( -u 1 ^ ( ( ( M  -  1 ) 
 /  2 )  x.  ( ( N  -  1 )  /  2
 ) ) ) )
 
Theoremlgsquad2 15240 Extend lgsquad 15237 to coprime odd integers (the domain of the Jacobi symbol). (Contributed by Mario Carneiro, 19-Jun-2015.)
 |-  ( ph  ->  M  e.  NN )   &    |-  ( ph  ->  -.  2  ||  M )   &    |-  ( ph  ->  N  e.  NN )   &    |-  ( ph  ->  -.  2  ||  N )   &    |-  ( ph  ->  ( M  gcd  N )  =  1 )   =>    |-  ( ph  ->  ( ( M  /L N )  x.  ( N  /L M ) )  =  ( -u 1 ^ ( ( ( M  -  1 ) 
 /  2 )  x.  ( ( N  -  1 )  /  2
 ) ) ) )
 
Theoremlgsquad3 15241 Extend lgsquad2 15240 to integers which share a factor. (Contributed by Mario Carneiro, 19-Jun-2015.)
 |-  ( ( ( M  e.  NN  /\  -.  2  ||  M )  /\  ( N  e.  NN  /\ 
 -.  2  ||  N ) )  ->  ( M 
 /L N )  =  ( ( -u 1 ^ ( ( ( M  -  1 ) 
 /  2 )  x.  ( ( N  -  1 )  /  2
 ) ) )  x.  ( N  /L M ) ) )
 
Theoremm1lgs 15242 The first supplement to the law of quadratic reciprocity. Negative one is a square mod an odd prime  P iff  P  ==  1 (mod  4). See first case of theorem 9.4 in [ApostolNT] p. 181. (Contributed by Mario Carneiro, 19-Jun-2015.)
 |-  ( P  e.  ( Prime  \  { 2 } )  ->  ( ( -u 1  /L P )  =  1  <->  ( P  mod  4 )  =  1
 ) )
 
Theorem2lgslem1a1 15243* Lemma 1 for 2lgslem1a 15245. (Contributed by AV, 16-Jun-2021.)
 |-  ( ( P  e.  NN  /\  -.  2  ||  P )  ->  A. i  e.  ( 1 ... (
 ( P  -  1
 )  /  2 )
 ) ( i  x.  2 )  =  ( ( i  x.  2
 )  mod  P )
 )
 
Theorem2lgslem1a2 15244 Lemma 2 for 2lgslem1a 15245. (Contributed by AV, 18-Jun-2021.)
 |-  ( ( N  e.  ZZ  /\  I  e.  ZZ )  ->  ( ( |_ `  ( N  /  4
 ) )  <  I  <->  ( N  /  2 )  <  ( I  x.  2 ) ) )
 
Theorem2lgslem1a 15245* Lemma 1 for 2lgslem1 15248. (Contributed by AV, 18-Jun-2021.)
 |-  ( ( P  e.  Prime  /\  -.  2  ||  P )  ->  { x  e.  ZZ  |  E. i  e.  ( 1 ... (
 ( P  -  1
 )  /  2 )
 ) ( x  =  ( i  x.  2
 )  /\  ( P  /  2 )  <  ( x  mod  P ) ) }  =  { x  e.  ZZ  |  E. i  e.  ( ( ( |_ `  ( P  /  4
 ) )  +  1 ) ... ( ( P  -  1 ) 
 /  2 ) ) x  =  ( i  x.  2 ) }
 )
 
Theorem2lgslem1b 15246* Lemma 2 for 2lgslem1 15248. (Contributed by AV, 18-Jun-2021.)
 |-  I  =  ( A
 ... B )   &    |-  F  =  ( j  e.  I  |->  ( j  x.  2
 ) )   =>    |-  F : I -1-1-onto-> { x  e.  ZZ  |  E. i  e.  I  x  =  ( i  x.  2
 ) }
 
Theorem2lgslem1c 15247 Lemma 3 for 2lgslem1 15248. (Contributed by AV, 19-Jun-2021.)
 |-  ( ( P  e.  Prime  /\  -.  2  ||  P )  ->  ( |_ `  ( P  /  4
 ) )  <_  (
 ( P  -  1
 )  /  2 )
 )
 
Theorem2lgslem1 15248* Lemma 1 for 2lgs 15261. (Contributed by AV, 19-Jun-2021.)
 |-  ( ( P  e.  Prime  /\  -.  2  ||  P )  ->  ( `  { x  e.  ZZ  |  E. i  e.  ( 1 ... (
 ( P  -  1
 )  /  2 )
 ) ( x  =  ( i  x.  2
 )  /\  ( P  /  2 )  <  ( x  mod  P ) ) } )  =  ( ( ( P  -  1 )  /  2
 )  -  ( |_ `  ( P  /  4
 ) ) ) )
 
Theorem2lgslem2 15249 Lemma 2 for 2lgs 15261. (Contributed by AV, 20-Jun-2021.)
 |-  N  =  ( ( ( P  -  1
 )  /  2 )  -  ( |_ `  ( P  /  4 ) ) )   =>    |-  ( ( P  e.  Prime  /\  -.  2  ||  P )  ->  N  e.  ZZ )
 
Theorem2lgslem3a 15250 Lemma for 2lgslem3a1 15254. (Contributed by AV, 14-Jul-2021.)
 |-  N  =  ( ( ( P  -  1
 )  /  2 )  -  ( |_ `  ( P  /  4 ) ) )   =>    |-  ( ( K  e.  NN0  /\  P  =  ( ( 8  x.  K )  +  1 ) ) 
 ->  N  =  ( 2  x.  K ) )
 
Theorem2lgslem3b 15251 Lemma for 2lgslem3b1 15255. (Contributed by AV, 16-Jul-2021.)
 |-  N  =  ( ( ( P  -  1
 )  /  2 )  -  ( |_ `  ( P  /  4 ) ) )   =>    |-  ( ( K  e.  NN0  /\  P  =  ( ( 8  x.  K )  +  3 ) ) 
 ->  N  =  ( ( 2  x.  K )  +  1 ) )
 
Theorem2lgslem3c 15252 Lemma for 2lgslem3c1 15256. (Contributed by AV, 16-Jul-2021.)
 |-  N  =  ( ( ( P  -  1
 )  /  2 )  -  ( |_ `  ( P  /  4 ) ) )   =>    |-  ( ( K  e.  NN0  /\  P  =  ( ( 8  x.  K )  +  5 ) ) 
 ->  N  =  ( ( 2  x.  K )  +  1 ) )
 
Theorem2lgslem3d 15253 Lemma for 2lgslem3d1 15257. (Contributed by AV, 16-Jul-2021.)
 |-  N  =  ( ( ( P  -  1
 )  /  2 )  -  ( |_ `  ( P  /  4 ) ) )   =>    |-  ( ( K  e.  NN0  /\  P  =  ( ( 8  x.  K )  +  7 ) ) 
 ->  N  =  ( ( 2  x.  K )  +  2 ) )
 
Theorem2lgslem3a1 15254 Lemma 1 for 2lgslem3 15258. (Contributed by AV, 15-Jul-2021.)
 |-  N  =  ( ( ( P  -  1
 )  /  2 )  -  ( |_ `  ( P  /  4 ) ) )   =>    |-  ( ( P  e.  NN  /\  ( P  mod  8 )  =  1
 )  ->  ( N  mod  2 )  =  0 )
 
Theorem2lgslem3b1 15255 Lemma 2 for 2lgslem3 15258. (Contributed by AV, 16-Jul-2021.)
 |-  N  =  ( ( ( P  -  1
 )  /  2 )  -  ( |_ `  ( P  /  4 ) ) )   =>    |-  ( ( P  e.  NN  /\  ( P  mod  8 )  =  3
 )  ->  ( N  mod  2 )  =  1 )
 
Theorem2lgslem3c1 15256 Lemma 3 for 2lgslem3 15258. (Contributed by AV, 16-Jul-2021.)
 |-  N  =  ( ( ( P  -  1
 )  /  2 )  -  ( |_ `  ( P  /  4 ) ) )   =>    |-  ( ( P  e.  NN  /\  ( P  mod  8 )  =  5
 )  ->  ( N  mod  2 )  =  1 )
 
Theorem2lgslem3d1 15257 Lemma 4 for 2lgslem3 15258. (Contributed by AV, 15-Jul-2021.)
 |-  N  =  ( ( ( P  -  1
 )  /  2 )  -  ( |_ `  ( P  /  4 ) ) )   =>    |-  ( ( P  e.  NN  /\  ( P  mod  8 )  =  7
 )  ->  ( N  mod  2 )  =  0 )
 
Theorem2lgslem3 15258 Lemma 3 for 2lgs 15261. (Contributed by AV, 16-Jul-2021.)
 |-  N  =  ( ( ( P  -  1
 )  /  2 )  -  ( |_ `  ( P  /  4 ) ) )   =>    |-  ( ( P  e.  NN  /\  -.  2  ||  P )  ->  ( N 
 mod  2 )  =  if ( ( P 
 mod  8 )  e. 
 { 1 ,  7 } ,  0 ,  1 ) )
 
Theorem2lgs2 15259 The Legendre symbol for  2 at  2 is  0. (Contributed by AV, 20-Jun-2021.)
 |-  ( 2  /L
 2 )  =  0
 
Theorem2lgslem4 15260 Lemma 4 for 2lgs 15261: special case of 2lgs 15261 for  P  = 
2. (Contributed by AV, 20-Jun-2021.)
 |-  ( ( 2  /L 2 )  =  1  <->  ( 2  mod  8 )  e.  {
 1 ,  7 } )
 
Theorem2lgs 15261 The second supplement to the law of quadratic reciprocity (for the Legendre symbol extended to arbitrary primes as second argument). Two is a square modulo a prime 
P iff  P  ==  pm 1 (mod  8), see first case of theorem 9.5 in [ApostolNT] p. 181. This theorem justifies our definition of  ( N  /L 2 ) (lgs2 15174) to some degree, by demanding that reciprocity extend to the case  Q  =  2. (Proposed by Mario Carneiro, 19-Jun-2015.) (Contributed by AV, 16-Jul-2021.)
 |-  ( P  e.  Prime  ->  ( ( 2  /L P )  =  1  <-> 
 ( P  mod  8
 )  e.  { 1 ,  7 } )
 )
 
Theorem2lgsoddprmlem1 15262 Lemma 1 for 2lgsoddprm . (Contributed by AV, 19-Jul-2021.)
 |-  ( ( A  e.  ZZ  /\  B  e.  ZZ  /\  N  =  ( ( 8  x.  A )  +  B ) ) 
 ->  ( ( ( N ^ 2 )  -  1 )  /  8
 )  =  ( ( ( 8  x.  ( A ^ 2 ) )  +  ( 2  x.  ( A  x.  B ) ) )  +  ( ( ( B ^ 2 )  -  1 )  /  8
 ) ) )
 
Theorem2lgsoddprmlem2 15263 Lemma 2 for 2lgsoddprm . (Contributed by AV, 19-Jul-2021.)
 |-  ( ( N  e.  ZZ  /\  -.  2  ||  N  /\  R  =  ( N  mod  8 ) )  ->  ( 2  ||  ( ( ( N ^ 2 )  -  1 )  /  8
 ) 
 <->  2  ||  ( (
 ( R ^ 2
 )  -  1 ) 
 /  8 ) ) )
 
Theorem2lgsoddprmlem3a 15264 Lemma 1 for 2lgsoddprmlem3 15268. (Contributed by AV, 20-Jul-2021.)
 |-  ( ( ( 1 ^ 2 )  -  1 )  /  8
 )  =  0
 
Theorem2lgsoddprmlem3b 15265 Lemma 2 for 2lgsoddprmlem3 15268. (Contributed by AV, 20-Jul-2021.)
 |-  ( ( ( 3 ^ 2 )  -  1 )  /  8
 )  =  1
 
Theorem2lgsoddprmlem3c 15266 Lemma 3 for 2lgsoddprmlem3 15268. (Contributed by AV, 20-Jul-2021.)
 |-  ( ( ( 5 ^ 2 )  -  1 )  /  8
 )  =  3
 
Theorem2lgsoddprmlem3d 15267 Lemma 4 for 2lgsoddprmlem3 15268. (Contributed by AV, 20-Jul-2021.)
 |-  ( ( ( 7 ^ 2 )  -  1 )  /  8
 )  =  ( 2  x.  3 )
 
Theorem2lgsoddprmlem3 15268 Lemma 3 for 2lgsoddprm . (Contributed by AV, 20-Jul-2021.)
 |-  ( ( N  e.  ZZ  /\  -.  2  ||  N  /\  R  =  ( N  mod  8 ) )  ->  ( 2  ||  ( ( ( R ^ 2 )  -  1 )  /  8
 ) 
 <->  R  e.  { 1 ,  7 } )
 )
 
Theorem2lgsoddprmlem4 15269 Lemma 4 for 2lgsoddprm . (Contributed by AV, 20-Jul-2021.)
 |-  ( ( N  e.  ZZ  /\  -.  2  ||  N )  ->  ( 2 
 ||  ( ( ( N ^ 2 )  -  1 )  / 
 8 )  <->  ( N  mod  8 )  e.  { 1 ,  7 } )
 )
 
Theorem2lgsoddprm 15270 The second supplement to the law of quadratic reciprocity for odd primes (common representation, see theorem 9.5 in [ApostolNT] p. 181): The Legendre symbol for  2 at an odd prime is minus one to the power of the square of the odd prime minus one divided by eight ( (
2  /L P ) = -1^(((P^2)-1)/8) ). (Contributed by AV, 20-Jul-2021.)
 |-  ( P  e.  ( Prime  \  { 2 } )  ->  ( 2  /L P )  =  ( -u 1 ^ (
 ( ( P ^
 2 )  -  1
 )  /  8 )
 ) )
 
11.3.5  All primes 4n+1 are the sum of two squares
 
Theorem2sqlem1 15271* Lemma for 2sq . (Contributed by Mario Carneiro, 19-Jun-2015.)
 |-  S  =  ran  ( w  e.  ZZ[_i]  |->  ( ( abs `  w ) ^ 2
 ) )   =>    |-  ( A  e.  S  <->  E. x  e.  ZZ[_i]  A  =  ( ( abs `  x ) ^ 2 ) )
 
Theorem2sqlem2 15272* Lemma for 2sq . (Contributed by Mario Carneiro, 19-Jun-2015.)
 |-  S  =  ran  ( w  e.  ZZ[_i]  |->  ( ( abs `  w ) ^ 2
 ) )   =>    |-  ( A  e.  S  <->  E. x  e.  ZZ  E. y  e.  ZZ  A  =  ( ( x ^
 2 )  +  (
 y ^ 2 ) ) )
 
Theoremmul2sq 15273 Fibonacci's identity (actually due to Diophantus). The product of two sums of two squares is also a sum of two squares. We can take advantage of Gaussian integers here to trivialize the proof. (Contributed by Mario Carneiro, 19-Jun-2015.)
 |-  S  =  ran  ( w  e.  ZZ[_i]  |->  ( ( abs `  w ) ^ 2
 ) )   =>    |-  ( ( A  e.  S  /\  B  e.  S )  ->  ( A  x.  B )  e.  S )
 
Theorem2sqlem3 15274 Lemma for 2sqlem5 15276. (Contributed by Mario Carneiro, 20-Jun-2015.)
 |-  S  =  ran  ( w  e.  ZZ[_i]  |->  ( ( abs `  w ) ^ 2
 ) )   &    |-  ( ph  ->  N  e.  NN )   &    |-  ( ph  ->  P  e.  Prime )   &    |-  ( ph  ->  A  e.  ZZ )   &    |-  ( ph  ->  B  e.  ZZ )   &    |-  ( ph  ->  C  e.  ZZ )   &    |-  ( ph  ->  D  e.  ZZ )   &    |-  ( ph  ->  ( N  x.  P )  =  ( ( A ^ 2 )  +  ( B ^ 2 ) ) )   &    |-  ( ph  ->  P  =  ( ( C ^ 2 )  +  ( D ^ 2 ) ) )   &    |-  ( ph  ->  P 
 ||  ( ( C  x.  B )  +  ( A  x.  D ) ) )   =>    |-  ( ph  ->  N  e.  S )
 
Theorem2sqlem4 15275 Lemma for 2sqlem5 15276. (Contributed by Mario Carneiro, 20-Jun-2015.)
 |-  S  =  ran  ( w  e.  ZZ[_i]  |->  ( ( abs `  w ) ^ 2
 ) )   &    |-  ( ph  ->  N  e.  NN )   &    |-  ( ph  ->  P  e.  Prime )   &    |-  ( ph  ->  A  e.  ZZ )   &    |-  ( ph  ->  B  e.  ZZ )   &    |-  ( ph  ->  C  e.  ZZ )   &    |-  ( ph  ->  D  e.  ZZ )   &    |-  ( ph  ->  ( N  x.  P )  =  ( ( A ^ 2 )  +  ( B ^ 2 ) ) )   &    |-  ( ph  ->  P  =  ( ( C ^ 2 )  +  ( D ^ 2 ) ) )   =>    |-  ( ph  ->  N  e.  S )
 
Theorem2sqlem5 15276 Lemma for 2sq . If a number that is a sum of two squares is divisible by a prime that is a sum of two squares, then the quotient is a sum of two squares. (Contributed by Mario Carneiro, 20-Jun-2015.)
 |-  S  =  ran  ( w  e.  ZZ[_i]  |->  ( ( abs `  w ) ^ 2
 ) )   &    |-  ( ph  ->  N  e.  NN )   &    |-  ( ph  ->  P  e.  Prime )   &    |-  ( ph  ->  ( N  x.  P )  e.  S )   &    |-  ( ph  ->  P  e.  S )   =>    |-  ( ph  ->  N  e.  S )
 
Theorem2sqlem6 15277* Lemma for 2sq . If a number that is a sum of two squares is divisible by a number whose prime divisors are all sums of two squares, then the quotient is a sum of two squares. (Contributed by Mario Carneiro, 20-Jun-2015.)
 |-  S  =  ran  ( w  e.  ZZ[_i]  |->  ( ( abs `  w ) ^ 2
 ) )   &    |-  ( ph  ->  A  e.  NN )   &    |-  ( ph  ->  B  e.  NN )   &    |-  ( ph  ->  A. p  e.  Prime  ( p  ||  B  ->  p  e.  S ) )   &    |-  ( ph  ->  ( A  x.  B )  e.  S )   =>    |-  ( ph  ->  A  e.  S )
 
Theorem2sqlem7 15278* Lemma for 2sq . (Contributed by Mario Carneiro, 19-Jun-2015.)
 |-  S  =  ran  ( w  e.  ZZ[_i]  |->  ( ( abs `  w ) ^ 2
 ) )   &    |-  Y  =  {
 z  |  E. x  e.  ZZ  E. y  e. 
 ZZ  ( ( x 
 gcd  y )  =  1  /\  z  =  ( ( x ^
 2 )  +  (
 y ^ 2 ) ) ) }   =>    |-  Y  C_  ( S  i^i  NN )
 
Theorem2sqlem8a 15279* Lemma for 2sqlem8 15280. (Contributed by Mario Carneiro, 4-Jun-2016.)
 |-  S  =  ran  ( w  e.  ZZ[_i]  |->  ( ( abs `  w ) ^ 2
 ) )   &    |-  Y  =  {
 z  |  E. x  e.  ZZ  E. y  e. 
 ZZ  ( ( x 
 gcd  y )  =  1  /\  z  =  ( ( x ^
 2 )  +  (
 y ^ 2 ) ) ) }   &    |-  ( ph  ->  A. b  e.  (
 1 ... ( M  -  1 ) ) A. a  e.  Y  (
 b  ||  a  ->  b  e.  S ) )   &    |-  ( ph  ->  M  ||  N )   &    |-  ( ph  ->  N  e.  NN )   &    |-  ( ph  ->  M  e.  ( ZZ>= `  2
 ) )   &    |-  ( ph  ->  A  e.  ZZ )   &    |-  ( ph  ->  B  e.  ZZ )   &    |-  ( ph  ->  ( A  gcd  B )  =  1 )   &    |-  ( ph  ->  N  =  ( ( A ^ 2 )  +  ( B ^ 2 ) ) )   &    |-  C  =  ( ( ( A  +  ( M  /  2
 ) )  mod  M )  -  ( M  / 
 2 ) )   &    |-  D  =  ( ( ( B  +  ( M  / 
 2 ) )  mod  M )  -  ( M 
 /  2 ) )   =>    |-  ( ph  ->  ( C  gcd  D )  e.  NN )
 
Theorem2sqlem8 15280* Lemma for 2sq . (Contributed by Mario Carneiro, 20-Jun-2015.)
 |-  S  =  ran  ( w  e.  ZZ[_i]  |->  ( ( abs `  w ) ^ 2
 ) )   &    |-  Y  =  {
 z  |  E. x  e.  ZZ  E. y  e. 
 ZZ  ( ( x 
 gcd  y )  =  1  /\  z  =  ( ( x ^
 2 )  +  (
 y ^ 2 ) ) ) }   &    |-  ( ph  ->  A. b  e.  (
 1 ... ( M  -  1 ) ) A. a  e.  Y  (
 b  ||  a  ->  b  e.  S ) )   &    |-  ( ph  ->  M  ||  N )   &    |-  ( ph  ->  N  e.  NN )   &    |-  ( ph  ->  M  e.  ( ZZ>= `  2
 ) )   &    |-  ( ph  ->  A  e.  ZZ )   &    |-  ( ph  ->  B  e.  ZZ )   &    |-  ( ph  ->  ( A  gcd  B )  =  1 )   &    |-  ( ph  ->  N  =  ( ( A ^ 2 )  +  ( B ^ 2 ) ) )   &    |-  C  =  ( ( ( A  +  ( M  /  2
 ) )  mod  M )  -  ( M  / 
 2 ) )   &    |-  D  =  ( ( ( B  +  ( M  / 
 2 ) )  mod  M )  -  ( M 
 /  2 ) )   &    |-  E  =  ( C  /  ( C  gcd  D ) )   &    |-  F  =  ( D  /  ( C 
 gcd  D ) )   =>    |-  ( ph  ->  M  e.  S )
 
Theorem2sqlem9 15281* Lemma for 2sq . (Contributed by Mario Carneiro, 19-Jun-2015.)
 |-  S  =  ran  ( w  e.  ZZ[_i]  |->  ( ( abs `  w ) ^ 2
 ) )   &    |-  Y  =  {
 z  |  E. x  e.  ZZ  E. y  e. 
 ZZ  ( ( x 
 gcd  y )  =  1  /\  z  =  ( ( x ^
 2 )  +  (
 y ^ 2 ) ) ) }   &    |-  ( ph  ->  A. b  e.  (
 1 ... ( M  -  1 ) ) A. a  e.  Y  (
 b  ||  a  ->  b  e.  S ) )   &    |-  ( ph  ->  M  ||  N )   &    |-  ( ph  ->  M  e.  NN )   &    |-  ( ph  ->  N  e.  Y )   =>    |-  ( ph  ->  M  e.  S )
 
Theorem2sqlem10 15282* Lemma for 2sq . Every factor of a "proper" sum of two squares (where the summands are coprime) is a sum of two squares. (Contributed by Mario Carneiro, 19-Jun-2015.)
 |-  S  =  ran  ( w  e.  ZZ[_i]  |->  ( ( abs `  w ) ^ 2
 ) )   &    |-  Y  =  {
 z  |  E. x  e.  ZZ  E. y  e. 
 ZZ  ( ( x 
 gcd  y )  =  1  /\  z  =  ( ( x ^
 2 )  +  (
 y ^ 2 ) ) ) }   =>    |-  ( ( A  e.  Y  /\  B  e.  NN  /\  B  ||  A )  ->  B  e.  S )
 
PART 12  GUIDES AND MISCELLANEA
 
12.1  Guides (conventions, explanations, and examples)
 
12.1.1  Conventions

This section describes the conventions we use. These conventions often refer to existing mathematical practices, which are discussed in more detail in other references. The following sources lay out how mathematics is developed without the law of the excluded middle. Of course, there are a greater number of sources which assume excluded middle and most of what is in them applies here too (especially in a treatment such as ours which is built on first-order logic and set theory, rather than, say, type theory). Studying how a topic is treated in the Metamath Proof Explorer and the references therein is often a good place to start (and is easy to compare with the Intuitionistic Logic Explorer). The textbooks provide a motivation for what we are doing, whereas Metamath lets you see in detail all hidden and implicit steps. Most standard theorems are accompanied by citations. Some closely followed texts include the following:

  • Axioms of propositional calculus - Stanford Encyclopedia of Philosophy or [Heyting].
  • Axioms of predicate calculus - our axioms are adapted from the ones in the Metamath Proof Explorer.
  • Theorems of propositional calculus - [Heyting].
  • Theorems of pure predicate calculus - Metamath Proof Explorer.
  • Theorems of equality and substitution - Metamath Proof Explorer.
  • Axioms of set theory - [Crosilla].
  • Development of set theory - Chapter 10 of [HoTT].
  • Construction of real and complex numbers - Chapter 11 of [HoTT]; [BauerTaylor].
  • Theorems about real numbers - [Geuvers].
 
Theoremconventions 15283 Unless there is a reason to diverge, we follow the conventions of the Metamath Proof Explorer (MPE, set.mm). This list of conventions is intended to be read in conjunction with the corresponding conventions in the Metamath Proof Explorer, and only the differences are described below.
  • Minimizing axioms and the axiom of choice. We prefer proofs that depend on fewer and/or weaker axioms, even if the proofs are longer. In particular, our choice of IZF (Intuitionistic Zermelo-Fraenkel) over CZF (Constructive Zermelo-Fraenkel, a weaker system) was just an expedient choice because IZF is easier to formalize in Metamath. You can find some development using CZF in BJ's mathbox starting at wbd 15374 (and the section header just above it). As for the axiom of choice, the full axiom of choice implies excluded middle as seen at acexmid 5918, although some authors will use countable choice or dependent choice. For example, countable choice or excluded middle is needed to show that the Cauchy reals coincide with the Dedekind reals - Corollary 11.4.3 of [HoTT], p. (varies).
  • Junk/undefined results. Much of the discussion of this topic in the Metamath Proof Explorer applies except that certain techniques are not available to us. For example, the Metamath Proof Explorer will often say "if a function is evaluated within its domain, a certain result follows; if the function is evaluated outside its domain, the same result follows. Since the function must be evaluated within its domain or outside it, the result follows unconditionally" (the use of excluded middle in this argument is perhaps obvious when stated this way). Often, the easiest fix will be to prove we are evaluating functions within their domains, other times it will be possible to use a theorem like relelfvdm 5587 which says that if a function value produces an inhabited set, then the function is being evaluated within its domain.
  • Bibliography references. The bibliography for the Intuitionistic Logic Explorer is separate from the one for the Metamath Proof Explorer but feel free to copy-paste a citation in either direction in order to cite it.

Label naming conventions

Here are a few of the label naming conventions:

  • Suffixes. We follow the conventions of the Metamath Proof Explorer with a few additions. A biconditional in set.mm which is an implication in iset.mm should have a "r" (for the reverse direction), or "i"/"im" (for the forward direction) appended. A theorem in set.mm which has a decidability condition added should add "dc" to the theorem name. A theorem in set.mm where "nonempty class" is changed to "inhabited class" should add "m" (for member) to the theorem name.
  • iset.mm versus set.mm names

    Theorems which are the same as in set.mm should be named the same (that is, where the statement of the theorem is the same; the proof can differ without a new name being called for). Theorems which are different should be named differently (we do have a small number of intentional exceptions to this rule but on the whole it serves us well).

    As for how to choose names so they are different between iset.mm and set.mm, when possible choose a name which reflect the difference in the theorems. For example, if a theorem in set.mm is an equality and the iset.mm analogue is a subset, add "ss" to the iset.mm name. If need be, add "i" to the iset.mm name (usually as a prefix to some portion of the name).

    As with set.mm, we welcome suggestions for better names (such as names which are more consistent with naming conventions).

    We do try to keep set.mm and iset.mm similar where we can. For example, if a theorem exists in both places but the name in set.mm isn't great, we tend to keep that name for iset.mm, or change it in both files together. This is mainly to make it easier to copy theorems, but also to generally help people browse proofs, find theorems, write proofs, etc.

The following table shows some commonly-used abbreviations in labels which are not found in the Metamath Proof Explorer, in alphabetical order. For each abbreviation we provide a mnenomic to help you remember it, the source theorem/assumption defining it, an expression showing what it looks like, whether or not it is a "syntax fragment" (an abbreviation that indicates a particular kind of syntax), and hyperlinks to label examples that use the abbreviation. The abbreviation is bolded if there is a df-NAME definition but the label fragment is not NAME.

For the "g" abbreviation, this is related to the set.mm usage, in which "is a set" conditions are converted from hypotheses to antecedents, but is also used where "is a set" conditions are added relative to similar set.mm theorems.

AbbreviationMnenomic/MeaningSource ExpressionSyntax?Example(s)
apapart df-pap 7310, df-ap 8603 Yes apadd1 8629, apne 8644
gwith "is a set" condition No 1stvalg 6197, brtposg 6309, setsmsbasg 14658
minhabited (from "member")  E. x x  e.  A No r19.2m 3534, negm 9683, ctm 7170, basmex 12680
seq3, sum3recursive sequence df-seqfrec 10522 Yes seq3-1 10536, fsum3 11533
taptight apartness df-tap 7312 Yes df-tap 7312

(Contributed by Jim Kingdon, 24-Feb-2020.) (New usage is discouraged.)

 |-  ph   =>    |-  ph
 
12.1.2  Definitional examples
 
Theoremex-or 15284 Example for ax-io 710. Example by David A. Wheeler. (Contributed by Mario Carneiro, 9-May-2015.)
 |-  ( 2  =  3  \/  4  =  4 )
 
Theoremex-an 15285 Example for ax-ia1 106. Example by David A. Wheeler. (Contributed by Mario Carneiro, 9-May-2015.)
 |-  ( 2  =  2 
 /\  3  =  3 )
 
Theorem1kp2ke3k 15286 Example for df-dec 9452, 1000 + 2000 = 3000.

This proof disproves (by counterexample) the assertion of Hao Wang, who stated, "There is a theorem in the primitive notation of set theory that corresponds to the arithmetic theorem 1000 + 2000 = 3000. The formula would be forbiddingly long... even if (one) knows the definitions and is asked to simplify the long formula according to them, chances are he will make errors and arrive at some incorrect result." (Hao Wang, "Theory and practice in mathematics" , In Thomas Tymoczko, editor, New Directions in the Philosophy of Mathematics, pp 129-152, Birkauser Boston, Inc., Boston, 1986. (QA8.6.N48). The quote itself is on page 140.)

This is noted in Metamath: A Computer Language for Pure Mathematics by Norman Megill (2007) section 1.1.3. Megill then states, "A number of writers have conveyed the impression that the kind of absolute rigor provided by Metamath is an impossible dream, suggesting that a complete, formal verification of a typical theorem would take millions of steps in untold volumes of books... These writers assume, however, that in order to achieve the kind of complete formal verification they desire one must break down a proof into individual primitive steps that make direct reference to the axioms. This is not necessary. There is no reason not to make use of previously proved theorems rather than proving them over and over... A hierarchy of theorems and definitions permits an exponential growth in the formula sizes and primitive proof steps to be described with only a linear growth in the number of symbols used. Of course, this is how ordinary informal mathematics is normally done anyway, but with Metamath it can be done with absolute rigor and precision."

The proof here starts with  ( 2  +  1 )  =  3, commutes it, and repeatedly multiplies both sides by ten. This is certainly longer than traditional mathematical proofs, e.g., there are a number of steps explicitly shown here to show that we're allowed to do operations such as multiplication. However, while longer, the proof is clearly a manageable size - even though every step is rigorously derived all the way back to the primitive notions of set theory and logic. And while there's a risk of making errors, the many independent verifiers make it much less likely that an incorrect result will be accepted.

This proof heavily relies on the decimal constructor df-dec 9452 developed by Mario Carneiro in 2015. The underlying Metamath language has an intentionally very small set of primitives; it doesn't even have a built-in construct for numbers. Instead, the digits are defined using these primitives, and the decimal constructor is used to make it easy to express larger numbers as combinations of digits.

(Contributed by David A. Wheeler, 29-Jun-2016.) (Shortened by Mario Carneiro using the arithmetic algorithm in mmj2, 30-Jun-2016.)

 |-  (;;; 1 0 0 0  + ;;; 2 0 0 0 )  = ;;; 3 0 0 0
 
Theoremex-fl 15287 Example for df-fl 10342. Example by David A. Wheeler. (Contributed by Mario Carneiro, 18-Jun-2015.)
 |-  ( ( |_ `  (
 3  /  2 )
 )  =  1  /\  ( |_ `  -u (
 3  /  2 )
 )  =  -u 2
 )
 
Theoremex-ceil 15288 Example for df-ceil 10343. (Contributed by AV, 4-Sep-2021.)
 |-  ( ( `  (
 3  /  2 )
 )  =  2  /\  ( `  -u ( 3  / 
 2 ) )  =  -u 1 )
 
Theoremex-exp 15289 Example for df-exp 10613. (Contributed by AV, 4-Sep-2021.)
 |-  ( ( 5 ^
 2 )  = ; 2 5  /\  ( -u 3 ^ -u 2
 )  =  ( 1 
 /  9 ) )
 
Theoremex-fac 15290 Example for df-fac 10800. (Contributed by AV, 4-Sep-2021.)
 |-  ( ! `  5
 )  = ;; 1 2 0
 
Theoremex-bc 15291 Example for df-bc 10822. (Contributed by AV, 4-Sep-2021.)
 |-  ( 5  _C  3
 )  = ; 1 0
 
Theoremex-dvds 15292 Example for df-dvds 11934: 3 divides into 6. (Contributed by David A. Wheeler, 19-May-2015.)
 |-  3  ||  6
 
Theoremex-gcd 15293 Example for df-gcd 12083. (Contributed by AV, 5-Sep-2021.)
 |-  ( -u 6  gcd  9
 )  =  3
 
PART 13  SUPPLEMENTARY MATERIAL (USERS' MATHBOXES)
 
13.1  Mathboxes for user contributions
 
13.1.1  Mathbox guidelines
 
Theoremmathbox 15294 (This theorem is a dummy placeholder for these guidelines. The label of this theorem, "mathbox", is hard-coded into the Metamath program to identify the start of the mathbox section for web page generation.)

A "mathbox" is a user-contributed section that is maintained by its contributor independently from the main part of iset.mm.

For contributors:

By making a contribution, you agree to release it into the public domain, according to the statement at the beginning of iset.mm.

Guidelines:

Mathboxes in iset.mm follow the same practices as in set.mm, so refer to the mathbox guidelines there for more details.

(Contributed by NM, 20-Feb-2007.) (Revised by the Metamath team, 9-Sep-2023.) (New usage is discouraged.)

 |-  ph   =>    |-  ph
 
13.2  Mathbox for BJ
 
13.2.1  Propositional calculus
 
Theorembj-nnsn 15295 As far as implying a negated formula is concerned, a formula is equivalent to its double negation. (Contributed by BJ, 24-Nov-2023.)
 |-  (
 ( ph  ->  -.  ps ) 
 <->  ( -.  -.  ph  ->  -.  ps ) )
 
Theorembj-nnor 15296 Double negation of a disjunction in terms of implication. (Contributed by BJ, 9-Oct-2019.)
 |-  ( -.  -.  ( ph  \/  ps )  <->  ( -.  ph  ->  -.  -.  ps )
 )
 
Theorembj-nnim 15297 The double negation of an implication implies the implication with the consequent doubly negated. (Contributed by BJ, 24-Nov-2023.)
 |-  ( -.  -.  ( ph  ->  ps )  ->  ( ph  ->  -.  -.  ps )
 )
 
Theorembj-nnan 15298 The double negation of a conjunction implies the conjunction of the double negations. (Contributed by BJ, 24-Nov-2023.)
 |-  ( -.  -.  ( ph  /\  ps )  ->  ( -.  -.  ph 
 /\  -.  -.  ps )
 )
 
Theorembj-nnclavius 15299 Clavius law with doubly negated consequent. (Contributed by BJ, 4-Dec-2023.)
 |-  (
 ( -.  ph  ->  ph )  ->  -.  -.  ph )
 
Theorembj-imnimnn 15300 If a formula is implied by both a formula and its negation, then it is not refutable. There is another proof using the inference associated with bj-nnclavius 15299 as its last step. (Contributed by BJ, 27-Oct-2024.)
 |-  ( ph  ->  ps )   &    |-  ( -.  ph  ->  ps )   =>    |- 
 -.  -.  ps
    < Previous  Next >

Page List
Jump to page: Contents  1 1-100 2 101-200 3 201-300 4 301-400 5 401-500 6 501-600 7 601-700 8 701-800 9 801-900 10 901-1000 11 1001-1100 12 1101-1200 13 1201-1300 14 1301-1400 15 1401-1500 16 1501-1600 17 1601-1700 18 1701-1800 19 1801-1900 20 1901-2000 21 2001-2100 22 2101-2200 23 2201-2300 24 2301-2400 25 2401-2500 26 2501-2600 27 2601-2700 28 2701-2800 29 2801-2900 30 2901-3000 31 3001-3100 32 3101-3200 33 3201-3300 34 3301-3400 35 3401-3500 36 3501-3600 37 3601-3700 38 3701-3800 39 3801-3900 40 3901-4000 41 4001-4100 42 4101-4200 43 4201-4300 44 4301-4400 45 4401-4500 46 4501-4600 47 4601-4700 48 4701-4800 49 4801-4900 50 4901-5000 51 5001-5100 52 5101-5200 53 5201-5300 54 5301-5400 55 5401-5500 56 5501-5600 57 5601-5700 58 5701-5800 59 5801-5900 60 5901-6000 61 6001-6100 62 6101-6200 63 6201-6300 64 6301-6400 65 6401-6500 66 6501-6600 67 6601-6700 68 6701-6800 69 6801-6900 70 6901-7000 71 7001-7100 72 7101-7200 73 7201-7300 74 7301-7400 75 7401-7500 76 7501-7600 77 7601-7700 78 7701-7800 79 7801-7900 80 7901-8000 81 8001-8100 82 8101-8200 83 8201-8300 84 8301-8400 85 8401-8500 86 8501-8600 87 8601-8700 88 8701-8800 89 8801-8900 90 8901-9000 91 9001-9100 92 9101-9200 93 9201-9300 94 9301-9400 95 9401-9500 96 9501-9600 97 9601-9700 98 9701-9800 99 9801-9900 100 9901-10000 101 10001-10100 102 10101-10200 103 10201-10300 104 10301-10400 105 10401-10500 106 10501-10600 107 10601-10700 108 10701-10800 109 10801-10900 110 10901-11000 111 11001-11100 112 11101-11200 113 11201-11300 114 11301-11400 115 11401-11500 116 11501-11600 117 11601-11700 118 11701-11800 119 11801-11900 120 11901-12000 121 12001-12100 122 12101-12200 123 12201-12300 124 12301-12400 125 12401-12500 126 12501-12600 127 12601-12700 128 12701-12800 129 12801-12900 130 12901-13000 131 13001-13100 132 13101-13200 133 13201-13300 134 13301-13400 135 13401-13500 136 13501-13600 137 13601-13700 138 13701-13800 139 13801-13900 140 13901-14000 141 14001-14100 142 14101-14200 143 14201-14300 144 14301-14400 145 14401-14500 146 14501-14600 147 14601-14700 148 14701-14800 149 14801-14900 150 14901-15000 151 15001-15100 152 15101-15200 153 15201-15300 154 15301-15400 155 15401-15500 156 15501-15600 157 15601-15644
  Copyright terms: Public domain < Previous  Next >