l3lab/ntp-mathlib huggingface dataset:
/-- **Krull's intersection theorem** for noetherian domains. -/
theorem Ideal.iInf_pow_eq_bot_of_isDomain [IsNoetherianRing R] [IsDomain R] (h : I ≠ ⊤) :
    ⨅ i : ℕ, I ^ i = ⊥ := by
  rw [eq_bot_iff]
  intro x hx
  by_contra hx'
  have := Ideal.mem_iInf_smul_pow_eq_bot_iff I x
  simp_rw [smul_eq_mul, ← Ideal.one_eq_top, mul_one] at this
  obtain ⟨r, hr⟩ := this.mp hx
  have := mul_right_cancel₀ hx' (hr.trans (one_mul x).symm)
  

Proof state:
case intro
R M : Type u
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : Module R M
I : Ideal R
F F' : Filtration I M
inst✝¹ : IsNoetherianRing R
inst✝ : IsDomain R
h : I ≠ ⊤
x : R
hx : x ∈ ⨅ i, I ^ i
hx' : x ∉ ⊥
this✝ : x ∈ ⨅ i, I ^ i ↔ ∃ r, ↑r * x = x
r : ↥I
hr : ↑r * x = x
this : ↑r = 1
⊢ False

Next tactic:
exact I.eq_top_iff_one.not.mp h (this ▸ r.prop)
instance : StarOrderedRing ℚ :=
  StarOrderedRing.ofNonnegIff (fun {_ _} => add_le_add_left) fun x => by
    

Proof state:
x : ℚ
⊢ 0 ≤ x ↔ x ∈ AddSubmonoid.closure (Set.range fun s => star s * s)

Next tactic:
refine'
      ⟨fun hx => _, fun hx =>
        AddSubmonoid.closure_induction hx (by rintro - ⟨s, rfl⟩; exact mul_self_nonneg s) le_rfl
          fun _ _ => add_nonneg⟩
instance : StarOrderedRing ℚ :=
  StarOrderedRing.ofNonnegIff (fun {_ _} => add_le_add_left) fun x => by
    refine'
      ⟨fun hx => _, fun hx =>
        AddSubmonoid.closure_induction hx (by 

Proof state:
x : ℚ
hx : x ∈ AddSubmonoid.closure (Set.range fun s => star s * s)
⊢ ∀ x ∈ Set.range fun s => star s * s, 0 ≤ x

Next tactic:
rintro - ⟨s, rfl⟩
instance : StarOrderedRing ℚ :=
  StarOrderedRing.ofNonnegIff (fun {_ _} => add_le_add_left) fun x => by
    refine'
      ⟨fun hx => _, fun hx =>
        AddSubmonoid.closure_induction hx (by rintro - ⟨s, rfl⟩; 

Proof state:
case intro
x : ℚ
hx : x ∈ AddSubmonoid.closure (Set.range fun s => star s * s)
s : ℚ
⊢ 0 ≤ (fun s => star s * s) s

Next tactic:
exact mul_self_nonneg s
instance : StarOrderedRing ℚ :=
  StarOrderedRing.ofNonnegIff (fun {_ _} => add_le_add_left) fun x => by
    refine'
      ⟨fun hx => _, fun hx =>
        AddSubmonoid.closure_induction hx (by rintro - ⟨s, rfl⟩; exact mul_self_nonneg s) le_rfl
          fun _ _ => add_nonneg⟩
    /- If `x = p / q`, then, since `0 ≤ x`, we have `p q : ℕ`, and `p / q` is the sum of `p * q`
      copies of `(1 / q) ^ 2`, and so `x` lies in the `AddSubmonoid` generated by square elements.

      Note: it's possible to rephrase this argument as `x = (p * q) • (1 / q) ^ 2`, but this would
      be somewhat challenging without increasing import requirements. -/
    -- Porting note: rewrote proof to avoid removed constructor rat.mk_pnat
    

Proof state:
x : ℚ
hx : 0 ≤ x
⊢ x ∈ AddSubmonoid.closure (Set.range fun s => star s * s)

Next tactic:
suffices
      (Finset.range (x.num.natAbs * x.den)).sum
          (Function.const ℕ ((1 : ℚ) / x.den * ((1 : ℚ) / x.den))) =
        x
      by exact this ▸ sum_mem fun n _ => AddSubmonoid.subset_closure ⟨_, rfl⟩
instance : StarOrderedRing ℚ :=
  StarOrderedRing.ofNonnegIff (fun {_ _} => add_le_add_left) fun x => by
    refine'
      ⟨fun hx => _, fun hx =>
        AddSubmonoid.closure_induction hx (by rintro - ⟨s, rfl⟩; exact mul_self_nonneg s) le_rfl
          fun _ _ => add_nonneg⟩
    /- If `x = p / q`, then, since `0 ≤ x`, we have `p q : ℕ`, and `p / q` is the sum of `p * q`
      copies of `(1 / q) ^ 2`, and so `x` lies in the `AddSubmonoid` generated by square elements.

      Note: it's possible to rephrase this argument as `x = (p * q) • (1 / q) ^ 2`, but this would
      be somewhat challenging without increasing import requirements. -/
    -- Porting note: rewrote proof to avoid removed constructor rat.mk_pnat
    suffices
      (Finset.range (x.num.natAbs * x.den)).sum
          (Function.const ℕ ((1 : ℚ) / x.den * ((1 : ℚ) / x.den))) =
        x
      by 

Proof state:
x : ℚ
hx : 0 ≤ x
this : Finset.sum (Finset.range (Int.natAbs x.num * x.den)) (Function.const ℕ (1 / ↑x.den * (1 / ↑x.den))) = x
⊢ x ∈ AddSubmonoid.closure (Set.range fun s => star s * s)

Next tactic:
exact this ▸ sum_mem fun n _ => AddSubmonoid.subset_closure ⟨_, rfl⟩
instance : StarOrderedRing ℚ :=
  StarOrderedRing.ofNonnegIff (fun {_ _} => add_le_add_left) fun x => by
    refine'
      ⟨fun hx => _, fun hx =>
        AddSubmonoid.closure_induction hx (by rintro - ⟨s, rfl⟩; exact mul_self_nonneg s) le_rfl
          fun _ _ => add_nonneg⟩
    /- If `x = p / q`, then, since `0 ≤ x`, we have `p q : ℕ`, and `p / q` is the sum of `p * q`
      copies of `(1 / q) ^ 2`, and so `x` lies in the `AddSubmonoid` generated by square elements.

      Note: it's possible to rephrase this argument as `x = (p * q) • (1 / q) ^ 2`, but this would
      be somewhat challenging without increasing import requirements. -/
    -- Porting note: rewrote proof to avoid removed constructor rat.mk_pnat
    suffices
      (Finset.range (x.num.natAbs * x.den)).sum
          (Function.const ℕ ((1 : ℚ) / x.den * ((1 : ℚ) / x.den))) =
        x
      by exact this ▸ sum_mem fun n _ => AddSubmonoid.subset_closure ⟨_, rfl⟩
    

Proof state:
x : ℚ
hx : 0 ≤ x
⊢ Finset.sum (Finset.range (Int.natAbs x.num * x.den)) (Function.const ℕ (1 / ↑x.den * (1 / ↑x.den))) = x

Next tactic:
simp only [Function.const_apply, Finset.sum_const, Finset.card_range, nsmul_eq_mul]
instance : StarOrderedRing ℚ :=
  StarOrderedRing.ofNonnegIff (fun {_ _} => add_le_add_left) fun x => by
    refine'
      ⟨fun hx => _, fun hx =>
        AddSubmonoid.closure_induction hx (by rintro - ⟨s, rfl⟩; exact mul_self_nonneg s) le_rfl
          fun _ _ => add_nonneg⟩
    /- If `x = p / q`, then, since `0 ≤ x`, we have `p q : ℕ`, and `p / q` is the sum of `p * q`
      copies of `(1 / q) ^ 2`, and so `x` lies in the `AddSubmonoid` generated by square elements.

      Note: it's possible to rephrase this argument as `x = (p * q) • (1 / q) ^ 2`, but this would
      be somewhat challenging without increasing import requirements. -/
    -- Porting note: rewrote proof to avoid removed constructor rat.mk_pnat
    suffices
      (Finset.range (x.num.natAbs * x.den)).sum
          (Function.const ℕ ((1 : ℚ) / x.den * ((1 : ℚ) / x.den))) =
        x
      by exact this ▸ sum_mem fun n _ => AddSubmonoid.subset_closure ⟨_, rfl⟩
    simp only [Function.const_apply, Finset.sum_const, Finset.card_range, nsmul_eq_mul]
    

Proof state:
x : ℚ
hx : 0 ≤ x
⊢ ↑(Int.natAbs x.num * x.den) * (1 / ↑x.den * (1 / ↑x.den)) = x

Next tactic:
rw [← Int.cast_ofNat, Int.ofNat_mul, Int.coe_natAbs,
      abs_of_nonneg (num_nonneg_iff_zero_le.mpr hx), Int.cast_mul, Int.cast_ofNat]
instance : StarOrderedRing ℚ :=
  StarOrderedRing.ofNonnegIff (fun {_ _} => add_le_add_left) fun x => by
    refine'
      ⟨fun hx => _, fun hx =>
        AddSubmonoid.closure_induction hx (by rintro - ⟨s, rfl⟩; exact mul_self_nonneg s) le_rfl
          fun _ _ => add_nonneg⟩
    /- If `x = p / q`, then, since `0 ≤ x`, we have `p q : ℕ`, and `p / q` is the sum of `p * q`
      copies of `(1 / q) ^ 2`, and so `x` lies in the `AddSubmonoid` generated by square elements.

      Note: it's possible to rephrase this argument as `x = (p * q) • (1 / q) ^ 2`, but this would
      be somewhat challenging without increasing import requirements. -/
    -- Porting note: rewrote proof to avoid removed constructor rat.mk_pnat
    suffices
      (Finset.range (x.num.natAbs * x.den)).sum
          (Function.const ℕ ((1 : ℚ) / x.den * ((1 : ℚ) / x.den))) =
        x
      by exact this ▸ sum_mem fun n _ => AddSubmonoid.subset_closure ⟨_, rfl⟩
    simp only [Function.const_apply, Finset.sum_const, Finset.card_range, nsmul_eq_mul]
    rw [← Int.cast_ofNat, Int.ofNat_mul, Int.coe_natAbs,
      abs_of_nonneg (num_nonneg_iff_zero_le.mpr hx), Int.cast_mul, Int.cast_ofNat]
    

Proof state:
x : ℚ
hx : 0 ≤ x
⊢ ↑x.num * ↑x.den * (1 / ↑x.den * (1 / ↑x.den)) = x

Next tactic:
rw [← mul_assoc, mul_assoc (x.num : ℚ), mul_one_div_cancel (Nat.cast_ne_zero.mpr x.pos.ne'),
      mul_one, mul_one_div, Rat.num_div_den]
/-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function
`∑' n : ℤ, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/
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 := by
  -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc
  -- block, but I think it's more legible this way. We start with preliminaries about the integrand.
  

Proof state:
f : C(ℝ, ℂ)
hf :
  ∀ (K : Compacts ℝ), Summable fun n => ‖ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight ↑n))‖
m : ℤ
⊢ fourierCoeff (Periodic.lift (_ : Periodic (⇑(∑' (n : ℤ), ContinuousMap.comp f (ContinuousMap.addRight (n • 1)))) 1))
      m =
    𝓕 ⇑f ↑m

Next tactic:
let e : C(ℝ, ℂ) := (fourier (-m)).comp ⟨((↑) : ℝ → UnitAddCircle), continuous_quotient_mk'⟩
/-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function
`∑' n : ℤ, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/
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 := by
  -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc
  -- block, but I think it's more legible this way. We start with preliminaries about the integrand.
  let e : C(ℝ, ℂ) := (fourier (-m)).comp ⟨((↑) : ℝ → UnitAddCircle), continuous_quotient_mk'⟩
  

Proof state:
f : C(ℝ, ℂ)
hf :
  ∀ (K : Compacts ℝ), Summable fun n => ‖ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight ↑n))‖
m : ℤ
e : C(ℝ, ℂ) := ContinuousMap.comp (fourier (-m)) (ContinuousMap.mk QuotientAddGroup.mk)
⊢ fourierCoeff (Periodic.lift (_ : Periodic (⇑(∑' (n : ℤ), ContinuousMap.comp f (ContinuousMap.addRight (n • 1)))) 1))
      m =
    𝓕 ⇑f ↑m

Next tactic:
have neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖(e * g).restrict K‖ = ‖g.restrict K‖ := by
    have : ∀ x : ℝ, ‖e x‖ = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m • x))
    intro K g
    simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul]
/-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function
`∑' n : ℤ, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/
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 := by
  -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc
  -- block, but I think it's more legible this way. We start with preliminaries about the integrand.
  let e : C(ℝ, ℂ) := (fourier (-m)).comp ⟨((↑) : ℝ → UnitAddCircle), continuous_quotient_mk'⟩
  have neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖(e * g).restrict K‖ = ‖g.restrict K‖ := by
    

Proof state:
f : C(ℝ, ℂ)
hf :
  ∀ (K : Compacts ℝ), Summable fun n => ‖ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight ↑n))‖
m : ℤ
e : C(ℝ, ℂ) := ContinuousMap.comp (fourier (-m)) (ContinuousMap.mk QuotientAddGroup.mk)
⊢ ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖ContinuousMap.restrict (↑K) (e * g)‖ = ‖ContinuousMap.restrict (↑K) g‖

Next tactic:
have : ∀ x : ℝ, ‖e x‖ = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m • x))
/-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function
`∑' n : ℤ, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/
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 := by
  -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc
  -- block, but I think it's more legible this way. We start with preliminaries about the integrand.
  let e : C(ℝ, ℂ) := (fourier (-m)).comp ⟨((↑) : ℝ → UnitAddCircle), continuous_quotient_mk'⟩
  have neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖(e * g).restrict K‖ = ‖g.restrict K‖ := by
    have : ∀ x : ℝ, ‖e x‖ = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m • x))
    

Proof state:
f : C(ℝ, ℂ)
hf :
  ∀ (K : Compacts ℝ), Summable fun n => ‖ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight ↑n))‖
m : ℤ
e : C(ℝ, ℂ) := ContinuousMap.comp (fourier (-m)) (ContinuousMap.mk QuotientAddGroup.mk)
this : ∀ (x : ℝ), ‖e x‖ = 1
⊢ ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖ContinuousMap.restrict (↑K) (e * g)‖ = ‖ContinuousMap.restrict (↑K) g‖

Next tactic:
intro K g
/-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function
`∑' n : ℤ, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/
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 := by
  -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc
  -- block, but I think it's more legible this way. We start with preliminaries about the integrand.
  let e : C(ℝ, ℂ) := (fourier (-m)).comp ⟨((↑) : ℝ → UnitAddCircle), continuous_quotient_mk'⟩
  have neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖(e * g).restrict K‖ = ‖g.restrict K‖ := by
    have : ∀ x : ℝ, ‖e x‖ = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m • x))
    intro K g
    

Proof state:
f : C(ℝ, ℂ)
hf :
  ∀ (K : Compacts ℝ), Summable fun n => ‖ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight ↑n))‖
m : ℤ
e : C(ℝ, ℂ) := ContinuousMap.comp (fourier (-m)) (ContinuousMap.mk QuotientAddGroup.mk)
this : ∀ (x : ℝ), ‖e x‖ = 1
K : Compacts ℝ
g : C(ℝ, ℂ)
⊢ ‖ContinuousMap.restrict (↑K) (e * g)‖ = ‖ContinuousMap.restrict (↑K) g‖

Next tactic:
simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul]
/-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function
`∑' n : ℤ, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/
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 := by
  -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc
  -- block, but I think it's more legible this way. We start with preliminaries about the integrand.
  let e : C(ℝ, ℂ) := (fourier (-m)).comp ⟨((↑) : ℝ → UnitAddCircle), continuous_quotient_mk'⟩
  have neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖(e * g).restrict K‖ = ‖g.restrict K‖ := by
    have : ∀ x : ℝ, ‖e x‖ = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m • x))
    intro K g
    simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul]
  

Proof state:
f : C(ℝ, ℂ)
hf :
  ∀ (K : Compacts ℝ), Summable fun n => ‖ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight ↑n))‖
m : ℤ
e : C(ℝ, ℂ) := ContinuousMap.comp (fourier (-m)) (ContinuousMap.mk QuotientAddGroup.mk)
neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖ContinuousMap.restrict (↑K) (e * g)‖ = ‖ContinuousMap.restrict (↑K) g‖
⊢ fourierCoeff (Periodic.lift (_ : Periodic (⇑(∑' (n : ℤ), ContinuousMap.comp f (ContinuousMap.addRight (n • 1)))) 1))
      m =
    𝓕 ⇑f ↑m

Next tactic:
have eadd : ∀ (n : ℤ), e.comp (ContinuousMap.addRight n) = e := by
    intro n; ext1 x
    have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m))
    simpa only [mul_one] using this.int_mul n x
/-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function
`∑' n : ℤ, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/
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 := by
  -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc
  -- block, but I think it's more legible this way. We start with preliminaries about the integrand.
  let e : C(ℝ, ℂ) := (fourier (-m)).comp ⟨((↑) : ℝ → UnitAddCircle), continuous_quotient_mk'⟩
  have neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖(e * g).restrict K‖ = ‖g.restrict K‖ := by
    have : ∀ x : ℝ, ‖e x‖ = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m • x))
    intro K g
    simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul]
  have eadd : ∀ (n : ℤ), e.comp (ContinuousMap.addRight n) = e := by
    

Proof state:
f : C(ℝ, ℂ)
hf :
  ∀ (K : Compacts ℝ), Summable fun n => ‖ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight ↑n))‖
m : ℤ
e : C(ℝ, ℂ) := ContinuousMap.comp (fourier (-m)) (ContinuousMap.mk QuotientAddGroup.mk)
neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖ContinuousMap.restrict (↑K) (e * g)‖ = ‖ContinuousMap.restrict (↑K) g‖
⊢ ∀ (n : ℤ), ContinuousMap.comp e (ContinuousMap.addRight ↑n) = e

Next tactic:
intro n
/-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function
`∑' n : ℤ, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/
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 := by
  -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc
  -- block, but I think it's more legible this way. We start with preliminaries about the integrand.
  let e : C(ℝ, ℂ) := (fourier (-m)).comp ⟨((↑) : ℝ → UnitAddCircle), continuous_quotient_mk'⟩
  have neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖(e * g).restrict K‖ = ‖g.restrict K‖ := by
    have : ∀ x : ℝ, ‖e x‖ = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m • x))
    intro K g
    simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul]
  have eadd : ∀ (n : ℤ), e.comp (ContinuousMap.addRight n) = e := by
    intro n; 

Proof state:
f : C(ℝ, ℂ)
hf :
  ∀ (K : Compacts ℝ), Summable fun n => ‖ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight ↑n))‖
m : ℤ
e : C(ℝ, ℂ) := ContinuousMap.comp (fourier (-m)) (ContinuousMap.mk QuotientAddGroup.mk)
neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖ContinuousMap.restrict (↑K) (e * g)‖ = ‖ContinuousMap.restrict (↑K) g‖
n : ℤ
⊢ ContinuousMap.comp e (ContinuousMap.addRight ↑n) = e

Next tactic:
ext1 x
/-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function
`∑' n : ℤ, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/
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 := by
  -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc
  -- block, but I think it's more legible this way. We start with preliminaries about the integrand.
  let e : C(ℝ, ℂ) := (fourier (-m)).comp ⟨((↑) : ℝ → UnitAddCircle), continuous_quotient_mk'⟩
  have neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖(e * g).restrict K‖ = ‖g.restrict K‖ := by
    have : ∀ x : ℝ, ‖e x‖ = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m • x))
    intro K g
    simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul]
  have eadd : ∀ (n : ℤ), e.comp (ContinuousMap.addRight n) = e := by
    intro n; ext1 x
    

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

Next tactic:
have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m))
/-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function
`∑' n : ℤ, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/
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 := by
  -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc
  -- block, but I think it's more legible this way. We start with preliminaries about the integrand.
  let e : C(ℝ, ℂ) := (fourier (-m)).comp ⟨((↑) : ℝ → UnitAddCircle), continuous_quotient_mk'⟩
  have neK : ∀ (K : Compacts ℝ) (g : C(ℝ, ℂ)), ‖(e * g).restrict K‖ = ‖g.restrict K‖ := by
    have : ∀ x : ℝ, ‖e x‖ = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m • x))
    intro K g
    simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul]
  have eadd : ∀ (n : ℤ), e.comp (ContinuousMap.addRight n) = e := by
    intro n; ext1 x
    have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m))
    

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

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