Fibonacci numbers
import /Freeks/6.book
Another trailhead: Fibonacci numbers. On top of divisibility and primes (Freeks/6), for the sequence \(F_n\) we show that adjacent terms are coprime, \(F_n \mid F_{kn}\), Cassini's identity, and \(\gcd(F_m, F_n) = F_{\gcd(m,n)}\).
1 Definition and basics
Fibonacci numbers (we assume a sequence \(f\) satisfies the following; since we cannot create a new word, we write it with a function variable \(f\)) \(F_0 = 0,\ F_1 = 1,\ F_{n+2} = F_n + F_{n+1}\).
Fib𝕄 …
\(\begin{cases} f ( 0 ) = 0 \\ f ( 1 ) = 1 \\ n \in \mathbb{M} \Longrightarrow f ( n + 2 ) = f ( n ) + f ( n + 1 ) \end{cases}\) Every \(F_n\) is a natural number (induction on two consecutive terms together).
Lfib …
\(n \in \mathbb{M} \Longrightarrow f ( n ) \in \mathbb{M} , f ( n + 1 ) \in \mathbb{M}\) \(\blacktriangleleft\) Fib𝕄 ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ2 Adjacent terms are coprime
The only divisor of 1 is 1.
D1 …
\(d \in \mathbb{M} , d \mid 1 \Longrightarrow d = 1\) \(\blacktriangleleft\) ∣≤ ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,AxℤIf \(d\) divides \(F_{n+1}\) and \(F_{n+2} = F_n + F_{n+1}\), it also divides \(F_n\). Repeating this down to \(F_1 = 1\), we get \(d = 1\).
Lcop …
\(n \in \mathbb{M} \Longrightarrow \forall d \in \mathbb{M} . ( d \mid f ( n ) , d \mid f ( n + 1 ) \Longrightarrow d = 1 )\) \(\blacktriangleleft\) Fib𝕄 ,∣sub ,D1 ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ3 Addition formula
\(F_{m+n+1} = F_{m+1}F_{n+1} + F_m F_n\) (induction on \(m\); we use the assumption with \(n\) shifted to \(n+1\)).
Ladd …
\(m , n \in \mathbb{M} \Longrightarrow f ( ( m + n ) + 1 ) = f ( m + 1 ) \cdot f ( n + 1 ) + f ( m ) \cdot f ( n )\) \(\blacktriangleleft\) Fib𝕄 ,Lfib ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ4 Multiples of the index
\(F_n \mid F_{kn}\) (induction on \(k\); write \(n = n' + 1\), and apply the addition formula with \(m = kn,\ n'\), to get \(F_{(k+1)n} = F_{kn+1}F_n + F_{kn}F_{n'}\)).
LFdiv …
\(n , k \in \mathbb{M} , n \neq 0 \Longrightarrow f ( n ) \mid f ( k \cdot n )\) \(\blacktriangleleft\) Fib𝕄 ,Lfib ,Ladd ,𝕄0-' ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ5 Cassini's identity
\(F_{n+1}^2 - F_n F_{n+2} = \pm 1\). Without using the sign (\((-1)^n\)), we write "either \(F_{n+1}^2 = F_nF_{n+2} + 1\) or \(F_nF_{n+2} = F_{n+1}^2 + 1\)" (they alternate each time \(n\) increases).
Lcas …
\(n \in \mathbb{M} \Longrightarrow f ( n + 1 ) \cdot f ( n + 1 ) = f ( n ) \cdot f ( n + 2 ) + 1 \mathbin{\rm o\!r} f ( n ) \cdot f ( n + 2 ) = f ( n + 1 ) \cdot f ( n + 1 ) + 1\) \(\blacktriangleleft\) Fib𝕄 ,Lfib ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ6 A factor of a product can be dropped if coprime
If the only common divisor of \(d\) and \(X\) is 1 and \(d \mid XY\), then \(d \mid Y\) (from Bézout's \(ds + Xt = 1\), \(Y = d(Ys + ct)\)).
Lgauss …
\(d , X , Y \in \mathbb{M} , \forall e \in \mathbb{M} . ( e \mid d , e \mid X \Longrightarrow e = 1 ) , d \mid X \cdot Y \Longrightarrow d \mid Y\) \(\blacktriangleleft\) Lbez ,⋅0𝕄 ,⋅0X ,∣. ,∣R ,∣sub ,∣+ ,ℙ.' ,⋅𝕄:D ,\(\mathbb{W}.\) ,Axℤ7 One step of the Euclidean algorithm: common divisors do not change
When \(m = nq + r\) (\(r = r' + 1\)), \(F_m = F_{nq+1}F_r + F_{nq}F_{r'}\) (addition formula). Since \(F_n \mid F_{nq}\), the common divisors of \(F_m\) and \(F_n\) are the same as those of \(F_n\) and \(F_r\).
Kstep …
\(n , q , r , d \in \mathbb{M} , n \neq 0 \Longrightarrow ( d \mid f ( n \cdot q + ( r + 1 ) ) , d \mid f ( n ) \Longleftrightarrow d \mid f ( n ) , d \mid f ( r + 1 ) )\) \(\blacktriangleleft\) Fib𝕄 ,Lfib ,Ladd ,LFdiv ,Lcop ,Lgauss ,∣T ,∣M ,∣sub ,∣+ ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ8 One step of the Euclidean algorithm (reformulating the gcd)
That \(g\) is the gcd of \(a, b\) is equivalent, when \(a = bq + r\), to its being the gcd of \(b, r\) (\(g \mid a, b\), and every common divisor divides \(g\)).
Lstep …
\(a , b , q , r , g \in \mathbb{M} , a = b \cdot q + r \Longrightarrow ( g \mid a , g \mid b , \forall d \in \mathbb{M} . ( d \mid a , d \mid b \Longrightarrow d \mid g ) \Longleftrightarrow g \mid b , g \mid r , \forall d \in \mathbb{M} . ( d \mid b , d \mid r \Longrightarrow d \mid g ) )\) \(\blacktriangleleft\) ⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ ,∣M ,∣sub ,∣+Lbase …
\(a \in \mathbb{M} \Longrightarrow a \mid a , a \mid 0 , \forall d \in \mathbb{M} . ( d \mid a , d \mid 0 \Longrightarrow d \mid a )\) \(\blacktriangleleft\) ∣R ,⋅0𝕄 ,⋅0X ,ℙ.' ,⋅𝕄:D ,\(\mathbb{W}.\) ,Axℤ9 gcd(F_m, F_n) = F_gcd(m,n)
Strong induction on \(b\), as in the Euclidean algorithm. For \(a = bq + r\), if \(r = 0\) then \(b\) is the gcd. If \(r \ne 0\), the gcd of \((b, r)\), namely \(g\), is the gcd of \((a, b)\) (one step of the Euclidean algorithm), and \(F_g\) is the gcd of \(F_b, F_r\), so by the step of the previous section it is also the gcd of \(F_a, F_b\).
Lfg …
\(a , b \in \mathbb{M} \Longrightarrow \exists g \in \mathbb{M} . ( g \mid a , g \mid b , \forall d \in \mathbb{M} . ( d \mid a , d \mid b \Longrightarrow d \mid g ) ) , ( f ( g ) \mid f ( a ) , f ( g ) \mid f ( b ) , \forall d \in \mathbb{M} . ( d \mid f ( a ) , d \mid f ( b ) \Longrightarrow d \mid f ( g ) ) )\) \(\blacktriangleleft\) Fib𝕄 ,Lfib ,Kstep ,LFdiv ,Lstep ,Lbase ,ℙ.' ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ