Engel expansions
DefinitionNegated remainder#✓fully proved
For natural numbers \(n\) and \(k\) with \(k \ge 1\), the negated remainder of \(n\) modulo \(k\) is the unique \(u\) with \(0 \le u < k\) and \(u \equiv -n \pmod{k}\): it equals \(0\) when \(k\) divides \(n\) and \(k - (n \bmod k)\) otherwise. For \(k = 0\) it is defined to be \(0\).
def negRem (n k : ℕ) : ℕ :=
(k - n % k) % k
Used by 7
TheoremCharacterization of the negated remainder#✓fully proved
For natural numbers \(n\), \(k\) and \(u\) with \(k \ne 0\), the negated remainder of \(n\) modulo \(k\) equals \(u\) if and only if \(u < k\) and \(k\) divides \(n + u\).
This is the natural-number form of \(u \equiv -n \pmod{k}\).
theorem negRem_eq_iff {n k u : ℕ} (hk : k ≠ 0) :
negRem n k = u ↔ u < k ∧ k ∣ n + u
def negRem (n k : ℕ) : ℕ :=
(k - n % k) % k
MathlibExt/NumberTheory/EngelExpansion.lean:31
Uses 1
DefinitionEngel remainder trajectory#✓fully proved
For natural numbers \(n\) and \(a\), the Engel remainder trajectory of \(a\) with respect to \(n\) is the sequence \(t_0, t_1, t_2, \dots\) of natural numbers with \(t_0 = a\) and, for every \(j \ge 0\), \(t_{j+1} = 0\) if \(t_j = 0\), while if \(t_j \ne 0\) then \(t_{j+1}\) is the negated remainder of \(n\) modulo \(t_j\): the unique natural number \(u < t_j\) with \(u \equiv -n \pmod{t_j}\). Once the trajectory reaches \(0\) it stays there.
def traj (n a : ℕ) : ℕ → ℕ
| 0 => a
| j + 1 => if traj n a j = 0 then 0 else negRem n (traj n a j)
def negRem (n k : ℕ) : ℕ :=
(k - n % k) % k
MathlibExt/NumberTheory/EngelExpansion.lean:31
Uses 1 · Used by 11
TheoremInitial term of the Engel trajectory#✓fully proved
For all natural numbers \(n\) and \(a\), the Engel remainder trajectory of \(a\) with respect to \(n\) has value \(a\) at step \(0\).
theorem traj_zero (n a : ℕ) : traj n a 0 = a
def traj (n a : ℕ) : ℕ → ℕ
| 0 => a
| j + 1 => if traj n a j = 0 then 0 else negRem n (traj n a j)
MathlibExt/NumberTheory/EngelExpansion.lean:86
Uses 1 · Used by 1
TheoremZero is absorbing for the Engel trajectory#✓fully proved
Let \(n\), \(a\) and \(j\) be natural numbers and let \(t_0, t_1, \dots\) be the Engel remainder trajectory of \(a\) with respect to \(n\). If \(t_j = 0\), then \(t_{j+1} = 0\).
theorem traj_succ_of_eq_zero {n a j : ℕ} (h : traj n a j = 0) :
traj n a (j + 1) = 0
def traj (n a : ℕ) : ℕ → ℕ
| 0 => a
| j + 1 => if traj n a j = 0 then 0 else negRem n (traj n a j)
MathlibExt/NumberTheory/EngelExpansion.lean:86
Uses 2
TheoremStep of the Engel trajectory at a nonzero term#✓fully proved
Let \(n\), \(a\) and \(j\) be natural numbers and let \(t_0, t_1, \dots\) be the Engel remainder trajectory of \(a\) with respect to \(n\). If \(t_j \ne 0\), then \(t_{j+1}\) is the negated remainder of \(n\) modulo \(t_j\): the unique natural number \(u < t_j\) with \(u \equiv -n \pmod{t_j}\).
theorem traj_succ_of_ne_zero {n a j : ℕ} (h : traj n a j ≠ 0) :
traj n a (j + 1) = negRem n (traj n a j)
def traj (n a : ℕ) : ℕ → ℕ
| 0 => a
| j + 1 => if traj n a j = 0 then 0 else negRem n (traj n a j)
MathlibExt/NumberTheory/EngelExpansion.lean:86
def negRem (n k : ℕ) : ℕ :=
(k - n % k) % k
MathlibExt/NumberTheory/EngelExpansion.lean:31
Uses 2 · Used by 1
TheoremFirst step of the Engel trajectory#✓fully proved
Let \(n\) and \(t\) be natural numbers with \(t \ne 0\). Then the Engel remainder trajectory of \(t\) with respect to \(n\) is, at step \(1\), the negated remainder of \(n\) modulo \(t\): the unique natural number \(u < t\) with \(u \equiv -n \pmod{t}\).
theorem traj_one {n t : ℕ} (ht : t ≠ 0) : traj n t 1 = negRem n t
def traj (n a : ℕ) : ℕ → ℕ
| 0 => a
| j + 1 => if traj n a j = 0 then 0 else negRem n (traj n a j)
MathlibExt/NumberTheory/EngelExpansion.lean:86
def negRem (n k : ℕ) : ℕ :=
(k - n % k) % k
MathlibExt/NumberTheory/EngelExpansion.lean:31
Uses 4
TheoremAn Engel trajectory started at \(a\) vanishes within \(a + 1\) steps#✓fully proved
Let \(n\) and \(a\) be natural numbers and let \(t_0 = a, t_1, t_2, \dots\) be the Engel trajectory of \(a\) with respect to \(n\). Then \(t_i = 0\) for some \(i \le a + 1\).
theorem exists_traj_eq_zero (n a : ℕ) : ∃ i ≤ a + 1, traj n a i = 0
def traj (n a : ℕ) : ℕ → ℕ
| 0 => a
| j + 1 => if traj n a j = 0 then 0 else negRem n (traj n a j)
MathlibExt/NumberTheory/EngelExpansion.lean:86
Uses 2 · Used by 1
TheoremEngel trajectories vanish at a positive step#✓fully proved
Let \(n\) and \(a\) be natural numbers and let \(t_0 = a, t_1, t_2, \dots\) be the Engel trajectory of \(a\) with respect to \(n\). Then \(t_j = 0\) for some \(j \ge 1\).
theorem exists_traj_eq_zero_pos (n a : ℕ) : ∃ j ≥ 1, traj n a j = 0
def traj (n a : ℕ) : ℕ → ℕ
| 0 => a
| j + 1 => if traj n a j = 0 then 0 else negRem n (traj n a j)
MathlibExt/NumberTheory/EngelExpansion.lean:86
Uses 3 · Used by 5
DefinitionEngel length#✓fully proved
For natural numbers \(n\) and \(a\), let \(t_0 = a, t_1, t_2, \dots\) be the Engel trajectory of \(a\) with respect to \(n\). The Engel length \(L(n, a)\) is the least \(j \ge 1\) with \(t_j = 0\).
For \(1 \le a \le n\) this is the number of terms of the Engel expansion of \(a / n\).
noncomputable def length (n a : ℕ) : ℕ :=
Nat.find (exists_traj_eq_zero_pos n a)
theorem exists_traj_eq_zero_pos (n a : ℕ) : ∃ j ≥ 1, traj n a j = 0
MathlibExt/NumberTheory/EngelExpansion.lean:142
Uses 2 · Used by 7
TheoremThe Engel length is positive#✓fully proved
For all natural numbers \(n\) and \(a\), the Engel length \(L(n, a)\) of \(a\) with respect to \(n\) satisfies \(L(n, a) \ge 1\).
theorem length_pos (n a : ℕ) : 1 ≤ length n a
noncomputable def length (n a : ℕ) : ℕ :=
Nat.find (exists_traj_eq_zero_pos n a)
MathlibExt/NumberTheory/EngelExpansion.lean:149
Uses 3
TheoremEngel trajectory vanishes at the Engel length#✓fully proved
For all natural numbers \(n\) and \(a\), let \(L\) be the Engel length of \(a\) with respect to \(n\). Then the Engel remainder trajectory of \(a\) with respect to \(n\) is \(0\) at step \(L\).
theorem traj_length_eq_zero (n a : ℕ) : traj n a (length n a) = 0
def traj (n a : ℕ) : ℕ → ℕ
| 0 => a
| j + 1 => if traj n a j = 0 then 0 else negRem n (traj n a j)
MathlibExt/NumberTheory/EngelExpansion.lean:86
noncomputable def length (n a : ℕ) : ℕ :=
Nat.find (exists_traj_eq_zero_pos n a)
MathlibExt/NumberTheory/EngelExpansion.lean:149
Uses 3
TheoremThe Engel length is at most any positive vanishing step#✓fully proved
Let \(n\), \(a\) and \(j\) be natural numbers with \(j \ge 1\), and let \(t_0 = a, t_1, t_2, \dots\) be the Engel trajectory of \(a\) with respect to \(n\). If \(t_j = 0\), then the Engel length \(L(n, a)\) satisfies \(L(n, a) \le j\).
theorem length_le_of_traj_eq_zero {n a j : ℕ} (hj : 1 ≤ j)
(h : traj n a j = 0) : length n a ≤ j
def traj (n a : ℕ) : ℕ → ℕ
| 0 => a
| j + 1 => if traj n a j = 0 then 0 else negRem n (traj n a j)
MathlibExt/NumberTheory/EngelExpansion.lean:86
noncomputable def length (n a : ℕ) : ℕ :=
Nat.find (exists_traj_eq_zero_pos n a)
MathlibExt/NumberTheory/EngelExpansion.lean:149
Uses 3
TheoremEngel trajectory is nonzero at positive steps before the Engel length#✓fully proved
Let \(n\), \(a\) and \(j\) be natural numbers and let \(L\) be the Engel length of \(a\) with respect to \(n\). If \(1 \le j < L\), then the Engel remainder trajectory of \(a\) with respect to \(n\) is nonzero at step \(j\).
theorem traj_ne_zero_of_lt_length {n a j : ℕ} (hj : 1 ≤ j)
(hlt : j < length n a) : traj n a j ≠ 0
noncomputable def length (n a : ℕ) : ℕ :=
Nat.find (exists_traj_eq_zero_pos n a)
MathlibExt/NumberTheory/EngelExpansion.lean:149
def traj (n a : ℕ) : ℕ → ℕ
| 0 => a
| j + 1 => if traj n a j = 0 then 0 else negRem n (traj n a j)
MathlibExt/NumberTheory/EngelExpansion.lean:86
Uses 3
DefinitionMaximal Engel length#✓fully proved
For a natural number \(n\), the maximal Engel length is \(M(n) = \max_{1 \le a \le n} L(n, a)\), where \(L(n, a)\) is the Engel length of \(a\) with respect to \(n\); for \(n = 0\) the maximum is over the empty set and \(M(0) = 0\).
noncomputable def maxLength (n : ℕ) : ℕ :=
(Finset.Icc 1 n).sup (length n)
noncomputable def length (n a : ℕ) : ℕ :=
Nat.find (exists_traj_eq_zero_pos n a)
MathlibExt/NumberTheory/EngelExpansion.lean:149
Uses 1 · Used by 2
TheoremEach Engel length is at most the maximal Engel length#✓fully proved
Let \(n\) and \(a\) be natural numbers with \(1 \le a \le n\). Then the Engel length \(L(n, a)\) of \(a\) with respect to \(n\) is at most the maximal Engel length \(M(n) = \max_{1 \le b \le n} L(n, b)\).
theorem length_le_maxLength {n a : ℕ} (ha : a ∈ Finset.Icc 1 n) :
length n a ≤ maxLength n
noncomputable def length (n a : ℕ) : ℕ :=
Nat.find (exists_traj_eq_zero_pos n a)
MathlibExt/NumberTheory/EngelExpansion.lean:149
noncomputable def maxLength (n : ℕ) : ℕ :=
(Finset.Icc 1 n).sup (length n)
MathlibExt/NumberTheory/EngelExpansion.lean:173
Uses 2
TheoremA uniform bound on Engel lengths bounds the maximal Engel length#✓fully proved
Let \(n\) and \(B\) be natural numbers. If the Engel length \(L(n, a)\) of \(a\) with respect to \(n\) satisfies \(L(n, a) \le B\) for every \(a\) with \(1 \le a \le n\), then the maximal Engel length \(M(n) = \max_{1 \le a \le n} L(n, a)\) (with \(M(0) = 0\)) satisfies \(M(n) \le B\).
theorem maxLength_le_of_forall {n L : ℕ}
(h : ∀ a ∈ Finset.Icc 1 n, length n a ≤ L) : maxLength n ≤ L
noncomputable def length (n a : ℕ) : ℕ :=
Nat.find (exists_traj_eq_zero_pos n a)
MathlibExt/NumberTheory/EngelExpansion.lean:149
noncomputable def maxLength (n : ℕ) : ℕ :=
(Finset.Icc 1 n).sup (length n)
MathlibExt/NumberTheory/EngelExpansion.lean:173
Uses 2
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.