File: Mathlib/NumberTheory/EllipticDivisibilitySequence.lean

full_name: IsEllSequence
code: /-- The proposition that a sequence indexed by integers is an elliptic sequence. -/
def IsEllSequence : Prop 
goal: Prop

full_name: IsDivSequence
code: /-- The proposition that a sequence indexed by integers is a divisibility sequence. -/
def IsDivSequence : Prop 
goal: Prop

full_name: IsEllDivSequence
code: /-- The proposition that a sequence indexed by integers is an EDS. -/
def IsEllDivSequence : Prop 
goal: Prop

full_name: isEllSequence_id
code: lemma isEllSequence_id : IsEllSequence id 
goal: IsEllSequence id

full_name: isDivSequence_id
code: lemma isDivSequence_id : IsDivSequence id 
goal: IsDivSequence id

full_name: isEllDivSequence_id
code: /-- The identity sequence is an EDS. -/
theorem isEllDivSequence_id : IsEllDivSequence id 
goal: IsEllDivSequence id

full_name: IsEllSequence.smul
code: lemma IsEllSequence.smul (h : IsEllSequence W) (x : R) : IsEllSequence (x • W) 
goal: IsEllSequence (x • W)

full_name: IsDivSequence.smul
code: lemma IsDivSequence.smul (h : IsDivSequence W) (x : R) : IsDivSequence (x • W) 
goal: IsDivSequence (x • W)

full_name: IsEllDivSequence.smul
code: lemma IsEllDivSequence.smul (h : IsEllDivSequence W) (x : R) : IsEllDivSequence (x • W) 
goal: IsEllDivSequence (x • W)

full_name: preNormEDS'
code: /-- The auxiliary sequence for a normalised EDS `W : ℕ → R`, with initial values
`W(0) = 0`, `W(1) = 1`, `W(2) = 1`, `W(3) = c`, and `W(4) = d` and extra parameter `b`. -/
def preNormEDS' (b c d : R) : ℕ → R
  
goal: ℕ → R

full_name: preNormEDS'_zero
code: @[simp]
lemma preNormEDS'_zero : preNormEDS' b c d 0 = 0 
goal: preNormEDS' b c d 0 = 0

full_name: preNormEDS'_one
code: @[simp]
lemma preNormEDS'_one : preNormEDS' b c d 1 = 1 
goal: preNormEDS' b c d 1 = 1

full_name: preNormEDS'_two
code: @[simp]
lemma preNormEDS'_two : preNormEDS' b c d 2 = 1 
goal: preNormEDS' b c d 2 = 1

full_name: preNormEDS'_three
code: @[simp]
lemma preNormEDS'_three : preNormEDS' b c d 3 = c 
goal: preNormEDS' b c d 3 = c

full_name: preNormEDS'_four
code: @[simp]
lemma preNormEDS'_four : preNormEDS' b c d 4 = d 
goal: preNormEDS' b c d 4 = d

full_name: preNormEDS'_odd
code: lemma preNormEDS'_odd (m : ℕ) : preNormEDS' b c d (2 * (m + 2) + 1) =
    preNormEDS' b c d (m + 4) * preNormEDS' b c d (m + 2) ^ 3 * (if Even m then b else 1) -
      preNormEDS' b c d (m + 1) * preNormEDS' b c d (m + 3) ^ 3 * (if Even m then 1 else b) 
goal: preNormEDS' b c d (2 * (m + 2) + 1) =
  (preNormEDS' b c d (m + 4) * preNormEDS' b c d (m + 2) ^ 3 * if Even m then b else 1) -
    preNormEDS' b c d (m + 1) * preNormEDS' b c d (m + 3) ^ 3 * if Even m then 1 else b

full_name: preNormEDS'_even
code: lemma preNormEDS'_even (m : ℕ) : preNormEDS' b c d (2 * (m + 3)) =
    preNormEDS' b c d (m + 2) ^ 2 * preNormEDS' b c d (m + 3) * preNormEDS' b c d (m + 5) -
      preNormEDS' b c d (m + 1) * preNormEDS' b c d (m + 3) * preNormEDS' b c d (m + 4) ^ 2 
goal: preNormEDS' b c d (2 * (m + 3)) =
  preNormEDS' b c d (m + 2) ^ 2 * preNormEDS' b c d (m + 3) * preNormEDS' b c d (m + 5) -
    preNormEDS' b c d (m + 1) * preNormEDS' b c d (m + 3) * preNormEDS' b c d (m + 4) ^ 2

full_name: preNormEDS
code: /-- The auxiliary sequence for a normalised EDS `W : ℤ → R`, with initial values
`W(0) = 0`, `W(1) = 1`, `W(2) = 1`, `W(3) = c`, and `W(4) = d` and extra parameter `b`.

This extends `preNormEDS'` by defining its values at negative integers. -/
def preNormEDS (n : ℤ) : R 
goal: R

full_name: preNormEDS_ofNat
code: @[simp]
lemma preNormEDS_ofNat (n : ℕ) : preNormEDS b c d n = preNormEDS' b c d n 
goal: preNormEDS b c d ↑n = preNormEDS' b c d n

full_name: preNormEDS_zero
code: @[simp]
lemma preNormEDS_zero : preNormEDS b c d 0 = 0 
goal: preNormEDS b c d 0 = 0

full_name: preNormEDS_one
code: @[simp]
lemma preNormEDS_one : preNormEDS b c d 1 = 1 
goal: preNormEDS b c d 1 = 1

full_name: preNormEDS_two
code: @[simp]
lemma preNormEDS_two : preNormEDS b c d 2 = 1 
goal: preNormEDS b c d 2 = 1

full_name: preNormEDS_three
code: @[simp]
lemma preNormEDS_three : preNormEDS b c d 3 = c 
goal: preNormEDS b c d 3 = c

full_name: preNormEDS_four
code: @[simp]
lemma preNormEDS_four : preNormEDS b c d 4 = d 
goal: preNormEDS b c d 4 = d

full_name: preNormEDS_odd
code: lemma preNormEDS_odd (m : ℕ) : preNormEDS b c d (2 * (m + 2) + 1) =
    preNormEDS b c d (m + 4) * preNormEDS b c d (m + 2) ^ 3 * (if Even m then b else 1) -
      preNormEDS b c d (m + 1) * preNormEDS b c d (m + 3) ^ 3 * (if Even m then 1 else b) 
goal: preNormEDS b c d (2 * (↑m + 2) + 1) =
  (preNormEDS b c d (↑m + 4) * preNormEDS b c d (↑m + 2) ^ 3 * if Even m then b else 1) -
    preNormEDS b c d (↑m + 1) * preNormEDS b c d (↑m + 3) ^ 3 * if Even m then 1 else b

full_name: preNormEDS_even
code: lemma preNormEDS_even (m : ℕ) : preNormEDS b c d (2 * (m + 3)) =
    preNormEDS b c d (m + 2) ^ 2 * preNormEDS b c d (m + 3) * preNormEDS b c d (m + 5) -
      preNormEDS b c d (m + 1) * preNormEDS b c d (m + 3) * preNormEDS b c d (m + 4) ^ 2 
goal: preNormEDS b c d (2 * (↑m + 3)) =
  preNormEDS b c d (↑m + 2) ^ 2 * preNormEDS b c d (↑m + 3) * preNormEDS b c d (↑m + 5) -
    preNormEDS b c d (↑m + 1) * preNormEDS b c d (↑m + 3) * preNormEDS b c d (↑m + 4) ^ 2

full_name: preNormEDS_neg
code: @[simp]
lemma preNormEDS_neg (n : ℤ) : preNormEDS b c d (-n) = -preNormEDS b c d n 
goal: preNormEDS b c d (-n) = -preNormEDS b c d n

full_name: normEDS
code: /-- The canonical example of a normalised EDS `W : ℤ → R`, with initial values
`W(0) = 0`, `W(1) = 1`, `W(2) = b`, `W(3) = c`, and `W(4) = d * b`.

This is defined in terms of `preNormEDS` whose even terms differ by a factor of `b`. -/
def normEDS (n : ℤ) : R 
goal: R

full_name: normEDS_ofNat
code: @[simp]
lemma normEDS_ofNat (n : ℕ) :
    normEDS b c d n = preNormEDS' (b ^ 4) c d n * if Even n then b else 1 
goal: normEDS b c d ↑n = preNormEDS' (b ^ 4) c d n * if Even n then b else 1

full_name: normEDS_zero
code: @[simp]
lemma normEDS_zero : normEDS b c d 0 = 0 
goal: normEDS b c d 0 = 0

full_name: normEDS_one
code: @[simp]
lemma normEDS_one : normEDS b c d 1 = 1 
goal: normEDS b c d 1 = 1

full_name: normEDS_two
code: @[simp]
lemma normEDS_two : normEDS b c d 2 = b 
goal: normEDS b c d 2 = b

full_name: normEDS_three
code: @[simp]
lemma normEDS_three : normEDS b c d 3 = c 
goal: normEDS b c d 3 = c

full_name: normEDS_four
code: @[simp]
lemma normEDS_four : normEDS b c d 4 = d * b 
goal: normEDS b c d 4 = d * b

full_name: normEDS_odd
code: lemma normEDS_odd (m : ℕ) : normEDS b c d (2 * (m + 2) + 1) =
    normEDS b c d (m + 4) * normEDS b c d (m + 2) ^ 3 -
      normEDS b c d (m + 1) * normEDS b c d (m + 3) ^ 3 
goal: normEDS b c d (2 * (↑m + 2) + 1) =
  normEDS b c d (↑m + 4) * normEDS b c d (↑m + 2) ^ 3 - normEDS b c d (↑m + 1) * normEDS b c d (↑m + 3) ^ 3

full_name: normEDS_even
code: lemma normEDS_even (m : ℕ) : normEDS b c d (2 * (m + 3)) * b =
    normEDS b c d (m + 2) ^ 2 * normEDS b c d (m + 3) * normEDS b c d (m + 5) -
      normEDS b c d (m + 1) * normEDS b c d (m + 3) * normEDS b c d (m + 4) ^ 2 
goal: normEDS b c d (2 * (↑m + 3)) * b =
  normEDS b c d (↑m + 2) ^ 2 * normEDS b c d (↑m + 3) * normEDS b c d (↑m + 5) -
    normEDS b c d (↑m + 1) * normEDS b c d (↑m + 3) * normEDS b c d (↑m + 4) ^ 2

full_name: normEDS_neg
code: @[simp]
lemma normEDS_neg (n : ℤ) : normEDS b c d (-n) = -normEDS b c d n 
goal: normEDS b c d (-n) = -normEDS b c d n

full_name: normEDSRec'
code: /-- Strong recursion principle for a normalised EDS: if we have
 * `P 0`, `P 1`, `P 2`, `P 3`, and `P 4`,
 * for all `m : ℕ` we can prove `P (2 * (m + 3))` from `P k` for all `k < 2 * (m + 3)`, and
 * for all `m : ℕ` we can prove `P (2 * (m + 2) + 1)` from `P k` for all `k < 2 * (m + 2) + 1`,
then we have `P n` for all `n : ℕ`. -/
@[elab_as_elim]
noncomputable def normEDSRec' {P : ℕ → Sort u}
    (zero : P 0) (one : P 1) (two : P 2) (three : P 3) (four : P 4)
    (even : ∀ m : ℕ, (∀ k < 2 * (m + 3), P k) → P (2 * (m + 3)))
    (odd : ∀ m : ℕ, (∀ k < 2 * (m + 2) + 1, P k) → P (2 * (m + 2) + 1)) (n : ℕ) : P n 
goal: P n

full_name: normEDSRec
code: /-- Recursion principle for a normalised EDS: if we have
 * `P 0`, `P 1`, `P 2`, `P 3`, and `P 4`,
 * for all `m : ℕ` we can prove `P (2 * (m + 3))` from `P (m + 1)`, `P (m + 2)`, `P (m + 3)`,
    `P (m + 4)`, and `P (m + 5)`, and
 * for all `m : ℕ` we can prove `P (2 * (m + 2) + 1)` from `P (m + 1)`, `P (m + 2)`, `P (m + 3)`,
    and `P (m + 4)`,
then we have `P n` for all `n : ℕ`. -/
@[elab_as_elim]
noncomputable def normEDSRec {P : ℕ → Sort u}
    (zero : P 0) (one : P 1) (two : P 2) (three : P 3) (four : P 4)
    (even : ∀ m : ℕ, P (m + 1) → P (m + 2) → P (m + 3) → P (m + 4) → P (m + 5) → P (2 * (m + 3)))
    (odd : ∀ m : ℕ, P (m + 1) → P (m + 2) → P (m + 3) → P (m + 4) → P (2 * (m + 2) + 1)) (n : ℕ) :
    P n 
goal: P n

full_name: map_preNormEDS'
code: lemma map_preNormEDS' (n : ℕ) : f (preNormEDS' b c d n) = preNormEDS' (f b) (f c) (f d) n 
goal: f (preNormEDS' b c d n) = preNormEDS' (f b) (f c) (f d) n

full_name: map_preNormEDS
code: lemma map_preNormEDS (n : ℤ) : f (preNormEDS b c d n) = preNormEDS (f b) (f c) (f d) n 
goal: f (preNormEDS b c d n) = preNormEDS (f b) (f c) (f d) n

full_name: map_normEDS
code: lemma map_normEDS (n : ℤ) : f (normEDS b c d n) = normEDS (f b) (f c) (f d) n 
goal: f (normEDS b c d n) = normEDS (f b) (f c) (f d) n