Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions FormalConjectures/ErdosProblems/422.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/-
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 FormalConjectures.Util.ProblemImports

/-!
# Erdős Problem 422

*Reference:* [erdosproblems.com/422](https://www.erdosproblems.com/422)
-/

namespace Erdos422

open Filter
open scoped Topology

instance : Norm ℕ+ where
norm n := n

/--
Let $f(1) = f(2) = 1$ and for $n > 2$
$$
f(n) = f(n - f(n - 1)) + f(n - f(n - 2)).
$$
-/
def f : ℕ+ → ℕ+
| 1 => 1
| 2 => 1
| n => f (n - f (n - 1)) + f (n - f (n - 2))
-- Note: It is not known whether $f(n)$ is well-defined for all $n$.
termination_by n => n
decreasing_by
all_goals sorry

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I think it would be interesting to add two statements:

  1. The question of the surjectivity of f (seems to be open)
  2. The question of whether the sequence f must eventually terminate (presumably not? admittedly I haven't thought too much about whether or not this is hard to prove)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those sound like good ideas. I'll also add in a question of the function's growth rate since that's open as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, I added your suggestions but I had a bit of trouble with the second.

For it, I removed the partial definition for f and defined the function with sorry. I don't think this is what you had in mind when you suggested it so I'd welcome any other ways to define that f must eventually terminate.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps by termination @Paul-Lez meant whether f becomes stationary at some point? I.e., does there exist m and N for which f n = m for all n larger than N. Termination can be quite surprising in this sense, see for example the Goodstein sequence which eventually decreases and terminates at 0.

The other interpretation of termination here is whether one reaches a point at which f n cannot be defined (e.g, if n - f (n - 1) < 0), but I think this sense is already captured in the definition.

/--
Does $f(n)$ miss infinitely many integers?
-/
@[category research open, AMS 11]
theorem erdos_422 : Set.Infinite {n | ∀ x, f x ≠ n} ↔ answer(sorry) := by
sorry

/--
Is $f$ surjective?
-/
@[category research open, AMS 11]
theorem erdos_422.variants.surjective : f.Surjective ↔ answer(sorry) := by
sorry

/--
How does $f$ grow?
-/
@[category research open, AMS 11]
theorem erdos_422.variants.growth_rate : f =O[atTop] (answer(sorry) : ℕ+ → ℕ+) := by
sorry

end Erdos422