-- Mathlib/Analysis/Fourier/PoissonSummation.lean
theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, ℂ)}
    (hf : ∀ K : Compacts ℝ, Summable fun n : ℤ => ‖(f.comp (ContinuousMap.addRight n)).restrict K‖)
    (m : ℤ) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m

Proof state:
case h.e'_5
f : C(ℝ, ℂ)
hf : ∀ (K : Compacts ℝ), Summable fun n => ‖ContinuousMap.restrict (↑K) (f.comp (ContinuousMap.addRight ↑n))‖
m : ℤ
e : C(ℝ, ℂ) := (fourier (-m)).comp { toFun := QuotientAddGroup.mk, continuous_toFun := ⋯ }
neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖ContinuousMap.restrict (↑K) (e * g)‖ = ‖ContinuousMap.restrict (↑K) g‖
eadd : ∀ (n : ℤ), e.comp (ContinuousMap.addRight ↑n) = e
⊢ (fun i =>
      ‖ContinuousMap.restrict (↑{ carrier := uIcc 0 1, isCompact' := ⋯ }) (e * f.comp (ContinuousMap.addRight ↑i))‖) =
    fun n => ‖ContinuousMap.restrict (↑{ carrier := uIcc 0 1, isCompact' := ⋯ }) (f.comp (ContinuousMap.addRight ↑n))‖

Tactic:
exact funext fun n => neK _ _

Result:
no goals

Proof state:
f : C(ℝ, ℂ)
hf : ∀ (K : Compacts ℝ), Summable fun n => ‖ContinuousMap.restrict (↑K) (f.comp (ContinuousMap.addRight ↑n))‖
m : ℤ
e : C(ℝ, ℂ) := (fourier (-m)).comp { toFun := QuotientAddGroup.mk, continuous_toFun := ⋯ }
neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖ContinuousMap.restrict (↑K) (e * g)‖ = ‖ContinuousMap.restrict (↑K) g‖
eadd : ∀ (n : ℤ), e.comp (ContinuousMap.addRight ↑n) = e
⊢ Summable fun i =>
    ‖ContinuousMap.restrict (↑{ carrier := uIcc 0 1, isCompact' := ⋯ }) (e * f.comp (ContinuousMap.addRight ↑i))‖

Tactic:
convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1

Result:
case h.e'_5
f : C(ℝ, ℂ)
hf : ∀ (K : Compacts ℝ), Summable fun n => ‖ContinuousMap.restrict (↑K) (f.comp (ContinuousMap.addRight ↑n))‖
m : ℤ
e : C(ℝ, ℂ) := (fourier (-m)).comp { toFun := QuotientAddGroup.mk, continuous_toFun := ⋯ }
neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖ContinuousMap.restrict (↑K) (e * g)‖ = ‖ContinuousMap.restrict (↑K) g‖
eadd : ∀ (n : ℤ), e.comp (ContinuousMap.addRight ↑n) = e
⊢ (fun i =>
      ‖ContinuousMap.restrict (↑{ carrier := uIcc 0 1, isCompact' := ⋯ }) (e * f.comp (ContinuousMap.addRight ↑i))‖) =
    fun n => ‖ContinuousMap.restrict (↑{ carrier := uIcc 0 1, isCompact' := ⋯ }) (f.comp (ContinuousMap.addRight ↑n))‖

Proof state:
case hf
f : C(ℝ, ℂ)
hf : ∀ (K : Compacts ℝ), Summable fun n => ‖ContinuousMap.restrict (↑K) (f.comp (ContinuousMap.addRight ↑n))‖
m : ℤ
e : C(ℝ, ℂ) := (fourier (-m)).comp { toFun := QuotientAddGroup.mk, continuous_toFun := ⋯ }
neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖ContinuousMap.restrict (↑K) (e * g)‖ = ‖ContinuousMap.restrict (↑K) g‖
eadd : ∀ (n : ℤ), e.comp (ContinuousMap.addRight ↑n) = e
⊢ Summable fun n => ‖ContinuousMap.restrict (Icc 0 1) ((e * f).comp (ContinuousMap.addRight ↑n))‖

Tactic:
convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1

Result:
case h.e'_5
f : C(ℝ, ℂ)
hf : ∀ (K : Compacts ℝ), Summable fun n => ‖ContinuousMap.restrict (↑K) (f.comp (ContinuousMap.addRight ↑n))‖
m : ℤ
e : C(ℝ, ℂ) := (fourier (-m)).comp { toFun := QuotientAddGroup.mk, continuous_toFun := ⋯ }
neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖ContinuousMap.restrict (↑K) (e * g)‖ = ‖ContinuousMap.restrict (↑K) g‖
eadd : ∀ (n : ℤ), e.comp (ContinuousMap.addRight ↑n) = e
⊢ (fun n => ‖ContinuousMap.restrict (Icc 0 1) ((e * f).comp (ContinuousMap.addRight ↑n))‖) = fun n =>
    ‖ContinuousMap.restrict (↑{ carrier := Icc 0 1, isCompact' := ⋯ }) (f.comp (ContinuousMap.addRight ↑n))‖

Proof state:
case h
f : C(ℝ, ℂ)
hf : ∀ (K : Compacts ℝ), Summable fun n => ‖ContinuousMap.restrict (↑K) (f.comp (ContinuousMap.addRight ↑n))‖
m : ℤ
e : C(ℝ, ℂ) := (fourier (-m)).comp { toFun := QuotientAddGroup.mk, continuous_toFun := ⋯ }
neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖ContinuousMap.restrict (↑K) (e * g)‖ = ‖ContinuousMap.restrict (↑K) g‖
n : ℤ
x : ℝ
this : Periodic (⇑e) 1
⊢ (e.comp (ContinuousMap.addRight ↑n)) x = e x

Tactic:
simpa only [mul_one] using this.int_mul n x

Result:
no goals

Proof state:
f : C(ℝ, ℂ)
hf : ∀ (K : Compacts ℝ), Summable fun n => ‖ContinuousMap.restrict (↑K) (f.comp (ContinuousMap.addRight ↑n))‖
m : ℤ
e : C(ℝ, ℂ) := (fourier (-m)).comp { toFun := QuotientAddGroup.mk, continuous_toFun := ⋯ }
⊢ fourierCoeff ⋯.lift m = 𝓕 ⇑f ↑m

Tactic:
have neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖(e * g).restrict K‖ = ‖g.restrict K‖ := by
  have (x : ℝ) : ‖e x‖ = 1 := (AddCircle.toCircle (-m • x)).norm_coe
  intro K g
  simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul]

Result:
f : C(ℝ, ℂ)
hf : ∀ (K : Compacts ℝ), Summable fun n => ‖ContinuousMap.restrict (↑K) (f.comp (ContinuousMap.addRight ↑n))‖
m : ℤ
e : C(ℝ, ℂ) := (fourier (-m)).comp { toFun := QuotientAddGroup.mk, continuous_toFun := ⋯ }
neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖ContinuousMap.restrict (↑K) (e * g)‖ = ‖ContinuousMap.restrict (↑K) g‖
⊢ fourierCoeff ⋯.lift m = 𝓕 ⇑f ↑m

Proof state:
f : C(ℝ, ℂ)
hf : ∀ (K : Compacts ℝ), Summable fun n => ‖ContinuousMap.restrict (↑K) (f.comp (ContinuousMap.addRight ↑n))‖
m : ℤ
e : C(ℝ, ℂ) := (fourier (-m)).comp { toFun := QuotientAddGroup.mk, continuous_toFun := ⋯ }
neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖ContinuousMap.restrict (↑K) (e * g)‖ = ‖ContinuousMap.restrict (↑K) g‖
eadd : ∀ (n : ℤ), e.comp (ContinuousMap.addRight ↑n) = e
⊢ ∑' (n : ℤ), ∫ (x : ℝ) in 0 ..1, ((e * f).comp (ContinuousMap.addRight ↑n)) x = ∫ (x : ℝ), e x * f x

Tactic:
suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq

Result:
f : C(ℝ, ℂ)
hf : ∀ (K : Compacts ℝ), Summable fun n => ‖ContinuousMap.restrict (↑K) (f.comp (ContinuousMap.addRight ↑n))‖
m : ℤ
e : C(ℝ, ℂ) := (fourier (-m)).comp { toFun := QuotientAddGroup.mk, continuous_toFun := ⋯ }
neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖ContinuousMap.restrict (↑K) (e * g)‖ = ‖ContinuousMap.restrict (↑K) g‖
eadd : ∀ (n : ℤ), e.comp (ContinuousMap.addRight ↑n) = e
⊢ Integrable (⇑(e * f)) volume

Proof state:
case h.e'_5
f : C(ℝ, ℂ)
hf : ∀ (K : Compacts ℝ), Summable fun n => ‖ContinuousMap.restrict (↑K) (f.comp (ContinuousMap.addRight ↑n))‖
m : ℤ
e : C(ℝ, ℂ) := (fourier (-m)).comp { toFun := QuotientAddGroup.mk, continuous_toFun := ⋯ }
neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖ContinuousMap.restrict (↑K) (e * g)‖ = ‖ContinuousMap.restrict (↑K) g‖
eadd : ∀ (n : ℤ), e.comp (ContinuousMap.addRight ↑n) = e
⊢ (fun n => ‖ContinuousMap.restrict (Icc 0 1) ((e * f).comp (ContinuousMap.addRight ↑n))‖) = fun n =>
    ‖ContinuousMap.restrict (↑{ carrier := Icc 0 1, isCompact' := ⋯ }) (f.comp (ContinuousMap.addRight ↑n))‖

Tactic:
simp_rw [mul_comp] at eadd ⊢

Result:
case h.e'_5
f : C(ℝ, ℂ)
hf : ∀ (K : Compacts ℝ), Summable fun n => ‖ContinuousMap.restrict (↑K) (f.comp (ContinuousMap.addRight ↑n))‖
m : ℤ
e : C(ℝ, ℂ) := (fourier (-m)).comp { toFun := QuotientAddGroup.mk, continuous_toFun := ⋯ }
neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖ContinuousMap.restrict (↑K) (e * g)‖ = ‖ContinuousMap.restrict (↑K) g‖
eadd : ∀ (n : ℤ), e.comp (ContinuousMap.addRight ↑n) = e
⊢ (fun n =>
      ‖ContinuousMap.restrict (Icc 0 1) (e.comp (ContinuousMap.addRight ↑n) * f.comp (ContinuousMap.addRight ↑n))‖) =
    fun n => ‖ContinuousMap.restrict (↑{ carrier := Icc 0 1, isCompact' := ⋯ }) (f.comp (ContinuousMap.addRight ↑n))‖