/-
Copyright 2026 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/
module
public import FormalConjecturesUtilDeterminant of Legendre symbol matrix with factorial shifts
Determinant of the $(p_n-1)/2$-by-$(p_n-1)/2$ matrix with $(i,j)$-entry being the Legendre symbol $$\left(\frac{i^2 - \left(\frac{p_n-1}{2}\right)! j}{p_n}\right),$$ where $p_n$ is the $n$-th prime ($n \ge 2$).
References:
T. Adamczewski, "OEIS Open: How many conjectures can language models turn into theorems?", arXiv:2608.11941 [cs.AI], 2026.
@[expose] public sectionnamespace OeisA226163open MatrixThe $(p-1)/2$-by-$(p-1)/2$ matrix with $(i,j)$-entry being the Jacobi symbol $\left(\frac{i^2 - \left(\frac{p-1}{2}\right)! j}{p}\right)$ for $1 \le i, j \le (p-1)/2$.
def legendreMatrix (p : ℕ) : Matrix (Fin ((p - 1) / 2)) (Fin ((p - 1) / 2)) ℤ :=
let m : ℕ := (p - 1) / 2
let C : ℤ := m.factorial
fun i j =>
let i' : ℤ := i.val + 1
let j' : ℤ := j.val + 1
jacobiSym (i' * i' - C * j') p
Determinant of legendreMatrix for the $n$-th prime $p_n$.
noncomputable def a (n : ℕ) : ℤ :=
(legendreMatrix (Nat.nth Nat.Prime (n - 1))).deth:Nat.nth Nat.Prime (2 - 1) = 3⊢ legendreMatrix 3 0 0 = 0
norm_num [legendreMatrix] All goals completed! 🐙
@[category test, AMS 11]
theorem a_3 : a 3 = -1 := by ⊢ a 3 = -1
have h : Nat.nth Nat.Prime (3 - 1) = 5 := Nat.nth_prime_two_eq_five h:Nat.nth Nat.Prime (3 - 1) = 5⊢ a 3 = -1
rw [a, h:Nat.nth Nat.Prime (3 - 1) = 5⊢ (legendreMatrix (Nat.nth Nat.Prime (3 - 1))).det = -1 h:Nat.nth Nat.Prime (3 - 1) = 5⊢ legendreMatrix 5 0 0 * legendreMatrix 5 1 1 - legendreMatrix 5 0 1 * legendreMatrix 5 1 0 = -1 h, h:Nat.nth Nat.Prime (3 - 1) = 5⊢ (legendreMatrix 5).det = -1 h:Nat.nth Nat.Prime (3 - 1) = 5⊢ legendreMatrix 5 0 0 * legendreMatrix 5 1 1 - legendreMatrix 5 0 1 * legendreMatrix 5 1 0 = -1 det_fin_two h:Nat.nth Nat.Prime (3 - 1) = 5⊢ legendreMatrix 5 0 0 * legendreMatrix 5 1 1 - legendreMatrix 5 0 1 * legendreMatrix 5 1 0 = -1 h:Nat.nth Nat.Prime (3 - 1) = 5⊢ legendreMatrix 5 0 0 * legendreMatrix 5 1 1 - legendreMatrix 5 0 1 * legendreMatrix 5 1 0 = -1] h:Nat.nth Nat.Prime (3 - 1) = 5⊢ legendreMatrix 5 0 0 * legendreMatrix 5 1 1 - legendreMatrix 5 0 1 * legendreMatrix 5 1 0 = -1
norm_num [legendreMatrix] All goals completed! 🐙
@[category test, AMS 11]
theorem a_4 : a 4 = 0 := by ⊢ a 4 = 0
have h : Nat.nth Nat.Prime (4 - 1) = 7 := Nat.nth_prime_three_eq_seven h:Nat.nth Nat.Prime (4 - 1) = 7⊢ a 4 = 0
have hM : legendreMatrix 7 =
!![1, -1, 1;
-1, -1, 0;
-1, 1, -1] := by
ext i j h:Nat.nth Nat.Prime (4 - 1) = 7i:Fin ((7 - 1) / 2)j:Fin ((7 - 1) / 2)⊢ legendreMatrix 7 i j = !![1, -1, 1; -1, -1, 0; -1, 1, -1] i j h:Nat.nth Nat.Prime (4 - 1) = 7hM:legendreMatrix 7 = !![1, -1, 1; -1, -1, 0; -1, 1, -1]⊢ a 4 = 0
fin_cases i «0» h:Nat.nth Nat.Prime (4 - 1) = 7j:Fin ((7 - 1) / 2)⊢ legendreMatrix 7 ((fun i ↦ i) ⟨0, ⋯⟩) j = !![1, -1, 1; -1, -1, 0; -1, 1, -1] ((fun i ↦ i) ⟨0, ⋯⟩) j«1» h:Nat.nth Nat.Prime (4 - 1) = 7j:Fin ((7 - 1) / 2)⊢ legendreMatrix 7 ((fun i ↦ i) ⟨1, ⋯⟩) j = !![1, -1, 1; -1, -1, 0; -1, 1, -1] ((fun i ↦ i) ⟨1, ⋯⟩) j«2» h:Nat.nth Nat.Prime (4 - 1) = 7j:Fin ((7 - 1) / 2)⊢ legendreMatrix 7 ((fun i ↦ i) ⟨2, ⋯⟩) j = !![1, -1, 1; -1, -1, 0; -1, 1, -1] ((fun i ↦ i) ⟨2, ⋯⟩) j h:Nat.nth Nat.Prime (4 - 1) = 7hM:legendreMatrix 7 = !![1, -1, 1; -1, -1, 0; -1, 1, -1]⊢ a 4 = 0 <;> «0» h:Nat.nth Nat.Prime (4 - 1) = 7j:Fin ((7 - 1) / 2)⊢ legendreMatrix 7 ((fun i ↦ i) ⟨0, ⋯⟩) j = !![1, -1, 1; -1, -1, 0; -1, 1, -1] ((fun i ↦ i) ⟨0, ⋯⟩) j«1» h:Nat.nth Nat.Prime (4 - 1) = 7j:Fin ((7 - 1) / 2)⊢ legendreMatrix 7 ((fun i ↦ i) ⟨1, ⋯⟩) j = !![1, -1, 1; -1, -1, 0; -1, 1, -1] ((fun i ↦ i) ⟨1, ⋯⟩) j«2» h:Nat.nth Nat.Prime (4 - 1) = 7j:Fin ((7 - 1) / 2)⊢ legendreMatrix 7 ((fun i ↦ i) ⟨2, ⋯⟩) j = !![1, -1, 1; -1, -1, 0; -1, 1, -1] ((fun i ↦ i) ⟨2, ⋯⟩) j h:Nat.nth Nat.Prime (4 - 1) = 7hM:legendreMatrix 7 = !![1, -1, 1; -1, -1, 0; -1, 1, -1]⊢ a 4 = 0 fin_cases j «2».«0» h:Nat.nth Nat.Prime (4 - 1) = 7⊢ legendreMatrix 7 ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩) =
!![1, -1, 1; -1, -1, 0; -1, 1, -1] ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩)«2».«1» h:Nat.nth Nat.Prime (4 - 1) = 7⊢ legendreMatrix 7 ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩) =
!![1, -1, 1; -1, -1, 0; -1, 1, -1] ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩)«2».«2» h:Nat.nth Nat.Prime (4 - 1) = 7⊢ legendreMatrix 7 ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩) =
!![1, -1, 1; -1, -1, 0; -1, 1, -1] ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩) h:Nat.nth Nat.Prime (4 - 1) = 7hM:legendreMatrix 7 = !![1, -1, 1; -1, -1, 0; -1, 1, -1]⊢ a 4 = 0 <;> «0».«0» h:Nat.nth Nat.Prime (4 - 1) = 7⊢ legendreMatrix 7 ((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩) =
!![1, -1, 1; -1, -1, 0; -1, 1, -1] ((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩)«0».«1» h:Nat.nth Nat.Prime (4 - 1) = 7⊢ legendreMatrix 7 ((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩) =
!![1, -1, 1; -1, -1, 0; -1, 1, -1] ((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩)«0».«2» h:Nat.nth Nat.Prime (4 - 1) = 7⊢ legendreMatrix 7 ((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩) =
!![1, -1, 1; -1, -1, 0; -1, 1, -1] ((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩)«1».«0» h:Nat.nth Nat.Prime (4 - 1) = 7⊢ legendreMatrix 7 ((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩) =
!![1, -1, 1; -1, -1, 0; -1, 1, -1] ((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩)«1».«1» h:Nat.nth Nat.Prime (4 - 1) = 7⊢ legendreMatrix 7 ((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩) =
!![1, -1, 1; -1, -1, 0; -1, 1, -1] ((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩)«1».«2» h:Nat.nth Nat.Prime (4 - 1) = 7⊢ legendreMatrix 7 ((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩) =
!![1, -1, 1; -1, -1, 0; -1, 1, -1] ((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩)«2».«0» h:Nat.nth Nat.Prime (4 - 1) = 7⊢ legendreMatrix 7 ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩) =
!![1, -1, 1; -1, -1, 0; -1, 1, -1] ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩)«2».«1» h:Nat.nth Nat.Prime (4 - 1) = 7⊢ legendreMatrix 7 ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩) =
!![1, -1, 1; -1, -1, 0; -1, 1, -1] ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩)«2».«2» h:Nat.nth Nat.Prime (4 - 1) = 7⊢ legendreMatrix 7 ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩) =
!![1, -1, 1; -1, -1, 0; -1, 1, -1] ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩) h:Nat.nth Nat.Prime (4 - 1) = 7hM:legendreMatrix 7 = !![1, -1, 1; -1, -1, 0; -1, 1, -1]⊢ a 4 = 0 simp [legendreMatrix] «2».«2» h:Nat.nth Nat.Prime (4 - 1) = 7⊢ jacobiSym (9 - ↑(Nat.factorial 3) * 3) 7 = -1 h:Nat.nth Nat.Prime (4 - 1) = 7hM:legendreMatrix 7 = !![1, -1, 1; -1, -1, 0; -1, 1, -1]⊢ a 4 = 0 <;> «0».«0» h:Nat.nth Nat.Prime (4 - 1) = 7⊢ jacobiSym (1 - ↑(Nat.factorial 3)) 7 = 1«0».«1» h:Nat.nth Nat.Prime (4 - 1) = 7⊢ jacobiSym (1 - ↑(Nat.factorial 3) * 2) 7 = -1«0».«2» h:Nat.nth Nat.Prime (4 - 1) = 7⊢ jacobiSym (1 - ↑(Nat.factorial 3) * 3) 7 = 1«1».«0» h:Nat.nth Nat.Prime (4 - 1) = 7⊢ jacobiSym (4 - ↑(Nat.factorial 3)) 7 = -1«1».«1» h:Nat.nth Nat.Prime (4 - 1) = 7⊢ jacobiSym (4 - ↑(Nat.factorial 3) * 2) 7 = -1«1».«2» h:Nat.nth Nat.Prime (4 - 1) = 7⊢ jacobiSym (4 - ↑(Nat.factorial 3) * 3) 7 = 0«2».«0» h:Nat.nth Nat.Prime (4 - 1) = 7⊢ jacobiSym (9 - ↑(Nat.factorial 3)) 7 = -1«2».«1» h:Nat.nth Nat.Prime (4 - 1) = 7⊢ jacobiSym (9 - ↑(Nat.factorial 3) * 2) 7 = 1«2».«2» h:Nat.nth Nat.Prime (4 - 1) = 7⊢ jacobiSym (9 - ↑(Nat.factorial 3) * 3) 7 = -1 h:Nat.nth Nat.Prime (4 - 1) = 7hM:legendreMatrix 7 = !![1, -1, 1; -1, -1, 0; -1, 1, -1]⊢ a 4 = 0 norm_num h:Nat.nth Nat.Prime (4 - 1) = 7hM:legendreMatrix 7 = !![1, -1, 1; -1, -1, 0; -1, 1, -1]⊢ a 4 = 0 h:Nat.nth Nat.Prime (4 - 1) = 7hM:legendreMatrix 7 = !![1, -1, 1; -1, -1, 0; -1, 1, -1]⊢ a 4 = 0
rw [a, h:Nat.nth Nat.Prime (4 - 1) = 7hM:legendreMatrix 7 = !![1, -1, 1; -1, -1, 0; -1, 1, -1]⊢ (legendreMatrix (Nat.nth Nat.Prime (4 - 1))).det = 0 h:Nat.nth Nat.Prime (4 - 1) = 7hM:legendreMatrix 7 = !![1, -1, 1; -1, -1, 0; -1, 1, -1]⊢ !![1, -1, 1; -1, -1, 0; -1, 1, -1].det = 0 h, h:Nat.nth Nat.Prime (4 - 1) = 7hM:legendreMatrix 7 = !![1, -1, 1; -1, -1, 0; -1, 1, -1]⊢ (legendreMatrix 7).det = 0 h:Nat.nth Nat.Prime (4 - 1) = 7hM:legendreMatrix 7 = !![1, -1, 1; -1, -1, 0; -1, 1, -1]⊢ !![1, -1, 1; -1, -1, 0; -1, 1, -1].det = 0 hM h:Nat.nth Nat.Prime (4 - 1) = 7hM:legendreMatrix 7 = !![1, -1, 1; -1, -1, 0; -1, 1, -1]⊢ !![1, -1, 1; -1, -1, 0; -1, 1, -1].det = 0 h:Nat.nth Nat.Prime (4 - 1) = 7hM:legendreMatrix 7 = !![1, -1, 1; -1, -1, 0; -1, 1, -1]⊢ !![1, -1, 1; -1, -1, 0; -1, 1, -1].det = 0] h:Nat.nth Nat.Prime (4 - 1) = 7hM:legendreMatrix 7 = !![1, -1, 1; -1, -1, 0; -1, 1, -1]⊢ !![1, -1, 1; -1, -1, 0; -1, 1, -1].det = 0
eval_det All goals completed! 🐙
@[category test, AMS 11]
theorem a_5 : a 5 = 0 := by ⊢ a 5 = 0
have h : Nat.nth Nat.Prime (5 - 1) = 11 := Nat.nth_prime_four_eq_eleven h:Nat.nth Nat.Prime (5 - 1) = 11⊢ a 5 = 0
have hM : legendreMatrix 11 =
!![-1, 1, 1, 1, -1;
1, -1, -1, -1, 1;
-1, 0, 1, -1, 1;
-1, -1, -1, 1, -1;
1, 1, -1, -1, -1] := by
ext i j h:Nat.nth Nat.Prime (5 - 1) = 11i:Fin ((11 - 1) / 2)j:Fin ((11 - 1) / 2)⊢ legendreMatrix 11 i j = !![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] i j h:Nat.nth Nat.Prime (5 - 1) = 11hM:legendreMatrix 11 = !![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1]⊢ a 5 = 0
fin_cases i «0» h:Nat.nth Nat.Prime (5 - 1) = 11j:Fin ((11 - 1) / 2)⊢ legendreMatrix 11 ((fun i ↦ i) ⟨0, ⋯⟩) j =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨0, ⋯⟩) j«1» h:Nat.nth Nat.Prime (5 - 1) = 11j:Fin ((11 - 1) / 2)⊢ legendreMatrix 11 ((fun i ↦ i) ⟨1, ⋯⟩) j =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨1, ⋯⟩) j«2» h:Nat.nth Nat.Prime (5 - 1) = 11j:Fin ((11 - 1) / 2)⊢ legendreMatrix 11 ((fun i ↦ i) ⟨2, ⋯⟩) j =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨2, ⋯⟩) j«3» h:Nat.nth Nat.Prime (5 - 1) = 11j:Fin ((11 - 1) / 2)⊢ legendreMatrix 11 ((fun i ↦ i) ⟨3, ⋯⟩) j =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨3, ⋯⟩) j«4» h:Nat.nth Nat.Prime (5 - 1) = 11j:Fin ((11 - 1) / 2)⊢ legendreMatrix 11 ((fun i ↦ i) ⟨4, ⋯⟩) j =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨4, ⋯⟩) j h:Nat.nth Nat.Prime (5 - 1) = 11hM:legendreMatrix 11 = !![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1]⊢ a 5 = 0 <;> «0» h:Nat.nth Nat.Prime (5 - 1) = 11j:Fin ((11 - 1) / 2)⊢ legendreMatrix 11 ((fun i ↦ i) ⟨0, ⋯⟩) j =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨0, ⋯⟩) j«1» h:Nat.nth Nat.Prime (5 - 1) = 11j:Fin ((11 - 1) / 2)⊢ legendreMatrix 11 ((fun i ↦ i) ⟨1, ⋯⟩) j =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨1, ⋯⟩) j«2» h:Nat.nth Nat.Prime (5 - 1) = 11j:Fin ((11 - 1) / 2)⊢ legendreMatrix 11 ((fun i ↦ i) ⟨2, ⋯⟩) j =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨2, ⋯⟩) j«3» h:Nat.nth Nat.Prime (5 - 1) = 11j:Fin ((11 - 1) / 2)⊢ legendreMatrix 11 ((fun i ↦ i) ⟨3, ⋯⟩) j =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨3, ⋯⟩) j«4» h:Nat.nth Nat.Prime (5 - 1) = 11j:Fin ((11 - 1) / 2)⊢ legendreMatrix 11 ((fun i ↦ i) ⟨4, ⋯⟩) j =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨4, ⋯⟩) j h:Nat.nth Nat.Prime (5 - 1) = 11hM:legendreMatrix 11 = !![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1]⊢ a 5 = 0 fin_cases j «4».«0» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨4, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨4, ⋯⟩)
((fun i ↦ i) ⟨0, ⋯⟩)«4».«1» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨4, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨4, ⋯⟩)
((fun i ↦ i) ⟨1, ⋯⟩)«4».«2» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨4, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨4, ⋯⟩)
((fun i ↦ i) ⟨2, ⋯⟩)«4».«3» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨4, ⋯⟩) ((fun i ↦ i) ⟨3, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨4, ⋯⟩)
((fun i ↦ i) ⟨3, ⋯⟩)«4».«4» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨4, ⋯⟩) ((fun i ↦ i) ⟨4, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨4, ⋯⟩)
((fun i ↦ i) ⟨4, ⋯⟩) h:Nat.nth Nat.Prime (5 - 1) = 11hM:legendreMatrix 11 = !![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1]⊢ a 5 = 0 <;> «0».«0» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨0, ⋯⟩)
((fun i ↦ i) ⟨0, ⋯⟩)«0».«1» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨0, ⋯⟩)
((fun i ↦ i) ⟨1, ⋯⟩)«0».«2» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨0, ⋯⟩)
((fun i ↦ i) ⟨2, ⋯⟩)«0».«3» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨3, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨0, ⋯⟩)
((fun i ↦ i) ⟨3, ⋯⟩)«0».«4» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨4, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨0, ⋯⟩)
((fun i ↦ i) ⟨4, ⋯⟩)«1».«0» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨1, ⋯⟩)
((fun i ↦ i) ⟨0, ⋯⟩)«1».«1» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨1, ⋯⟩)
((fun i ↦ i) ⟨1, ⋯⟩)«1».«2» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨1, ⋯⟩)
((fun i ↦ i) ⟨2, ⋯⟩)«1».«3» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨3, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨1, ⋯⟩)
((fun i ↦ i) ⟨3, ⋯⟩)«1».«4» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨4, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨1, ⋯⟩)
((fun i ↦ i) ⟨4, ⋯⟩)«2».«0» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨2, ⋯⟩)
((fun i ↦ i) ⟨0, ⋯⟩)«2».«1» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨2, ⋯⟩)
((fun i ↦ i) ⟨1, ⋯⟩)«2».«2» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨2, ⋯⟩)
((fun i ↦ i) ⟨2, ⋯⟩)«2».«3» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨3, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨2, ⋯⟩)
((fun i ↦ i) ⟨3, ⋯⟩)«2».«4» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨4, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨2, ⋯⟩)
((fun i ↦ i) ⟨4, ⋯⟩)«3».«0» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨3, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨3, ⋯⟩)
((fun i ↦ i) ⟨0, ⋯⟩)«3».«1» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨3, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨3, ⋯⟩)
((fun i ↦ i) ⟨1, ⋯⟩)«3».«2» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨3, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨3, ⋯⟩)
((fun i ↦ i) ⟨2, ⋯⟩)«3».«3» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨3, ⋯⟩) ((fun i ↦ i) ⟨3, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨3, ⋯⟩)
((fun i ↦ i) ⟨3, ⋯⟩)«3».«4» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨3, ⋯⟩) ((fun i ↦ i) ⟨4, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨3, ⋯⟩)
((fun i ↦ i) ⟨4, ⋯⟩)«4».«0» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨4, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨4, ⋯⟩)
((fun i ↦ i) ⟨0, ⋯⟩)«4».«1» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨4, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨4, ⋯⟩)
((fun i ↦ i) ⟨1, ⋯⟩)«4».«2» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨4, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨4, ⋯⟩)
((fun i ↦ i) ⟨2, ⋯⟩)«4».«3» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨4, ⋯⟩) ((fun i ↦ i) ⟨3, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨4, ⋯⟩)
((fun i ↦ i) ⟨3, ⋯⟩)«4».«4» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ legendreMatrix 11 ((fun i ↦ i) ⟨4, ⋯⟩) ((fun i ↦ i) ⟨4, ⋯⟩) =
!![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1] ((fun i ↦ i) ⟨4, ⋯⟩)
((fun i ↦ i) ⟨4, ⋯⟩) h:Nat.nth Nat.Prime (5 - 1) = 11hM:legendreMatrix 11 = !![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1]⊢ a 5 = 0 simp [legendreMatrix] «4».«4» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (25 - ↑(Nat.factorial 5) * 5) 11 = -1 h:Nat.nth Nat.Prime (5 - 1) = 11hM:legendreMatrix 11 = !![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1]⊢ a 5 = 0 <;> «0».«0» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (1 - ↑(Nat.factorial 5)) 11 = -1«0».«1» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (1 - ↑(Nat.factorial 5) * 2) 11 = 1«0».«2» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (1 - ↑(Nat.factorial 5) * 3) 11 = 1«0».«3» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (1 - ↑(Nat.factorial 5) * 4) 11 = 1«0».«4» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (1 - ↑(Nat.factorial 5) * 5) 11 = -1«1».«0» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (4 - ↑(Nat.factorial 5)) 11 = 1«1».«1» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (4 - ↑(Nat.factorial 5) * 2) 11 = -1«1».«2» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (4 - ↑(Nat.factorial 5) * 3) 11 = -1«1».«3» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (4 - ↑(Nat.factorial 5) * 4) 11 = -1«1».«4» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (4 - ↑(Nat.factorial 5) * 5) 11 = 1«2».«0» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (9 - ↑(Nat.factorial 5)) 11 = -1«2».«1» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (9 - ↑(Nat.factorial 5) * 2) 11 = 0«2».«2» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (9 - ↑(Nat.factorial 5) * 3) 11 = 1«2».«3» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (9 - ↑(Nat.factorial 5) * 4) 11 = -1«2».«4» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (9 - ↑(Nat.factorial 5) * 5) 11 = 1«3».«0» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (16 - ↑(Nat.factorial 5)) 11 = -1«3».«1» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (16 - ↑(Nat.factorial 5) * 2) 11 = -1«3».«2» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (16 - ↑(Nat.factorial 5) * 3) 11 = -1«3».«3» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (16 - ↑(Nat.factorial 5) * 4) 11 = 1«3».«4» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (16 - ↑(Nat.factorial 5) * 5) 11 = -1«4».«0» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (25 - ↑(Nat.factorial 5)) 11 = 1«4».«1» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (25 - ↑(Nat.factorial 5) * 2) 11 = 1«4».«2» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (25 - ↑(Nat.factorial 5) * 3) 11 = -1«4».«3» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (25 - ↑(Nat.factorial 5) * 4) 11 = -1«4».«4» h:Nat.nth Nat.Prime (5 - 1) = 11⊢ jacobiSym (25 - ↑(Nat.factorial 5) * 5) 11 = -1 h:Nat.nth Nat.Prime (5 - 1) = 11hM:legendreMatrix 11 = !![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1]⊢ a 5 = 0 norm_num h:Nat.nth Nat.Prime (5 - 1) = 11hM:legendreMatrix 11 = !![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1]⊢ a 5 = 0 h:Nat.nth Nat.Prime (5 - 1) = 11hM:legendreMatrix 11 = !![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1]⊢ a 5 = 0
rw [a, h:Nat.nth Nat.Prime (5 - 1) = 11hM:legendreMatrix 11 = !![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1]⊢ (legendreMatrix (Nat.nth Nat.Prime (5 - 1))).det = 0 h:Nat.nth Nat.Prime (5 - 1) = 11hM:legendreMatrix 11 = !![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1]⊢ !![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1].det = 0 h, h:Nat.nth Nat.Prime (5 - 1) = 11hM:legendreMatrix 11 = !![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1]⊢ (legendreMatrix 11).det = 0 h:Nat.nth Nat.Prime (5 - 1) = 11hM:legendreMatrix 11 = !![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1]⊢ !![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1].det = 0 hM h:Nat.nth Nat.Prime (5 - 1) = 11hM:legendreMatrix 11 = !![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1]⊢ !![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1].det = 0 h:Nat.nth Nat.Prime (5 - 1) = 11hM:legendreMatrix 11 = !![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1]⊢ !![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1].det = 0] h:Nat.nth Nat.Prime (5 - 1) = 11hM:legendreMatrix 11 = !![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1]⊢ !![-1, 1, 1, 1, -1; 1, -1, -1, -1, 1; -1, 0, 1, -1, 1; -1, -1, -1, 1, -1; 1, 1, -1, -1, -1].det = 0
eval_det All goals completed! 🐙
@[category test, AMS 11]
theorem a_6 : a 6 = -8 := by ⊢ a 6 = -8
have h : Nat.nth Nat.Prime (6 - 1) = 13 := Nat.nth_prime_five_eq_thirteen h:Nat.nth Nat.Prime (6 - 1) = 13⊢ a 6 = -8
have hM : legendreMatrix 13 =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1] := by
ext i j h:Nat.nth Nat.Prime (6 - 1) = 13i:Fin ((13 - 1) / 2)j:Fin ((13 - 1) / 2)⊢ legendreMatrix 13 i j =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
i j h:Nat.nth Nat.Prime (6 - 1) = 13hM:legendreMatrix 13 =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]⊢ a 6 = -8
fin_cases i «0» h:Nat.nth Nat.Prime (6 - 1) = 13j:Fin ((13 - 1) / 2)⊢ legendreMatrix 13 ((fun i ↦ i) ⟨0, ⋯⟩) j =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨0, ⋯⟩) j«1» h:Nat.nth Nat.Prime (6 - 1) = 13j:Fin ((13 - 1) / 2)⊢ legendreMatrix 13 ((fun i ↦ i) ⟨1, ⋯⟩) j =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨1, ⋯⟩) j«2» h:Nat.nth Nat.Prime (6 - 1) = 13j:Fin ((13 - 1) / 2)⊢ legendreMatrix 13 ((fun i ↦ i) ⟨2, ⋯⟩) j =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨2, ⋯⟩) j«3» h:Nat.nth Nat.Prime (6 - 1) = 13j:Fin ((13 - 1) / 2)⊢ legendreMatrix 13 ((fun i ↦ i) ⟨3, ⋯⟩) j =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨3, ⋯⟩) j«4» h:Nat.nth Nat.Prime (6 - 1) = 13j:Fin ((13 - 1) / 2)⊢ legendreMatrix 13 ((fun i ↦ i) ⟨4, ⋯⟩) j =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨4, ⋯⟩) j«5» h:Nat.nth Nat.Prime (6 - 1) = 13j:Fin ((13 - 1) / 2)⊢ legendreMatrix 13 ((fun i ↦ i) ⟨5, ⋯⟩) j =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨5, ⋯⟩) j h:Nat.nth Nat.Prime (6 - 1) = 13hM:legendreMatrix 13 =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]⊢ a 6 = -8 <;> «0» h:Nat.nth Nat.Prime (6 - 1) = 13j:Fin ((13 - 1) / 2)⊢ legendreMatrix 13 ((fun i ↦ i) ⟨0, ⋯⟩) j =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨0, ⋯⟩) j«1» h:Nat.nth Nat.Prime (6 - 1) = 13j:Fin ((13 - 1) / 2)⊢ legendreMatrix 13 ((fun i ↦ i) ⟨1, ⋯⟩) j =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨1, ⋯⟩) j«2» h:Nat.nth Nat.Prime (6 - 1) = 13j:Fin ((13 - 1) / 2)⊢ legendreMatrix 13 ((fun i ↦ i) ⟨2, ⋯⟩) j =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨2, ⋯⟩) j«3» h:Nat.nth Nat.Prime (6 - 1) = 13j:Fin ((13 - 1) / 2)⊢ legendreMatrix 13 ((fun i ↦ i) ⟨3, ⋯⟩) j =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨3, ⋯⟩) j«4» h:Nat.nth Nat.Prime (6 - 1) = 13j:Fin ((13 - 1) / 2)⊢ legendreMatrix 13 ((fun i ↦ i) ⟨4, ⋯⟩) j =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨4, ⋯⟩) j«5» h:Nat.nth Nat.Prime (6 - 1) = 13j:Fin ((13 - 1) / 2)⊢ legendreMatrix 13 ((fun i ↦ i) ⟨5, ⋯⟩) j =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨5, ⋯⟩) j h:Nat.nth Nat.Prime (6 - 1) = 13hM:legendreMatrix 13 =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]⊢ a 6 = -8 fin_cases j «5».«0» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩)«5».«1» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩)«5».«2» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩)«5».«3» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨3, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨3, ⋯⟩)«5».«4» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨4, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨4, ⋯⟩)«5».«5» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨5, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨5, ⋯⟩) h:Nat.nth Nat.Prime (6 - 1) = 13hM:legendreMatrix 13 =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]⊢ a 6 = -8 <;> «0».«0» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩)«0».«1» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩)«0».«2» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩)«0».«3» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨3, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨3, ⋯⟩)«0».«4» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨4, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨4, ⋯⟩)«0».«5» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨5, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨0, ⋯⟩) ((fun i ↦ i) ⟨5, ⋯⟩)«1».«0» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩)«1».«1» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩)«1».«2» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩)«1».«3» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨3, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨3, ⋯⟩)«1».«4» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨4, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨4, ⋯⟩)«1».«5» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨5, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨1, ⋯⟩) ((fun i ↦ i) ⟨5, ⋯⟩)«2».«0» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩)«2».«1» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩)«2».«2» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩)«2».«3» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨3, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨3, ⋯⟩)«2».«4» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨4, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨4, ⋯⟩)«2».«5» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨5, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨2, ⋯⟩) ((fun i ↦ i) ⟨5, ⋯⟩)«3».«0» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨3, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨3, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩)«3».«1» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨3, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨3, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩)«3».«2» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨3, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨3, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩)«3».«3» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨3, ⋯⟩) ((fun i ↦ i) ⟨3, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨3, ⋯⟩) ((fun i ↦ i) ⟨3, ⋯⟩)«3».«4» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨3, ⋯⟩) ((fun i ↦ i) ⟨4, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨3, ⋯⟩) ((fun i ↦ i) ⟨4, ⋯⟩)«3».«5» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨3, ⋯⟩) ((fun i ↦ i) ⟨5, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨3, ⋯⟩) ((fun i ↦ i) ⟨5, ⋯⟩)«4».«0» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨4, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨4, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩)«4».«1» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨4, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨4, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩)«4».«2» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨4, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨4, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩)«4».«3» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨4, ⋯⟩) ((fun i ↦ i) ⟨3, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨4, ⋯⟩) ((fun i ↦ i) ⟨3, ⋯⟩)«4».«4» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨4, ⋯⟩) ((fun i ↦ i) ⟨4, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨4, ⋯⟩) ((fun i ↦ i) ⟨4, ⋯⟩)«4».«5» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨4, ⋯⟩) ((fun i ↦ i) ⟨5, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨4, ⋯⟩) ((fun i ↦ i) ⟨5, ⋯⟩)«5».«0» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨0, ⋯⟩)«5».«1» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨1, ⋯⟩)«5».«2» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨2, ⋯⟩)«5».«3» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨3, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨3, ⋯⟩)«5».«4» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨4, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨4, ⋯⟩)«5».«5» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ legendreMatrix 13 ((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨5, ⋯⟩) =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]
((fun i ↦ i) ⟨5, ⋯⟩) ((fun i ↦ i) ⟨5, ⋯⟩) h:Nat.nth Nat.Prime (6 - 1) = 13hM:legendreMatrix 13 =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]⊢ a 6 = -8 simp [legendreMatrix] «5».«5» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (36 - ↑(Nat.factorial 6) * 6) 13 = -1 h:Nat.nth Nat.Prime (6 - 1) = 13hM:legendreMatrix 13 =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]⊢ a 6 = -8 <;> «0».«0» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (1 - ↑(Nat.factorial 6)) 13 = 1«0».«1» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (1 - ↑(Nat.factorial 6) * 2) 13 = 1«0».«2» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (1 - ↑(Nat.factorial 6) * 3) 13 = 1«0».«3» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (1 - ↑(Nat.factorial 6) * 4) 13 = -1«0».«4» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (1 - ↑(Nat.factorial 6) * 5) 13 = -1«0».«5» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (1 - ↑(Nat.factorial 6) * 6) 13 = 1«1».«0» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (4 - ↑(Nat.factorial 6)) 13 = 1«1».«1» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (4 - ↑(Nat.factorial 6) * 2) 13 = -1«1».«2» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (4 - ↑(Nat.factorial 6) * 3) 13 = -1«1».«3» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (4 - ↑(Nat.factorial 6) * 4) 13 = 1«1».«4» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (4 - ↑(Nat.factorial 6) * 5) 13 = -1«1».«5» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (4 - ↑(Nat.factorial 6) * 6) 13 = 0«2».«0» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (9 - ↑(Nat.factorial 6)) 13 = 1«2».«1» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (9 - ↑(Nat.factorial 6) * 2) 13 = 1«2».«2» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (9 - ↑(Nat.factorial 6) * 3) 13 = -1«2».«3» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (9 - ↑(Nat.factorial 6) * 4) 13 = -1«2».«4» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (9 - ↑(Nat.factorial 6) * 5) 13 = 1«2».«5» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (9 - ↑(Nat.factorial 6) * 6) 13 = -1«3».«0» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (16 - ↑(Nat.factorial 6)) 13 = -1«3».«1» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (16 - ↑(Nat.factorial 6) * 2) 13 = -1«3».«2» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (16 - ↑(Nat.factorial 6) * 3) 13 = 1«3».«3» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (16 - ↑(Nat.factorial 6) * 4) 13 = 1«3».«4» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (16 - ↑(Nat.factorial 6) * 5) 13 = 1«3».«5» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (16 - ↑(Nat.factorial 6) * 6) 13 = 1«4».«0» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (25 - ↑(Nat.factorial 6)) 13 = -1«4».«1» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (25 - ↑(Nat.factorial 6) * 2) 13 = -1«4».«2» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (25 - ↑(Nat.factorial 6) * 3) 13 = 1«4».«3» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (25 - ↑(Nat.factorial 6) * 4) 13 = -1«4».«4» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (25 - ↑(Nat.factorial 6) * 5) 13 = 0«4».«5» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (25 - ↑(Nat.factorial 6) * 6) 13 = -1«5».«0» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (36 - ↑(Nat.factorial 6)) 13 = -1«5».«1» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (36 - ↑(Nat.factorial 6) * 2) 13 = 0«5».«2» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (36 - ↑(Nat.factorial 6) * 3) 13 = -1«5».«3» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (36 - ↑(Nat.factorial 6) * 4) 13 = 1«5».«4» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (36 - ↑(Nat.factorial 6) * 5) 13 = -1«5».«5» h:Nat.nth Nat.Prime (6 - 1) = 13⊢ jacobiSym (36 - ↑(Nat.factorial 6) * 6) 13 = -1 h:Nat.nth Nat.Prime (6 - 1) = 13hM:legendreMatrix 13 =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]⊢ a 6 = -8 norm_num h:Nat.nth Nat.Prime (6 - 1) = 13hM:legendreMatrix 13 =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]⊢ a 6 = -8 h:Nat.nth Nat.Prime (6 - 1) = 13hM:legendreMatrix 13 =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]⊢ a 6 = -8
rw [a, h:Nat.nth Nat.Prime (6 - 1) = 13hM:legendreMatrix 13 =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]⊢ (legendreMatrix (Nat.nth Nat.Prime (6 - 1))).det = -8 h:Nat.nth Nat.Prime (6 - 1) = 13hM:legendreMatrix 13 =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]⊢ !![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1].det =
-8 h, h:Nat.nth Nat.Prime (6 - 1) = 13hM:legendreMatrix 13 =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]⊢ (legendreMatrix 13).det = -8 h:Nat.nth Nat.Prime (6 - 1) = 13hM:legendreMatrix 13 =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]⊢ !![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1].det =
-8 hM h:Nat.nth Nat.Prime (6 - 1) = 13hM:legendreMatrix 13 =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]⊢ !![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1].det =
-8 h:Nat.nth Nat.Prime (6 - 1) = 13hM:legendreMatrix 13 =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]⊢ !![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1].det =
-8] h:Nat.nth Nat.Prime (6 - 1) = 13hM:legendreMatrix 13 =
!![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1]⊢ !![1, 1, 1, -1, -1, 1;
1, -1, -1, 1, -1, 0;
1, 1, -1, -1, 1, -1;
-1, -1, 1, 1, 1, 1;
-1, -1, 1, -1, 0, -1;
-1, 0, -1, 1, -1, -1].det =
-8
eval_det All goals completed! 🐙Conjecture: $a(n) = 0$ if and only if $p_n \equiv 3 \pmod 4$.
Zhi-Wei Sun, Aug 13 2013
Proved in the OEIS Open project, see T. Adamczewski, OEIS Open: How many conjectures can language models turn into theorems?, arXiv:2608.11941.
@[category research solved, AMS 11]
theorem conjecture (n : ℕ) (hn : 2 ≤ n) :
a n = 0 ↔ Nat.nth Nat.Prime (n - 1) % 4 = 3 := by n:ℕhn:2 ≤ n⊢ a n = 0 ↔ Nat.nth Nat.Prime (n - 1) % 4 = 3
sorry All goals completed! 🐙end OeisA226163