FormalConjectures/OEIS/100475.lean
Explanation legend Lean4 Domain Explanation Language (L4DEL)
L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.
- L4DEL
- Lean4 Domain Explanation Language
Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.
Project sources: Pinned project documentation, Formal Conjectures paper, arXiv v1
13 declarations, 1 contain sorry, 0 declared as axioms
Prime-th recurrence with reversal at each step
$$a(n) = \operatorname{reversal}(p_{a(n-1)})$$ with $a(0)=1$, where $p_k$ is the $k$-th prime number.
References:
Imports (1)
- def
OeisA100475.reverseDigitsReverses the base 10 digits of a natural number line 37 sourceSource documentation
Reverses the base 10 digits of a natural number.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
NatProof uses:
Nat.ofDigits,OfNat.ofNat,List.reverse,Nat.digits2 instances, coercions and auxiliary constants left out.
def reverseDigits (k : ℕ) : ℕ := …
- def
OeisA100475.aThe primary defining sequencealine 44 sourceSource documentation
The primary defining sequence
a. a n is the Prime-th recurrence with reversal at each step. $a(n) = \operatorname{reversal}(p_{a(n-1)})$ with $a(0)=1$, where $p_k$ is the $k$-th prime number (i.e., $p_1=2, p_2=3, \dots$).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat2 instances, coercions and auxiliary constants left out.
noncomputable def a : ℕ → ℕ | 0 => 1 | n + 1 => let k := a n … - lemma
OeisA100475.a_succline 52 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq, OeisA100475.a,HAdd.hAdd,OfNat.ofNat,ite, OeisA100475.reverseDigits,Nat.nth,Nat.Prime,HSub.hSubProof uses:
Eq.refl9 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- theorem
OeisA100475.a_0Term theorems verifying the first few values of the sequence against the official OEIS b-file line 58 sourceSource documentation
Term theorems verifying the first few values of the sequence against the official OEIS b-file
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Eq,Nat, OeisA100475.a,OfNat.ofNatProof uses:
Eq.refl2 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
theorem a_0 : a 0 = 1 := by rfl …
Mentions: OeisA100475.a
- theorem
OeisA100475.a_1line 61 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Eq,Nat, OeisA100475.a,OfNat.ofNatProof uses:
Eq.mpr,ite, OeisA100475.reverseDigits,Nat.nth,Nat.Prime,HSub.hSub,id,congrArg,HAdd.hAdd, OeisA100475.a_succ, OeisA100475.a_0,of_eq_true,Eq.trans,True,congrFun',ite_cond_eq_false,Nat.ofDigits,List.reverse,Nat.digits,List.consand 18 more50 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- theorem
OeisA100475.a_2line 67 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Eq,Nat, OeisA100475.a,OfNat.ofNatProof uses:
Eq.mpr,ite, OeisA100475.reverseDigits,Nat.nth,Nat.Prime,HSub.hSub,id,congrArg,HAdd.hAdd, OeisA100475.a_succ, OeisA100475.a_1,of_eq_true,Eq.trans,True,congrFun',ite_cond_eq_false,Nat.ofDigits,List.reverse,Nat.digits,List.consand 17 more38 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- theorem
OeisA100475.a_3line 73 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Eq,Nat, OeisA100475.a,OfNat.ofNatProof uses:
Eq.mpr,ite, OeisA100475.reverseDigits,Nat.nth,Nat.Prime,HSub.hSub,id,congrArg,HAdd.hAdd, OeisA100475.a_succ, OeisA100475.a_2,of_eq_true,Eq.trans,True,congrFun',ite_cond_eq_false,Nat.ofDigits,List.reverse,Nat.digits,List.consand 17 more38 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- theorem
OeisA100475.a_4line 79 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Eq,Nat, OeisA100475.a,OfNat.ofNatProof uses:
Eq.mpr,ite, OeisA100475.reverseDigits,Nat.nth,Nat.Prime,HSub.hSub,id,congrArg,HAdd.hAdd, OeisA100475.a_succ, OeisA100475.a_3,Nat.ofDigits,List.cons,List.nil,congrFun',Eq.trans,ite_cond_eq_false,List,List.reverse,Nat.digitsand 18 more53 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- def
OeisA100475.aStartAtDefinition of the generalized sequence starting at x line 86 sourceSource documentation
Definition of the generalized sequence starting at x.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat2 instances, coercions and auxiliary constants left out.
noncomputable def aStartAt (x : ℕ) : ℕ → ℕ | 0 => x | n + 1 => let k := aStartAt x n … - def
OeisA100475.IsUltimatelyPeriodicA sequence $f : \mathbb{N} \to \mathbb{N}$ is ultimately periodic if there exist $N, P \in \mathbb{N}$, with $P>0$, such that for all $n \ge N$, $f(n+P) = f(n)$ line 95 sourceSource documentation
A sequence $f : \mathbb{N} \to \mathbb{N}$ is ultimately periodic if there exist $N, P \in \mathbb{N}$, with $P>0$, such that for all $n \ge N$, $f(n+P) = f(n)$.
no axioms what this means
Statement uses:
NatProof uses:
Exists,And,GT.gt,OfNat.ofNat,GE.ge,Eq,HAdd.hAdd5 instances, coercions and auxiliary constants left out.
def IsUltimatelyPeriodic (f : ℕ → ℕ) : Prop := …
- lemma
OeisA100475.aStartAt_zeroThe totalized recurrence stays at zero when initialized at zero line 102 sourceSource documentation
The totalized recurrence stays at zero when initialized at zero. The OEIS recurrence itself uses one-based prime indices, so this is a boundary behavior of the formalization rather than a term of the original sequence.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq, OeisA100475.aStartAt,OfNat.ofNatProof uses:
Nat.recAux,Eq.refl,of_eq_true,HAdd.hAdd,Eq.trans,True,congrFun',congrArg,ite_cond_eq_true, OeisA100475.reverseDigits,Nat.nth,Nat.Prime,HSub.hSub,eq_self7 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
lemma aStartAt_zero (n : ℕ) : aStartAt 0 n = 0 := by …
Mentions: OeisA100475.aStartAt
- theorem
OeisA100475.conjecture_with_zeroIf zero is admitted as a starting value, then a start other than $1$ does go into a loop: the sequence starting at zero is constant line 113 sourceSource documentation
If zero is admitted as a starting value, then a start other than $1$ does go into a loop: the sequence starting at zero is constant. This records the degenerate answer created by totalizing the one-based prime recurrence at index zero.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Iff,True,Exists,Nat,And,Ne,OfNat.ofNat, OeisA100475.IsUltimatelyPeriodic, OeisA100475.aStartAtProof uses:
id,Iff.intro,Exists.intro,And.intro,Eq,GT.gt,GE.ge,HAdd.hAdd,Decidable.byContradiction,Not,Eq.mpr,congrArg, OeisA100475.aStartAt_zero,Eq.refl,True.intro9 instances, coercions and auxiliary constants left out.
Tactic trace: 12 steps
Open to load the checked before-and-after goal states.
theorem conjecture_with_zero : answer(True) ↔ ∃ x : ℕ, x ≠ 1 ∧ IsUltimatelyPeriodic (aStartAt x) := by …Mentions: OeisA100475.IsUltimatelyPeriodic, OeisA100475.aStartAt
- theorem
OeisA100475.conjectureStarting at a positive value other than $a(0) = 1$, does this sequence ever go into a loop? sorry line 131 sourceSource documentation
Starting at a positive value other than $a(0) = 1$, does this sequence ever go into a loop?
The positivity hypothesis is required because the source recurrence uses the one-based prime index
p₁ = 2; thex = 0branch above is only an artifact of makingaStartAttotal onℕ.depends on sorry what this means
Statement uses:
Iff,True,Exists,Nat,And,LT.lt,OfNat.ofNat,Ne, OeisA100475.IsUltimatelyPeriodic, OeisA100475.aStartAtProof uses:
sorryAx,Lean.Name,Bool.false,Lean.Name.num,Lean.Name.str,Lean.Name.anonymous4 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
theorem conjecture : answer(sorry) ↔ ∃ x : ℕ, 0 < x ∧ x ≠ 1 ∧ IsUltimatelyPeriodic (aStartAt x) := by …Mentions: OeisA100475.IsUltimatelyPeriodic, OeisA100475.aStartAt