/-
Copyright 2025 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.
-/
import FormalConjecturesUtilSum of four squares with square conditions
Any integer $n \geq 0$ can be written as $x^2 + y^2 + z^2 + w^2$ with $x, y, z, w$ nonnegative integers and $z \leq w$, such that both $x$ and $x + 24y$ are squares.
Zhi-Wei Sun has offered a $2,400 prize for the first proof.
Z.-W. Sun, "Refining Lagrange's four-square theorem,"
Z.-W. Sun, "Restricted sums of four squares,"
namespace OeisA281976
The predicate that n can be written as $x^2 + y^2 + z^2 + w^2$ with $x, y, z, w$ nonnegative
integers, $z \leq w$, such that both $x$ and $x + 24y$ are squares.
def A (n : ℕ) : Prop :=
∃ x y z w : ℕ, n = x ^ 2 + y ^ 2 + z ^ 2 + w ^ 2 ∧ z ≤ w ∧ IsSquare x ∧ IsSquare (x + 24 * y)
@[category test, AMS 11]
theorem a_0 : A 0 :=
⟨0, 0, 0, 0, ⊢ 0 = 0 ^ 2 + 0 ^ 2 + 0 ^ 2 + 0 ^ 2 ∧ 0 ≤ 0 ∧ IsSquare 0 ∧ IsSquare (0 + 24 * 0) All goals completed! 🐙⟩
@[category test, AMS 11]
theorem a_1 : A 1 :=
⟨1, 0, 0, 0, ⊢ 1 = 1 ^ 2 + 0 ^ 2 + 0 ^ 2 + 0 ^ 2 All goals completed! 🐙, ⊢ 0 ≤ 0 All goals completed! 🐙, ⟨1, ⊢ 1 = 1 * 1 All goals completed! 🐙⟩, ⟨1, ⊢ 1 + 24 * 0 = 1 * 1 All goals completed! 🐙⟩⟩
@[category test, AMS 11]
theorem a_2 : A 2 :=
⟨1, 0, 0, 1, ⊢ 2 = 1 ^ 2 + 0 ^ 2 + 0 ^ 2 + 1 ^ 2 All goals completed! 🐙, ⊢ 0 ≤ 1 All goals completed! 🐙, ⟨1, ⊢ 1 = 1 * 1 All goals completed! 🐙⟩, ⟨1, ⊢ 1 + 24 * 0 = 1 * 1 All goals completed! 🐙⟩⟩
@[category test, AMS 11]
theorem a_3 : A 3 :=
⟨1, 0, 1, 1, ⊢ 3 = 1 ^ 2 + 0 ^ 2 + 1 ^ 2 + 1 ^ 2 All goals completed! 🐙, ⊢ 1 ≤ 1 All goals completed! 🐙, ⟨1, ⊢ 1 = 1 * 1 All goals completed! 🐙⟩, ⟨1, ⊢ 1 + 24 * 0 = 1 * 1 All goals completed! 🐙⟩⟩
@[category test, AMS 11]
theorem a_4 : A 4 :=
⟨0, 0, 0, 2, ⊢ 4 = 0 ^ 2 + 0 ^ 2 + 0 ^ 2 + 2 ^ 2 All goals completed! 🐙, ⊢ 0 ≤ 2 All goals completed! 🐙, ⟨0, ⊢ 0 = 0 * 0 All goals completed! 🐙⟩, ⟨0, ⊢ 0 + 24 * 0 = 0 * 0 All goals completed! 🐙⟩⟩
@[category test, AMS 11]
theorem a_8 : A 8 :=
⟨0, 0, 2, 2, ⊢ 8 = 0 ^ 2 + 0 ^ 2 + 2 ^ 2 + 2 ^ 2 All goals completed! 🐙, ⊢ 2 ≤ 2 All goals completed! 🐙, ⟨0, ⊢ 0 = 0 * 0 All goals completed! 🐙⟩, ⟨0, ⊢ 0 + 24 * 0 = 0 * 0 All goals completed! 🐙⟩⟩
@[category test, AMS 11]
theorem a_12 : A 12 :=
⟨1, 1, 1, 3, ⊢ 12 = 1 ^ 2 + 1 ^ 2 + 1 ^ 2 + 3 ^ 2 All goals completed! 🐙, ⊢ 1 ≤ 3 All goals completed! 🐙, ⟨1, ⊢ 1 = 1 * 1 All goals completed! 🐙⟩, ⟨5, ⊢ 1 + 24 * 1 = 5 * 5 All goals completed! 🐙⟩⟩
@[category test, AMS 11]
theorem a_23 : A 23 :=
⟨1, 2, 3, 3, ⊢ 23 = 1 ^ 2 + 2 ^ 2 + 3 ^ 2 + 3 ^ 2 All goals completed! 🐙, ⊢ 3 ≤ 3 All goals completed! 🐙, ⟨1, ⊢ 1 = 1 * 1 All goals completed! 🐙⟩, ⟨7, ⊢ 1 + 24 * 2 = 7 * 7 All goals completed! 🐙⟩⟩
@[category test, AMS 11]
theorem a_24 : A 24 :=
⟨4, 0, 2, 2, ⊢ 24 = 4 ^ 2 + 0 ^ 2 + 2 ^ 2 + 2 ^ 2 All goals completed! 🐙, ⊢ 2 ≤ 2 All goals completed! 🐙, ⟨2, ⊢ 4 = 2 * 2 All goals completed! 🐙⟩, ⟨2, ⊢ 4 + 24 * 0 = 2 * 2 All goals completed! 🐙⟩⟩
Zhi-Wei Sun's Conjecture (A281976): Any integer $n \geq 0$ can be written as $x^2 + y^2 + z^2 + w^2$ with $x, y, z, w$ nonnegative integers and $z \leq w$, such that both $x$ and $x + 24y$ are squares.
@[category research open, AMS 11]
theorem conjecture (n : ℕ) : A n := n:ℕ⊢ A n
All goals completed! 🐙
end OeisA281976