Documentation

IMOSLLean4.Main.IMO2009.N5

IMO 2009 N5 #

Let $S$ be a set and $T : S → S$ be a function. Prove that there does not exist a non-constant polynomial $P ∈ ℤ[X]$ such that for every positive integer $n$, $$ \#\{x ∈ ℤ : T^n(x) = x\} = P(n). $$

Solution #

We follow a variant of Solution 2 of the official solution. Namely, $p$ does not have to be prime; we have $P(0) ≡ P(n) \pmod{q}$ for any $n > 0$.

Extra lemma #

theorem IMOSL.IMO2009N5.periodicOrbit_eq_iff_mem_periodicOrbit {α✝ : Type u_1} {T : α✝α✝} {a₀ a : α✝} (ha₀ : a₀ Function.periodicPts T) :

If a₀ is T-periodic, then a has the same T-orbit as a₀ if and only if a is in the T-orbit of a₀.

Start of the problem #

structure IMOSL.IMO2009N5.NiceFun (α : Type u_1) :
Type u_1

We say that a function T : α → α is nice if T^n has finitely many fixed points for every positive integer n.

Instances For
    theorem IMOSL.IMO2009N5.NiceFun.nth_fixed_pts_spec {α : Type u_1} (T : NiceFun α) {n : } {a : α} (hn : n > 0) :

    nth_fixed_pts n consists of points a such that T^n(a) = a.

    noncomputable def IMOSL.IMO2009N5.NiceFun.period_n_pts {α : Type u_1} (T : NiceFun α) (n : ) :

    The finite set of points of T-period exactly n.

    Equations
    Instances For
      theorem IMOSL.IMO2009N5.NiceFun.period_n_pts_spec {α : Type u_1} (T : NiceFun α) {n : } {a : α} (hn : n > 0) :

      The finite set period_n_pts is indeed the set of T-period n points if n > 0.

      theorem IMOSL.IMO2009N5.NiceFun.period_n_pts_spec2 {α : Type u_1} (T : NiceFun α) {n : } {a : α} :

      An alternate version of period_n_pts_spec that, in addition, says that there are no "T-period 0 points".

      Any member of period_n_pts is a member of periodicPts T.

      theorem IMOSL.IMO2009N5.NiceFun.pos_of_mem_period_n_pts {α : Type u_1} (T : NiceFun α) {n : } {a : α} (ha : a T.period_n_pts n) :
      n > 0

      If T.period_n_pts n has an element, then n > 0.

      theorem IMOSL.IMO2009N5.NiceFun.iterate_apply_mem_period_n_pts {α : Type u_1} (T : NiceFun α) {n : } {a : α} (ha : a T.period_n_pts n) (k : ) :
      (⇑T)^[k] a T.period_n_pts n

      If a has T-period n, then T^k(a) has T-period n.

      Summation formula for the number of fixed points #

      T^n(a) = a if and only if a has T-period dividing n. Note: Due to the formulation of nth_fixed_pts and Nat.divisors, the implemented formulation works even if n = 0.

      The sets of points with T-period n are pairwise disjoint across all n.

      The set of nth fixed points is the union, over all d ∣ n, of the set of elements of T-period d.

      Summation formula for the number of points a such that T^n(a) = a. Note: This is one of the key observations used in the solution.

      The number of points of period n is divisible by n. #

      The "periodic orbit" of the points of T-period n has size n.

      The size of period_n_pts is n times the number of corresponding orbits.

      The set of points with T-period n has size divisible by n. Note: This is one of the key observations used in the solution.

      For any n and for any prime q, the number of fixed points of T^n and T^{nq} are congruent modulo q.

      theorem IMOSL.IMO2009N5.final_solution {α : Type u_1} [DecidableEq α] {T : NiceFun α} (h : ∃ (P : Polynomial ), n > 0, (T.nth_fixed_pts n).card = Polynomial.eval (↑n) P) :
      ∃ (N : ), n > 0, (T.nth_fixed_pts n).card = N

      Final solution