data.real.golden_ratioMathlib.Data.Real.GoldenRatio

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -4,8 +4,8 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anatole Dedecker, Alexey Soloyev, Junyan Xu
 -/
 import Data.Real.Irrational
-import Data.Nat.Fib
-import Data.Nat.PrimeNormNum
+import Data.Nat.Fib.Basic
+import Tactic.NormNum.Prime
 import Data.Fin.VecNotation
 import Tactic.RingExp
 import Algebra.LinearRecurrence
Diff
@@ -3,12 +3,12 @@ Copyright (c) 2020 Anatole Dedecker. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anatole Dedecker, Alexey Soloyev, Junyan Xu
 -/
-import Mathbin.Data.Real.Irrational
-import Mathbin.Data.Nat.Fib
-import Mathbin.Data.Nat.PrimeNormNum
-import Mathbin.Data.Fin.VecNotation
-import Mathbin.Tactic.RingExp
-import Mathbin.Algebra.LinearRecurrence
+import Data.Real.Irrational
+import Data.Nat.Fib
+import Data.Nat.PrimeNormNum
+import Data.Fin.VecNotation
+import Tactic.RingExp
+import Algebra.LinearRecurrence
 
 #align_import data.real.golden_ratio from "leanprover-community/mathlib"@"61b5e2755ccb464b68d05a9acf891ae04992d09d"
 
Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2020 Anatole Dedecker. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anatole Dedecker, Alexey Soloyev, Junyan Xu
-
-! This file was ported from Lean 3 source module data.real.golden_ratio
-! leanprover-community/mathlib commit 61b5e2755ccb464b68d05a9acf891ae04992d09d
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.Real.Irrational
 import Mathbin.Data.Nat.Fib
@@ -15,6 +10,8 @@ import Mathbin.Data.Fin.VecNotation
 import Mathbin.Tactic.RingExp
 import Mathbin.Algebra.LinearRecurrence
 
+#align_import data.real.golden_ratio from "leanprover-community/mathlib"@"61b5e2755ccb464b68d05a9acf891ae04992d09d"
+
 /-!
 # The golden ratio and its conjugate
 
Diff
@@ -50,12 +50,11 @@ def goldenConj :=
 #align golden_conj goldenConj
 -/
 
--- mathport name: golden_ratio
 scoped[Real] notation "φ" => goldenRatio
 
--- mathport name: golden_conj
 scoped[Real] notation "ψ" => goldenConj
 
+#print inv_gold /-
 /-- The inverse of the golden ratio is the opposite of its conjugate. -/
 theorem inv_gold : φ⁻¹ = -ψ :=
   by
@@ -63,36 +62,52 @@ theorem inv_gold : φ⁻¹ = -ψ :=
   field_simp [sub_mul, mul_add]
   norm_num
 #align inv_gold inv_gold
+-/
 
+#print inv_goldConj /-
 /-- The opposite of the golden ratio is the inverse of its conjugate. -/
 theorem inv_goldConj : ψ⁻¹ = -φ :=
   by
   rw [inv_eq_iff_eq_inv, ← neg_inv, ← neg_eq_iff_eq_neg]
   exact inv_gold.symm
 #align inv_gold_conj inv_goldConj
+-/
 
+#print gold_mul_goldConj /-
 @[simp]
 theorem gold_mul_goldConj : φ * ψ = -1 := by field_simp; rw [← sq_sub_sq]; norm_num
 #align gold_mul_gold_conj gold_mul_goldConj
+-/
 
+#print goldConj_mul_gold /-
 @[simp]
 theorem goldConj_mul_gold : ψ * φ = -1 := by rw [mul_comm]; exact gold_mul_goldConj
 #align gold_conj_mul_gold goldConj_mul_gold
+-/
 
+#print gold_add_goldConj /-
 @[simp]
 theorem gold_add_goldConj : φ + ψ = 1 := by rw [goldenRatio, goldenConj]; ring
 #align gold_add_gold_conj gold_add_goldConj
+-/
 
+#print one_sub_goldConj /-
 theorem one_sub_goldConj : 1 - φ = ψ := by linarith [gold_add_goldConj]
 #align one_sub_gold_conj one_sub_goldConj
+-/
 
+#print one_sub_gold /-
 theorem one_sub_gold : 1 - ψ = φ := by linarith [gold_add_goldConj]
 #align one_sub_gold one_sub_gold
+-/
 
+#print gold_sub_goldConj /-
 @[simp]
 theorem gold_sub_goldConj : φ - ψ = Real.sqrt 5 := by rw [goldenRatio, goldenConj]; ring
 #align gold_sub_gold_conj gold_sub_goldConj
+-/
 
+#print gold_sq /-
 @[simp]
 theorem gold_sq : φ ^ 2 = φ + 1 :=
   by
@@ -100,7 +115,9 @@ theorem gold_sq : φ ^ 2 = φ + 1 :=
   ring
   rw [Real.sq_sqrt] <;> norm_num
 #align gold_sq gold_sq
+-/
 
+#print goldConj_sq /-
 @[simp]
 theorem goldConj_sq : ψ ^ 2 = ψ + 1 :=
   by
@@ -108,33 +125,46 @@ theorem goldConj_sq : ψ ^ 2 = ψ + 1 :=
   ring
   rw [Real.sq_sqrt] <;> norm_num
 #align gold_conj_sq goldConj_sq
+-/
 
+#print gold_pos /-
 theorem gold_pos : 0 < φ :=
   mul_pos (by apply add_pos <;> norm_num) <| inv_pos.2 zero_lt_two
 #align gold_pos gold_pos
+-/
 
+#print gold_ne_zero /-
 theorem gold_ne_zero : φ ≠ 0 :=
   ne_of_gt gold_pos
 #align gold_ne_zero gold_ne_zero
+-/
 
+#print one_lt_gold /-
 theorem one_lt_gold : 1 < φ :=
   by
   refine' lt_of_mul_lt_mul_left _ (le_of_lt gold_pos)
   simp [← sq, gold_pos, zero_lt_one]
 #align one_lt_gold one_lt_gold
+-/
 
+#print goldConj_neg /-
 theorem goldConj_neg : ψ < 0 := by linarith [one_sub_goldConj, one_lt_gold]
 #align gold_conj_neg goldConj_neg
+-/
 
+#print goldConj_ne_zero /-
 theorem goldConj_ne_zero : ψ ≠ 0 :=
   ne_of_lt goldConj_neg
 #align gold_conj_ne_zero goldConj_ne_zero
+-/
 
+#print neg_one_lt_goldConj /-
 theorem neg_one_lt_goldConj : -1 < ψ :=
   by
   rw [neg_lt, ← inv_gold]
   exact inv_lt_one one_lt_gold
 #align neg_one_lt_gold_conj neg_one_lt_goldConj
+-/
 
 /-!
 ## Irrationality
@@ -186,12 +216,14 @@ section Poly
 
 open Polynomial
 
+#print fibRec_charPoly_eq /-
 /-- The characteristic polynomial of `fib_rec` is `X² - (X + 1)`. -/
 theorem fibRec_charPoly_eq {β : Type _} [CommRing β] : fibRec.charPoly = X ^ 2 - (X + (1 : β[X])) :=
   by
   rw [fibRec, LinearRecurrence.charPoly]
   simp [Finset.sum_fin_eq_sum_range, Finset.sum_range_succ', ← smul_X_eq_monomial]
 #align fib_rec_char_poly_eq fibRec_charPoly_eq
+-/
 
 end Poly
 
@@ -207,22 +239,27 @@ theorem fib_isSol_fibRec : fibRec.IsSolution (fun x => x.fib : ℕ → α) :=
 #align fib_is_sol_fib_rec fib_isSol_fibRec
 -/
 
+#print geom_gold_isSol_fibRec /-
 /-- The geometric sequence `λ n, φ^n` is a solution of `fib_rec`. -/
 theorem geom_gold_isSol_fibRec : fibRec.IsSolution (pow φ) :=
   by
   rw [fib_rec.geom_sol_iff_root_char_poly, fibRec_charPoly_eq]
   simp [sub_eq_zero]
 #align geom_gold_is_sol_fib_rec geom_gold_isSol_fibRec
+-/
 
+#print geom_goldConj_isSol_fibRec /-
 /-- The geometric sequence `λ n, ψ^n` is a solution of `fib_rec`. -/
 theorem geom_goldConj_isSol_fibRec : fibRec.IsSolution (pow ψ) :=
   by
   rw [fib_rec.geom_sol_iff_root_char_poly, fibRec_charPoly_eq]
   simp [sub_eq_zero]
 #align geom_gold_conj_is_sol_fib_rec geom_goldConj_isSol_fibRec
+-/
 
 end Fibrec
 
+#print Real.coe_fib_eq' /-
 /-- Binet's formula as a function equality. -/
 theorem Real.coe_fib_eq' : (fun n => Nat.fib n : ℕ → ℝ) = fun n => (φ ^ n - ψ ^ n) / Real.sqrt 5 :=
   by
@@ -238,9 +275,12 @@ theorem Real.coe_fib_eq' : (fun n => Nat.fib n : ℕ → ℝ) = fun n => (φ ^ n
         (Submodule.smul_mem fib_rec.sol_space (Real.sqrt 5)⁻¹ geom_gold_isSol_fibRec)
         (Submodule.smul_mem fib_rec.sol_space (Real.sqrt 5)⁻¹ geom_goldConj_isSol_fibRec)
 #align real.coe_fib_eq' Real.coe_fib_eq'
+-/
 
+#print Real.coe_fib_eq /-
 /-- Binet's formula as a dependent equality. -/
 theorem Real.coe_fib_eq : ∀ n, (Nat.fib n : ℝ) = (φ ^ n - ψ ^ n) / Real.sqrt 5 := by
   rw [← Function.funext_iff, Real.coe_fib_eq']
 #align real.coe_fib_eq Real.coe_fib_eq
+-/
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anatole Dedecker, Alexey Soloyev, Junyan Xu
 
 ! This file was ported from Lean 3 source module data.real.golden_ratio
-! leanprover-community/mathlib commit 2196ab363eb097c008d4497125e0dde23fb36db2
+! leanprover-community/mathlib commit 61b5e2755ccb464b68d05a9acf891ae04992d09d
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -18,6 +18,9 @@ import Mathbin.Algebra.LinearRecurrence
 /-!
 # The golden ratio and its conjugate
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file defines the golden ratio `φ := (1 + √5)/2` and its conjugate
 `ψ := (1 - √5)/2`, which are the two real roots of `X² - X - 1`.
 
@@ -31,17 +34,21 @@ noncomputable section
 
 open scoped Polynomial
 
+#print goldenRatio /-
 /-- The golden ratio `φ := (1 + √5)/2`. -/
 @[reducible]
 def goldenRatio :=
   (1 + Real.sqrt 5) / 2
 #align golden_ratio goldenRatio
+-/
 
+#print goldenConj /-
 /-- The conjugate of the golden ratio `ψ := (1 - √5)/2`. -/
 @[reducible]
 def goldenConj :=
   (1 - Real.sqrt 5) / 2
 #align golden_conj goldenConj
+-/
 
 -- mathport name: golden_ratio
 scoped[Real] notation "φ" => goldenRatio
@@ -58,33 +65,33 @@ theorem inv_gold : φ⁻¹ = -ψ :=
 #align inv_gold inv_gold
 
 /-- The opposite of the golden ratio is the inverse of its conjugate. -/
-theorem inv_gold_conj : ψ⁻¹ = -φ :=
+theorem inv_goldConj : ψ⁻¹ = -φ :=
   by
   rw [inv_eq_iff_eq_inv, ← neg_inv, ← neg_eq_iff_eq_neg]
   exact inv_gold.symm
-#align inv_gold_conj inv_gold_conj
+#align inv_gold_conj inv_goldConj
 
 @[simp]
-theorem gold_mul_gold_conj : φ * ψ = -1 := by field_simp; rw [← sq_sub_sq]; norm_num
-#align gold_mul_gold_conj gold_mul_gold_conj
+theorem gold_mul_goldConj : φ * ψ = -1 := by field_simp; rw [← sq_sub_sq]; norm_num
+#align gold_mul_gold_conj gold_mul_goldConj
 
 @[simp]
-theorem gold_conj_mul_gold : ψ * φ = -1 := by rw [mul_comm]; exact gold_mul_gold_conj
-#align gold_conj_mul_gold gold_conj_mul_gold
+theorem goldConj_mul_gold : ψ * φ = -1 := by rw [mul_comm]; exact gold_mul_goldConj
+#align gold_conj_mul_gold goldConj_mul_gold
 
 @[simp]
-theorem gold_add_gold_conj : φ + ψ = 1 := by rw [goldenRatio, goldenConj]; ring
-#align gold_add_gold_conj gold_add_gold_conj
+theorem gold_add_goldConj : φ + ψ = 1 := by rw [goldenRatio, goldenConj]; ring
+#align gold_add_gold_conj gold_add_goldConj
 
-theorem one_sub_gold_conj : 1 - φ = ψ := by linarith [gold_add_gold_conj]
-#align one_sub_gold_conj one_sub_gold_conj
+theorem one_sub_goldConj : 1 - φ = ψ := by linarith [gold_add_goldConj]
+#align one_sub_gold_conj one_sub_goldConj
 
-theorem one_sub_gold : 1 - ψ = φ := by linarith [gold_add_gold_conj]
+theorem one_sub_gold : 1 - ψ = φ := by linarith [gold_add_goldConj]
 #align one_sub_gold one_sub_gold
 
 @[simp]
-theorem gold_sub_gold_conj : φ - ψ = Real.sqrt 5 := by rw [goldenRatio, goldenConj]; ring
-#align gold_sub_gold_conj gold_sub_gold_conj
+theorem gold_sub_goldConj : φ - ψ = Real.sqrt 5 := by rw [goldenRatio, goldenConj]; ring
+#align gold_sub_gold_conj gold_sub_goldConj
 
 @[simp]
 theorem gold_sq : φ ^ 2 = φ + 1 :=
@@ -95,12 +102,12 @@ theorem gold_sq : φ ^ 2 = φ + 1 :=
 #align gold_sq gold_sq
 
 @[simp]
-theorem gold_conj_sq : ψ ^ 2 = ψ + 1 :=
+theorem goldConj_sq : ψ ^ 2 = ψ + 1 :=
   by
   rw [goldenConj, ← sub_eq_zero]
   ring
   rw [Real.sq_sqrt] <;> norm_num
-#align gold_conj_sq gold_conj_sq
+#align gold_conj_sq goldConj_sq
 
 theorem gold_pos : 0 < φ :=
   mul_pos (by apply add_pos <;> norm_num) <| inv_pos.2 zero_lt_two
@@ -116,24 +123,25 @@ theorem one_lt_gold : 1 < φ :=
   simp [← sq, gold_pos, zero_lt_one]
 #align one_lt_gold one_lt_gold
 
-theorem gold_conj_neg : ψ < 0 := by linarith [one_sub_gold_conj, one_lt_gold]
-#align gold_conj_neg gold_conj_neg
+theorem goldConj_neg : ψ < 0 := by linarith [one_sub_goldConj, one_lt_gold]
+#align gold_conj_neg goldConj_neg
 
-theorem gold_conj_ne_zero : ψ ≠ 0 :=
-  ne_of_lt gold_conj_neg
-#align gold_conj_ne_zero gold_conj_ne_zero
+theorem goldConj_ne_zero : ψ ≠ 0 :=
+  ne_of_lt goldConj_neg
+#align gold_conj_ne_zero goldConj_ne_zero
 
-theorem neg_one_lt_gold_conj : -1 < ψ :=
+theorem neg_one_lt_goldConj : -1 < ψ :=
   by
   rw [neg_lt, ← inv_gold]
   exact inv_lt_one one_lt_gold
-#align neg_one_lt_gold_conj neg_one_lt_gold_conj
+#align neg_one_lt_gold_conj neg_one_lt_goldConj
 
 /-!
 ## Irrationality
 -/
 
 
+#print gold_irrational /-
 /-- The golden ratio is irrational. -/
 theorem gold_irrational : Irrational φ :=
   by
@@ -143,16 +151,19 @@ theorem gold_irrational : Irrational φ :=
   convert this
   field_simp
 #align gold_irrational gold_irrational
+-/
 
+#print goldConj_irrational /-
 /-- The conjugate of the golden ratio is irrational. -/
-theorem gold_conj_irrational : Irrational ψ :=
+theorem goldConj_irrational : Irrational ψ :=
   by
   have := Nat.Prime.irrational_sqrt (show Nat.Prime 5 by norm_num)
   have := this.rat_sub 1
   have := this.rat_mul (show (0.5 : ℚ) ≠ 0 by norm_num)
   convert this
   field_simp
-#align gold_conj_irrational gold_conj_irrational
+#align gold_conj_irrational goldConj_irrational
+-/
 
 /-!
 ## Links with Fibonacci sequence
@@ -163,11 +174,13 @@ section Fibrec
 
 variable {α : Type _} [CommSemiring α]
 
+#print fibRec /-
 /-- The recurrence relation satisfied by the Fibonacci sequence. -/
 def fibRec : LinearRecurrence α where
   order := 2
   coeffs := ![1, 1]
 #align fib_rec fibRec
+-/
 
 section Poly
 
@@ -182,29 +195,31 @@ theorem fibRec_charPoly_eq {β : Type _} [CommRing β] : fibRec.charPoly = X ^ 2
 
 end Poly
 
+#print fib_isSol_fibRec /-
 /-- As expected, the Fibonacci sequence is a solution of `fib_rec`. -/
-theorem fib_is_sol_fibRec : fibRec.IsSolution (fun x => x.fib : ℕ → α) :=
+theorem fib_isSol_fibRec : fibRec.IsSolution (fun x => x.fib : ℕ → α) :=
   by
   rw [fibRec]
   intro n
   simp only
   rw [Nat.fib_add_two, add_comm]
   simp [Finset.sum_fin_eq_sum_range, Finset.sum_range_succ']
-#align fib_is_sol_fib_rec fib_is_sol_fibRec
+#align fib_is_sol_fib_rec fib_isSol_fibRec
+-/
 
 /-- The geometric sequence `λ n, φ^n` is a solution of `fib_rec`. -/
-theorem geom_gold_is_sol_fibRec : fibRec.IsSolution (pow φ) :=
+theorem geom_gold_isSol_fibRec : fibRec.IsSolution (pow φ) :=
   by
   rw [fib_rec.geom_sol_iff_root_char_poly, fibRec_charPoly_eq]
   simp [sub_eq_zero]
-#align geom_gold_is_sol_fib_rec geom_gold_is_sol_fibRec
+#align geom_gold_is_sol_fib_rec geom_gold_isSol_fibRec
 
 /-- The geometric sequence `λ n, ψ^n` is a solution of `fib_rec`. -/
-theorem geom_gold_conj_is_sol_fibRec : fibRec.IsSolution (pow ψ) :=
+theorem geom_goldConj_isSol_fibRec : fibRec.IsSolution (pow ψ) :=
   by
   rw [fib_rec.geom_sol_iff_root_char_poly, fibRec_charPoly_eq]
   simp [sub_eq_zero]
-#align geom_gold_conj_is_sol_fib_rec geom_gold_conj_is_sol_fibRec
+#align geom_gold_conj_is_sol_fib_rec geom_goldConj_isSol_fibRec
 
 end Fibrec
 
@@ -216,12 +231,12 @@ theorem Real.coe_fib_eq' : (fun n => Nat.fib n : ℕ → ℝ) = fun n => (φ ^ n
     fin_cases hi
     · simp
     · simp only [goldenRatio, goldenConj]; ring; rw [mul_inv_cancel] <;> norm_num
-  · exact fib_is_sol_fibRec
+  · exact fib_isSol_fibRec
   · ring_nf
     exact
       (@fibRec ℝ _).solSpace.sub_mem
-        (Submodule.smul_mem fib_rec.sol_space (Real.sqrt 5)⁻¹ geom_gold_is_sol_fibRec)
-        (Submodule.smul_mem fib_rec.sol_space (Real.sqrt 5)⁻¹ geom_gold_conj_is_sol_fibRec)
+        (Submodule.smul_mem fib_rec.sol_space (Real.sqrt 5)⁻¹ geom_gold_isSol_fibRec)
+        (Submodule.smul_mem fib_rec.sol_space (Real.sqrt 5)⁻¹ geom_goldConj_isSol_fibRec)
 #align real.coe_fib_eq' Real.coe_fib_eq'
 
 /-- Binet's formula as a dependent equality. -/
Diff
@@ -29,7 +29,7 @@ Binet's formula.
 
 noncomputable section
 
-open Polynomial
+open scoped Polynomial
 
 /-- The golden ratio `φ := (1 + √5)/2`. -/
 @[reducible]
Diff
@@ -65,23 +65,15 @@ theorem inv_gold_conj : ψ⁻¹ = -φ :=
 #align inv_gold_conj inv_gold_conj
 
 @[simp]
-theorem gold_mul_gold_conj : φ * ψ = -1 := by
-  field_simp
-  rw [← sq_sub_sq]
-  norm_num
+theorem gold_mul_gold_conj : φ * ψ = -1 := by field_simp; rw [← sq_sub_sq]; norm_num
 #align gold_mul_gold_conj gold_mul_gold_conj
 
 @[simp]
-theorem gold_conj_mul_gold : ψ * φ = -1 := by
-  rw [mul_comm]
-  exact gold_mul_gold_conj
+theorem gold_conj_mul_gold : ψ * φ = -1 := by rw [mul_comm]; exact gold_mul_gold_conj
 #align gold_conj_mul_gold gold_conj_mul_gold
 
 @[simp]
-theorem gold_add_gold_conj : φ + ψ = 1 :=
-  by
-  rw [goldenRatio, goldenConj]
-  ring
+theorem gold_add_gold_conj : φ + ψ = 1 := by rw [goldenRatio, goldenConj]; ring
 #align gold_add_gold_conj gold_add_gold_conj
 
 theorem one_sub_gold_conj : 1 - φ = ψ := by linarith [gold_add_gold_conj]
@@ -91,10 +83,7 @@ theorem one_sub_gold : 1 - ψ = φ := by linarith [gold_add_gold_conj]
 #align one_sub_gold one_sub_gold
 
 @[simp]
-theorem gold_sub_gold_conj : φ - ψ = Real.sqrt 5 :=
-  by
-  rw [goldenRatio, goldenConj]
-  ring
+theorem gold_sub_gold_conj : φ - ψ = Real.sqrt 5 := by rw [goldenRatio, goldenConj]; ring
 #align gold_sub_gold_conj gold_sub_gold_conj
 
 @[simp]
@@ -226,9 +215,7 @@ theorem Real.coe_fib_eq' : (fun n => Nat.fib n : ℕ → ℝ) = fun n => (φ ^ n
   · intro i hi
     fin_cases hi
     · simp
-    · simp only [goldenRatio, goldenConj]
-      ring
-      rw [mul_inv_cancel] <;> norm_num
+    · simp only [goldenRatio, goldenConj]; ring; rw [mul_inv_cancel] <;> norm_num
   · exact fib_is_sol_fibRec
   · ring_nf
     exact
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anatole Dedecker, Alexey Soloyev, Junyan Xu
 
 ! This file was ported from Lean 3 source module data.real.golden_ratio
-! leanprover-community/mathlib commit 10b4e499f43088dd3bb7b5796184ad5216648ab1
+! leanprover-community/mathlib commit 2196ab363eb097c008d4497125e0dde23fb36db2
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -60,7 +60,7 @@ theorem inv_gold : φ⁻¹ = -ψ :=
 /-- The opposite of the golden ratio is the inverse of its conjugate. -/
 theorem inv_gold_conj : ψ⁻¹ = -φ :=
   by
-  rw [inv_eq_iff_inv_eq, ← neg_inv, neg_eq_iff_neg_eq]
+  rw [inv_eq_iff_eq_inv, ← neg_inv, ← neg_eq_iff_eq_neg]
   exact inv_gold.symm
 #align inv_gold_conj inv_gold_conj
 
Diff
@@ -185,7 +185,7 @@ section Poly
 open Polynomial
 
 /-- The characteristic polynomial of `fib_rec` is `X² - (X + 1)`. -/
-theorem fibRec_charPoly_eq {β : Type _} [CommRing β] : fibRec.charPoly = x ^ 2 - (x + (1 : β[X])) :=
+theorem fibRec_charPoly_eq {β : Type _} [CommRing β] : fibRec.charPoly = X ^ 2 - (X + (1 : β[X])) :=
   by
   rw [fibRec, LinearRecurrence.charPoly]
   simp [Finset.sum_fin_eq_sum_range, Finset.sum_range_succ', ← smul_X_eq_monomial]

Changes in mathlib4

mathlib3
mathlib4
feat: add notation for Real.sqrt (#12056)

This adds the notation √r for Real.sqrt r. The precedence is such that √x⁻¹ is parsed as √(x⁻¹); not because this is particularly desirable, but because it's the default and the choice doesn't really matter.

This is extracted from #7907, which adds a more general nth root typeclass. The idea is to perform all the boring substitutions downstream quickly, so that we can play around with custom elaborators with a much slower rate of code-rot. This PR also won't rot as quickly, as it does not forbid writing x.sqrt as that PR does.

While perhaps claiming for Real.sqrt is greedy; it:

  • Is far more common thatn NNReal.sqrt and Nat.sqrt
  • Is far more interesting to mathlib than sqrt on Float
  • Can be overloaded anyway, so this does not prevent downstream code using the notation on their own types.
  • Will be replaced by a more general typeclass in a future PR.

Zulip

Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>

Diff
@@ -30,14 +30,12 @@ open Polynomial
 
 /-- The golden ratio `φ := (1 + √5)/2`. -/
 @[reducible]
-def goldenRatio :=
-  (1 + Real.sqrt 5) / 2
+def goldenRatio : ℝ := (1 + √5) / 2
 #align golden_ratio goldenRatio
 
 /-- The conjugate of the golden ratio `ψ := (1 - √5)/2`. -/
 @[reducible]
-def goldenConj :=
-  (1 - Real.sqrt 5) / 2
+def goldenConj : ℝ := (1 - √5) / 2
 #align golden_conj goldenConj
 
 @[inherit_doc goldenRatio] scoped[goldenRatio] notation "φ" => goldenRatio
@@ -46,7 +44,7 @@ open Real goldenRatio
 
 /-- The inverse of the golden ratio is the opposite of its conjugate. -/
 theorem inv_gold : φ⁻¹ = -ψ := by
-  have : 1 + Real.sqrt 5 ≠ 0 := ne_of_gt (add_pos (by norm_num) <| Real.sqrt_pos.mpr (by norm_num))
+  have : 1 + √5 ≠ 0 := ne_of_gt (add_pos (by norm_num) <| Real.sqrt_pos.mpr (by norm_num))
   field_simp [sub_mul, mul_add]
   norm_num
 #align inv_gold inv_gold
@@ -85,9 +83,7 @@ theorem one_sub_gold : 1 - ψ = φ := by
 #align one_sub_gold one_sub_gold
 
 @[simp]
-theorem gold_sub_goldConj : φ - ψ = Real.sqrt 5 := by
-  rw [goldenRatio, goldenConj]
-  ring
+theorem gold_sub_goldConj : φ - ψ = √5 := by ring
 #align gold_sub_gold_conj gold_sub_goldConj
 
 theorem gold_pow_sub_gold_pow (n : ℕ) : φ ^ (n + 2) - φ ^ (n + 1) = φ ^ n := by
@@ -214,7 +210,7 @@ end Fibrec
 
 /-- Binet's formula as a function equality. -/
 theorem Real.coe_fib_eq' :
-    (fun n => Nat.fib n : ℕ → ℝ) = fun n => (φ ^ n - ψ ^ n) / Real.sqrt 5 := by
+    (fun n => Nat.fib n : ℕ → ℝ) = fun n => (φ ^ n - ψ ^ n) / √5 := by
   rw [fibRec.sol_eq_of_eq_init]
   · intro i hi
     norm_cast at hi
@@ -226,17 +222,17 @@ theorem Real.coe_fib_eq' :
   · exact fib_isSol_fibRec
   · -- Porting note: Rewrote this proof
     suffices LinearRecurrence.IsSolution fibRec
-        ((fun n ↦ (sqrt 5)⁻¹ * φ ^ n) - (fun n ↦ (sqrt 5)⁻¹ * ψ ^ n)) by
+        ((fun n ↦ (√5)⁻¹ * φ ^ n) - (fun n ↦ (√5)⁻¹ * ψ ^ n)) by
       convert this
       rw [Pi.sub_apply]
       ring
     apply (@fibRec ℝ _).solSpace.sub_mem
-    · exact Submodule.smul_mem fibRec.solSpace (Real.sqrt 5)⁻¹ geom_gold_isSol_fibRec
-    · exact Submodule.smul_mem fibRec.solSpace (Real.sqrt 5)⁻¹ geom_goldConj_isSol_fibRec
+    · exact Submodule.smul_mem fibRec.solSpace (√5)⁻¹ geom_gold_isSol_fibRec
+    · exact Submodule.smul_mem fibRec.solSpace (√5)⁻¹ geom_goldConj_isSol_fibRec
 #align real.coe_fib_eq' Real.coe_fib_eq'
 
 /-- Binet's formula as a dependent equality. -/
-theorem Real.coe_fib_eq : ∀ n, (Nat.fib n : ℝ) = (φ ^ n - ψ ^ n) / Real.sqrt 5 := by
+theorem Real.coe_fib_eq : ∀ n, (Nat.fib n : ℝ) = (φ ^ n - ψ ^ n) / √5 := by
   rw [← Function.funext_iff, Real.coe_fib_eq']
 #align real.coe_fib_eq Real.coe_fib_eq
 
change the order of operation in zsmulRec and nsmulRec (#11451)

We change the following field in the definition of an additive commutative monoid:

 nsmul_succ : ∀ (n : ℕ) (x : G),
-  AddMonoid.nsmul (n + 1) x = x + AddMonoid.nsmul n x
+  AddMonoid.nsmul (n + 1) x = AddMonoid.nsmul n x + x

where the latter is more natural

We adjust the definitions of ^ in monoids, groups, etc. Originally there was a warning comment about why this natural order was preferred

use x * npowRec n x and not npowRec n x * x in the definition to make sure that definitional unfolding of npowRec is blocked, to avoid deep recursion issues.

but it seems to no longer apply.

Remarks on the PR :

  • pow_succ and pow_succ' have switched their meanings.
  • Most of the time, the proofs were adjusted by priming/unpriming one lemma, or exchanging left and right; a few proofs were more complicated to adjust.
  • In particular, [Mathlib/NumberTheory/RamificationInertia.lean] used Ideal.IsPrime.mul_mem_pow which is defined in [Mathlib/RingTheory/DedekindDomain/Ideal.lean]. Changing the order of operation forced me to add the symmetric lemma Ideal.IsPrime.mem_pow_mul.
  • the docstring for Cauchy condensation test in [Mathlib/Analysis/PSeries.lean] was mathematically incorrect, I added the mention that the function is antitone.
Diff
@@ -243,7 +243,7 @@ theorem Real.coe_fib_eq : ∀ n, (Nat.fib n : ℝ) = (φ ^ n - ψ ^ n) / Real.sq
 /-- Relationship between the Fibonacci Sequence, Golden Ratio and its conjugate's exponents --/
 theorem fib_golden_conj_exp (n : ℕ) : Nat.fib (n + 1) - φ * Nat.fib n = ψ ^ n := by
   repeat rw [coe_fib_eq]
-  rw [mul_div, div_sub_div_same, mul_sub, ← pow_succ]
+  rw [mul_div, div_sub_div_same, mul_sub, ← pow_succ']
   ring_nf
   have nz : sqrt 5 ≠ 0 := by norm_num
   rw [← (mul_inv_cancel nz).symm, one_mul]
chore: reduce imports (#9830)

This uses the improved shake script from #9772 to reduce imports across mathlib. The corresponding noshake.json file has been added to #9772.

Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -5,10 +5,10 @@ Authors: Anatole Dedecker, Alexey Soloyev, Junyan Xu, Kamila Szewczyk
 -/
 import Mathlib.Data.Real.Irrational
 import Mathlib.Data.Nat.Fib.Basic
-import Mathlib.Data.Nat.PrimeNormNum
 import Mathlib.Data.Fin.VecNotation
 import Mathlib.Algebra.LinearRecurrence
 import Mathlib.Tactic.NormNum.NatFib
+import Mathlib.Tactic.NormNum.Prime
 
 #align_import data.real.golden_ratio from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2"
 
Results regarding Fibonacci sequence and Golden Ratio (#9625)

List of results so far:

  • φ ^ (n + 2) - φ ^ (n + 1) = φ ^ n
  • 2 > φ
  • fib (n + 1) - φ * fib n = ψ ^ n
  • fib n + φ * fib (n + 1) = φ ^ n

Open in Gitpod

Co-authored-by: Kamila Szewczyk <kspalaiologos@gmail.com>

Diff
@@ -1,7 +1,7 @@
 /-
 Copyright (c) 2020 Anatole Dedecker. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
-Authors: Anatole Dedecker, Alexey Soloyev, Junyan Xu
+Authors: Anatole Dedecker, Alexey Soloyev, Junyan Xu, Kamila Szewczyk
 -/
 import Mathlib.Data.Real.Irrational
 import Mathlib.Data.Nat.Fib.Basic
@@ -90,6 +90,9 @@ theorem gold_sub_goldConj : φ - ψ = Real.sqrt 5 := by
   ring
 #align gold_sub_gold_conj gold_sub_goldConj
 
+theorem gold_pow_sub_gold_pow (n : ℕ) : φ ^ (n + 2) - φ ^ (n + 1) = φ ^ n := by
+  rw [goldenRatio]; ring_nf; norm_num; ring
+
 @[simp 1200]
 theorem gold_sq : φ ^ 2 = φ + 1 := by
   rw [goldenRatio, ← sub_eq_zero]
@@ -117,6 +120,10 @@ theorem one_lt_gold : 1 < φ := by
   simp [← sq, gold_pos, zero_lt_one, - div_pow] -- Porting note: Added `- div_pow`
 #align one_lt_gold one_lt_gold
 
+theorem gold_lt_two : φ < 2 := by calc
+  (1 + sqrt 5) / 2 < (1 + 3) / 2 := by gcongr; rw [sqrt_lt'] <;> norm_num
+  _ = 2 := by norm_num
+
 theorem goldConj_neg : ψ < 0 := by
   linarith [one_sub_goldConj, one_lt_gold]
 #align gold_conj_neg goldConj_neg
@@ -159,7 +166,6 @@ theorem goldConj_irrational : Irrational ψ := by
 ## Links with Fibonacci sequence
 -/
 
-
 section Fibrec
 
 variable {α : Type*} [CommSemiring α]
@@ -233,3 +239,23 @@ theorem Real.coe_fib_eq' :
 theorem Real.coe_fib_eq : ∀ n, (Nat.fib n : ℝ) = (φ ^ n - ψ ^ n) / Real.sqrt 5 := by
   rw [← Function.funext_iff, Real.coe_fib_eq']
 #align real.coe_fib_eq Real.coe_fib_eq
+
+/-- Relationship between the Fibonacci Sequence, Golden Ratio and its conjugate's exponents --/
+theorem fib_golden_conj_exp (n : ℕ) : Nat.fib (n + 1) - φ * Nat.fib n = ψ ^ n := by
+  repeat rw [coe_fib_eq]
+  rw [mul_div, div_sub_div_same, mul_sub, ← pow_succ]
+  ring_nf
+  have nz : sqrt 5 ≠ 0 := by norm_num
+  rw [← (mul_inv_cancel nz).symm, one_mul]
+
+/-- Relationship between the Fibonacci Sequence, Golden Ratio and its exponents --/
+theorem fib_golden_exp' (n : ℕ) : φ * Nat.fib (n + 1) + Nat.fib n = φ ^ (n + 1) := by
+  induction n with
+  | zero => norm_num
+  | succ n ih =>
+    calc
+      _ = φ * (Nat.fib n) + φ ^ 2 * (Nat.fib (n + 1)) :=
+        by simp only [Nat.fib_add_one (Nat.succ_ne_zero n), Nat.succ_sub_succ_eq_sub, tsub_zero,
+          Nat.cast_add, gold_sq]; ring
+      _ = φ * ((Nat.fib n) + φ * (Nat.fib (n + 1))) := by ring
+      _ = φ ^ (n + 2) := by rw [add_comm, ih]; ring
chore: Move Data.Nat.FibData.Nat.Fib.Basic (#8576)

This was postponed to after the Zeckendorf PR.

Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anatole Dedecker, Alexey Soloyev, Junyan Xu
 -/
 import Mathlib.Data.Real.Irrational
-import Mathlib.Data.Nat.Fib
+import Mathlib.Data.Nat.Fib.Basic
 import Mathlib.Data.Nat.PrimeNormNum
 import Mathlib.Data.Fin.VecNotation
 import Mathlib.Algebra.LinearRecurrence
fix: Put golden ratio notation in a specific namespace. (#7871)

The current situation blocks two very common letters if you import Mathlib and open Real.

Diff
@@ -40,9 +40,9 @@ def goldenConj :=
   (1 - Real.sqrt 5) / 2
 #align golden_conj goldenConj
 
-@[inherit_doc goldenRatio] scoped[Real] notation "φ" => goldenRatio
-@[inherit_doc goldenConj] scoped[Real] notation "ψ" => goldenConj
-open Real
+@[inherit_doc goldenRatio] scoped[goldenRatio] notation "φ" => goldenRatio
+@[inherit_doc goldenConj] scoped[goldenRatio] notation "ψ" => goldenConj
+open Real goldenRatio
 
 /-- The inverse of the golden ratio is the opposite of its conjugate. -/
 theorem inv_gold : φ⁻¹ = -ψ := by
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -162,7 +162,7 @@ theorem goldConj_irrational : Irrational ψ := by
 
 section Fibrec
 
-variable {α : Type _} [CommSemiring α]
+variable {α : Type*} [CommSemiring α]
 
 /-- The recurrence relation satisfied by the Fibonacci sequence. -/
 def fibRec : LinearRecurrence α where
@@ -175,7 +175,7 @@ section Poly
 open Polynomial
 
 /-- The characteristic polynomial of `fibRec` is `X² - (X + 1)`. -/
-theorem fibRec_charPoly_eq {β : Type _} [CommRing β] :
+theorem fibRec_charPoly_eq {β : Type*} [CommRing β] :
     fibRec.charPoly = X ^ 2 - (X + (1 : β[X])) := by
   rw [fibRec, LinearRecurrence.charPoly]
   simp [Finset.sum_fin_eq_sum_range, Finset.sum_range_succ', ← smul_X_eq_monomial]
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2020 Anatole Dedecker. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anatole Dedecker, Alexey Soloyev, Junyan Xu
-
-! This file was ported from Lean 3 source module data.real.golden_ratio
-! leanprover-community/mathlib commit 2196ab363eb097c008d4497125e0dde23fb36db2
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Data.Real.Irrational
 import Mathlib.Data.Nat.Fib
@@ -15,6 +10,8 @@ import Mathlib.Data.Fin.VecNotation
 import Mathlib.Algebra.LinearRecurrence
 import Mathlib.Tactic.NormNum.NatFib
 
+#align_import data.real.golden_ratio from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2"
+
 /-!
 # The golden ratio and its conjugate
 
chore: forward port leanprover-community/mathlib#19118 (#4831)

This also removes a stray import Mathlib.Tactic, which causes a downstream file to break.

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -13,6 +13,7 @@ import Mathlib.Data.Nat.Fib
 import Mathlib.Data.Nat.PrimeNormNum
 import Mathlib.Data.Fin.VecNotation
 import Mathlib.Algebra.LinearRecurrence
+import Mathlib.Tactic.NormNum.NatFib
 
 /-!
 # The golden ratio and its conjugate
feat: port Data.Real.GoldenRatio (#4332)

Co-authored-by: Komyyy <pol_tta@outlook.jp>

Dependencies 12 + 753

754 files ported (98.4%)
326862 lines ported (98.3%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file