l3lab/ntp-mathlib huggingface dataset:
theorem cancel_factors_eq {α} [Field α] {a b ad bd a' b' gcd : α} (ha : ad * a = a')
    (hb : bd * b = b') (had : ad ≠ 0) (hbd : bd ≠ 0) (hgcd : gcd ≠ 0) :
    (a = b) = (1 / gcd * (bd * a') = 1 / gcd * (ad * b')) := by
  rw [← ha, ← hb, ← mul_assoc bd, ← mul_assoc ad, mul_comm bd]
  ext; constructor
  · rintro rfl
    rfl
  · intro h
    simp only [← mul_assoc] at h
    refine' mul_left_cancel₀ (mul_ne_zero _ _) h
    apply mul_ne_zero
    apply div_ne_zero
    exact one_ne_zero
    all_goals 

Proof state:
case a.mpr.refine'_2
α : Type u_1
inst✝ : Field α
a b ad bd a' b' gcd : α
ha : ad * a = a'
hb : bd * b = b'
had : ad ≠ 0
hbd : bd ≠ 0
hgcd : gcd ≠ 0
h : 1 / gcd * ad * bd * a = 1 / gcd * ad * bd * b
⊢ bd ≠ 0

Next tactic:
assumption
theorem cancel_factors_ne {α} [Field α] {a b ad bd a' b' gcd : α} (ha : ad * a = a')
    (hb : bd * b = b') (had : ad ≠ 0) (hbd : bd ≠ 0) (hgcd : gcd ≠ 0) :
    (a ≠ b) = (1 / gcd * (bd * a') ≠ 1 / gcd * (ad * b')) := by
  

Proof state:
α : Type u_1
inst✝ : Field α
a b ad bd a' b' gcd : α
ha : ad * a = a'
hb : bd * b = b'
had : ad ≠ 0
hbd : bd ≠ 0
hgcd : gcd ≠ 0
⊢ (a ≠ b) = (1 / gcd * (bd * a') ≠ 1 / gcd * (ad * b'))

Next tactic:
classical
  rw [eq_iff_iff, not_iff_not, cancel_factors_eq ha hb had hbd hgcd]
theorem cancel_factors_ne {α} [Field α] {a b ad bd a' b' gcd : α} (ha : ad * a = a')
    (hb : bd * b = b') (had : ad ≠ 0) (hbd : bd ≠ 0) (hgcd : gcd ≠ 0) :
    (a ≠ b) = (1 / gcd * (bd * a') ≠ 1 / gcd * (ad * b')) := by
  classical
  

Proof state:
α : Type u_1
inst✝ : Field α
a b ad bd a' b' gcd : α
ha : ad * a = a'
hb : bd * b = b'
had : ad ≠ 0
hbd : bd ≠ 0
hgcd : gcd ≠ 0
⊢ (a ≠ b) = (1 / gcd * (bd * a') ≠ 1 / gcd * (ad * b'))

Next tactic:
rw [eq_iff_iff, not_iff_not, cancel_factors_eq ha hb had hbd hgcd]
lemma iff {X Y : C} (f : X ⟶ Y) (a : A) : W (f⟦a⟧') ↔ W f := by
  

Proof state:
C : Type u₁
D : Type u₂
inst✝⁵ : Category.{v₁, u₁} C
inst✝⁴ : Category.{v₂, u₂} D
L : C ⥤ D
W : MorphismProperty C
inst✝³ : Functor.IsLocalization L W
A : Type w
inst✝² : AddMonoid A
inst✝¹ : HasShift C A
inst✝ : IsCompatibleWithShift W A
X Y : C
f : X ⟶ Y
a : A
⊢ W ((shiftFunctor C a).map f) ↔ W f

Next tactic:
conv_rhs => rw [← @IsCompatibleWithShift.condition _ _ W A _ _ _ a]
lemma iff {X Y : C} (f : X ⟶ Y) (a : A) : W (f⟦a⟧') ↔ W f := by
  conv_rhs => 

Proof state:
C : Type u₁
D : Type u₂
inst✝⁵ : Category.{v₁, u₁} C
inst✝⁴ : Category.{v₂, u₂} D
L : C ⥤ D
W : MorphismProperty C
inst✝³ : Functor.IsLocalization L W
A : Type w
inst✝² : AddMonoid A
inst✝¹ : HasShift C A
inst✝ : IsCompatibleWithShift W A
X Y : C
f : X ⟶ Y
a : A
| W f

Next tactic:
rw [← @IsCompatibleWithShift.condition _ _ W A _ _ _ a]
lemma shiftFunctor_comp_inverts (a : A) :
    W.IsInvertedBy (shiftFunctor C a ⋙ L) := fun _ _ f hf =>
  Localization.inverts L W _ (by 

Proof state:
C : Type u₁
D : Type u₂
inst✝⁵ : Category.{v₁, u₁} C
inst✝⁴ : Category.{v₂, u₂} D
L : C ⥤ D
W : MorphismProperty C
inst✝³ : Functor.IsLocalization L W
A : Type w
inst✝² : AddMonoid A
inst✝¹ : HasShift C A
inst✝ : IsCompatibleWithShift W A
a : A
x✝¹ x✝ : C
f : x✝¹ ⟶ x✝
hf : W f
⊢ W ((shiftFunctor C a).map f)

Next tactic:
simpa only [iff] using hf
theorem scaled_exp_map_periodic : Function.Periodic (fun x => expMapCircle (2 * π / T * x)) T := by
  -- The case T = 0 is not interesting, but it is true, so we prove it to save hypotheses
  

Proof state:
T : ℝ
⊢ Function.Periodic (fun x => expMapCircle (2 * π / T * x)) T

Next tactic:
rcases eq_or_ne T 0 with (rfl | hT)
theorem scaled_exp_map_periodic : Function.Periodic (fun x => expMapCircle (2 * π / T * x)) T := by
  -- The case T = 0 is not interesting, but it is true, so we prove it to save hypotheses
  rcases eq_or_ne T 0 with (rfl | hT)
  · 

Proof state:
case inl
⊢ Function.Periodic (fun x => expMapCircle (2 * π / 0 * x)) 0

Next tactic:
intro x
theorem scaled_exp_map_periodic : Function.Periodic (fun x => expMapCircle (2 * π / T * x)) T := by
  -- The case T = 0 is not interesting, but it is true, so we prove it to save hypotheses
  rcases eq_or_ne T 0 with (rfl | hT)
  · intro x; 

Proof state:
case inl
x : ℝ
⊢ (fun x => expMapCircle (2 * π / 0 * x)) (x + 0) = (fun x => expMapCircle (2 * π / 0 * x)) x

Next tactic:
simp
theorem scaled_exp_map_periodic : Function.Periodic (fun x => expMapCircle (2 * π / T * x)) T := by
  -- The case T = 0 is not interesting, but it is true, so we prove it to save hypotheses
  rcases eq_or_ne T 0 with (rfl | hT)
  · intro x; simp
  · 

Proof state:
case inr
T : ℝ
hT : T ≠ 0
⊢ Function.Periodic (fun x => expMapCircle (2 * π / T * x)) T

Next tactic:
intro x
theorem scaled_exp_map_periodic : Function.Periodic (fun x => expMapCircle (2 * π / T * x)) T := by
  -- The case T = 0 is not interesting, but it is true, so we prove it to save hypotheses
  rcases eq_or_ne T 0 with (rfl | hT)
  · intro x; simp
  · intro x; 

Proof state:
case inr
T : ℝ
hT : T ≠ 0
x : ℝ
⊢ (fun x => expMapCircle (2 * π / T * x)) (x + T) = (fun x => expMapCircle (2 * π / T * x)) x

Next tactic:
simp_rw [mul_add]
theorem scaled_exp_map_periodic : Function.Periodic (fun x => expMapCircle (2 * π / T * x)) T := by
  -- The case T = 0 is not interesting, but it is true, so we prove it to save hypotheses
  rcases eq_or_ne T 0 with (rfl | hT)
  · intro x; simp
  · intro x; simp_rw [mul_add]; 

Proof state:
case inr
T : ℝ
hT : T ≠ 0
x : ℝ
⊢ expMapCircle (2 * π / T * x + 2 * π / T * T) = expMapCircle (2 * π / T * x)

Next tactic:
rw [div_mul_cancel _ hT, periodic_expMapCircle]
theorem toCircle_add (x : AddCircle T) (y : AddCircle T) :
    @toCircle T (x + y) = toCircle x * toCircle y := by
  

Proof state:
T : ℝ
x y : AddCircle T
⊢ toCircle (x + y) = toCircle x * toCircle y

Next tactic:
induction x using QuotientAddGroup.induction_on'
theorem toCircle_add (x : AddCircle T) (y : AddCircle T) :
    @toCircle T (x + y) = toCircle x * toCircle y := by
  induction x using QuotientAddGroup.induction_on'
  

Proof state:
case H
T : ℝ
y : AddCircle T
z✝ : ℝ
⊢ toCircle (↑z✝ + y) = toCircle ↑z✝ * toCircle y

Next tactic:
induction y using QuotientAddGroup.induction_on'
theorem toCircle_add (x : AddCircle T) (y : AddCircle T) :
    @toCircle T (x + y) = toCircle x * toCircle y := by
  induction x using QuotientAddGroup.induction_on'
  induction y using QuotientAddGroup.induction_on'
  

Proof state:
case H.H
T z✝¹ z✝ : ℝ
⊢ toCircle (↑z✝¹ + ↑z✝) = toCircle ↑z✝¹ * toCircle ↑z✝

Next tactic:
rw [← QuotientAddGroup.mk_add]
theorem toCircle_add (x : AddCircle T) (y : AddCircle T) :
    @toCircle T (x + y) = toCircle x * toCircle y := by
  induction x using QuotientAddGroup.induction_on'
  induction y using QuotientAddGroup.induction_on'
  rw [← QuotientAddGroup.mk_add]
  

Proof state:
case H.H
T z✝¹ z✝ : ℝ
⊢ toCircle ↑(z✝¹ + z✝) = toCircle ↑z✝¹ * toCircle ↑z✝

Next tactic:
simp_rw [toCircle, Function.Periodic.lift_coe, mul_add, expMapCircle_add]
theorem injective_toCircle (hT : T ≠ 0) : Function.Injective (@toCircle T) := by
  

Proof state:
T : ℝ
hT : T ≠ 0
⊢ Function.Injective toCircle

Next tactic:
intro a b h
theorem injective_toCircle (hT : T ≠ 0) : Function.Injective (@toCircle T) := by
  intro a b h
  

Proof state:
T : ℝ
hT : T ≠ 0
a b : AddCircle T
h : toCircle a = toCircle b
⊢ a = b

Next tactic:
induction a using QuotientAddGroup.induction_on'
theorem injective_toCircle (hT : T ≠ 0) : Function.Injective (@toCircle T) := by
  intro a b h
  induction a using QuotientAddGroup.induction_on'
  

Proof state:
case H
T : ℝ
hT : T ≠ 0
b : AddCircle T
z✝ : ℝ
h : toCircle ↑z✝ = toCircle b
⊢ ↑z✝ = b

Next tactic:
induction b using QuotientAddGroup.induction_on'
theorem injective_toCircle (hT : T ≠ 0) : Function.Injective (@toCircle T) := by
  intro a b h
  induction a using QuotientAddGroup.induction_on'
  induction b using QuotientAddGroup.induction_on'
  

Proof state:
case H.H
T : ℝ
hT : T ≠ 0
z✝¹ z✝ : ℝ
h : toCircle ↑z✝¹ = toCircle ↑z✝
⊢ ↑z✝¹ = ↑z✝

Next tactic:
simp_rw [toCircle, Function.Periodic.lift_coe] at h
theorem injective_toCircle (hT : T ≠ 0) : Function.Injective (@toCircle T) := by
  intro a b h
  induction a using QuotientAddGroup.induction_on'
  induction b using QuotientAddGroup.induction_on'
  simp_rw [toCircle, Function.Periodic.lift_coe] at h
  

Proof state:
case H.H
T : ℝ
hT : T ≠ 0
z✝¹ z✝ : ℝ
h : expMapCircle (2 * π / T * z✝¹) = expMapCircle (2 * π / T * z✝)
⊢ ↑z✝¹ = ↑z✝

Next tactic:
obtain ⟨m, hm⟩ := expMapCircle_eq_expMapCircle.mp h.symm
theorem injective_toCircle (hT : T ≠ 0) : Function.Injective (@toCircle T) := by
  intro a b h
  induction a using QuotientAddGroup.induction_on'
  induction b using QuotientAddGroup.induction_on'
  simp_rw [toCircle, Function.Periodic.lift_coe] at h
  obtain ⟨m, hm⟩ := expMapCircle_eq_expMapCircle.mp h.symm
  

Proof state:
case H.H.intro
T : ℝ
hT : T ≠ 0
z✝¹ z✝ : ℝ
h : expMapCircle (2 * π / T * z✝¹) = expMapCircle (2 * π / T * z✝)
m : ℤ
hm : 2 * π / T * z✝ = 2 * π / T * z✝¹ + ↑m * (2 * π)
⊢ ↑z✝¹ = ↑z✝

Next tactic:
rw [QuotientAddGroup.eq]
theorem injective_toCircle (hT : T ≠ 0) : Function.Injective (@toCircle T) := by
  intro a b h
  induction a using QuotientAddGroup.induction_on'
  induction b using QuotientAddGroup.induction_on'
  simp_rw [toCircle, Function.Periodic.lift_coe] at h
  obtain ⟨m, hm⟩ := expMapCircle_eq_expMapCircle.mp h.symm
  rw [QuotientAddGroup.eq]; 

Proof state:
case H.H.intro
T : ℝ
hT : T ≠ 0
z✝¹ z✝ : ℝ
h : expMapCircle (2 * π / T * z✝¹) = expMapCircle (2 * π / T * z✝)
m : ℤ
hm : 2 * π / T * z✝ = 2 * π / T * z✝¹ + ↑m * (2 * π)
⊢ -z✝¹ + z✝ ∈ AddSubgroup.zmultiples T

Next tactic:
simp_rw [AddSubgroup.mem_zmultiples_iff, zsmul_eq_mul]
theorem injective_toCircle (hT : T ≠ 0) : Function.Injective (@toCircle T) := by
  intro a b h
  induction a using QuotientAddGroup.induction_on'
  induction b using QuotientAddGroup.induction_on'
  simp_rw [toCircle, Function.Periodic.lift_coe] at h
  obtain ⟨m, hm⟩ := expMapCircle_eq_expMapCircle.mp h.symm
  rw [QuotientAddGroup.eq]; simp_rw [AddSubgroup.mem_zmultiples_iff, zsmul_eq_mul]
  

Proof state:
case H.H.intro
T : ℝ
hT : T ≠ 0
z✝¹ z✝ : ℝ
h : expMapCircle (2 * π / T * z✝¹) = expMapCircle (2 * π / T * z✝)
m : ℤ
hm : 2 * π / T * z✝ = 2 * π / T * z✝¹ + ↑m * (2 * π)
⊢ ∃ k, ↑k * T = -z✝¹ + z✝

Next tactic:
use m
theorem injective_toCircle (hT : T ≠ 0) : Function.Injective (@toCircle T) := by
  intro a b h
  induction a using QuotientAddGroup.induction_on'
  induction b using QuotientAddGroup.induction_on'
  simp_rw [toCircle, Function.Periodic.lift_coe] at h
  obtain ⟨m, hm⟩ := expMapCircle_eq_expMapCircle.mp h.symm
  rw [QuotientAddGroup.eq]; simp_rw [AddSubgroup.mem_zmultiples_iff, zsmul_eq_mul]
  use m
  

Proof state:
case h
T : ℝ
hT : T ≠ 0
z✝¹ z✝ : ℝ
h : expMapCircle (2 * π / T * z✝¹) = expMapCircle (2 * π / T * z✝)
m : ℤ
hm : 2 * π / T * z✝ = 2 * π / T * z✝¹ + ↑m * (2 * π)
⊢ ↑m * T = -z✝¹ + z✝

Next tactic:
field_simp at hm
theorem injective_toCircle (hT : T ≠ 0) : Function.Injective (@toCircle T) := by
  intro a b h
  induction a using QuotientAddGroup.induction_on'
  induction b using QuotientAddGroup.induction_on'
  simp_rw [toCircle, Function.Periodic.lift_coe] at h
  obtain ⟨m, hm⟩ := expMapCircle_eq_expMapCircle.mp h.symm
  rw [QuotientAddGroup.eq]; simp_rw [AddSubgroup.mem_zmultiples_iff, zsmul_eq_mul]
  use m
  field_simp at hm
  

Proof state:
case h
T : ℝ
hT : T ≠ 0
z✝¹ z✝ : ℝ
h : expMapCircle (2 * π / T * z✝¹) = expMapCircle (2 * π / T * z✝)
m : ℤ
hm : 2 * π * z✝ = 2 * π * z✝¹ + ↑m * (2 * π) * T
⊢ ↑m * T = -z✝¹ + z✝

Next tactic:
rw [← mul_right_inj' Real.two_pi_pos.ne']
theorem injective_toCircle (hT : T ≠ 0) : Function.Injective (@toCircle T) := by
  intro a b h
  induction a using QuotientAddGroup.induction_on'
  induction b using QuotientAddGroup.induction_on'
  simp_rw [toCircle, Function.Periodic.lift_coe] at h
  obtain ⟨m, hm⟩ := expMapCircle_eq_expMapCircle.mp h.symm
  rw [QuotientAddGroup.eq]; simp_rw [AddSubgroup.mem_zmultiples_iff, zsmul_eq_mul]
  use m
  field_simp at hm
  rw [← mul_right_inj' Real.two_pi_pos.ne']
  

Proof state:
case h
T : ℝ
hT : T ≠ 0
z✝¹ z✝ : ℝ
h : expMapCircle (2 * π / T * z✝¹) = expMapCircle (2 * π / T * z✝)
m : ℤ
hm : 2 * π * z✝ = 2 * π * z✝¹ + ↑m * (2 * π) * T
⊢ 2 * π * (↑m * T) = 2 * π * (-z✝¹ + z✝)

Next tactic:
linarith
theorem fourier_coe_apply {n : ℤ} {x : ℝ} :
    fourier n (x : AddCircle T) = Complex.exp (2 * π * Complex.I * n * x / T) := by
  

Proof state:
T : ℝ
n : ℤ
x : ℝ
⊢ (fourier n) ↑x = Complex.exp (2 * ↑π * Complex.I * ↑n * ↑x / ↑T)

Next tactic:
rw [fourier_apply, ← QuotientAddGroup.mk_zsmul, toCircle, Function.Periodic.lift_coe,
    expMapCircle_apply, Complex.ofReal_mul, Complex.ofReal_div, Complex.ofReal_mul, zsmul_eq_mul,
    Complex.ofReal_mul, Complex.ofReal_int_cast]
theorem fourier_coe_apply {n : ℤ} {x : ℝ} :
    fourier n (x : AddCircle T) = Complex.exp (2 * π * Complex.I * n * x / T) := by
  rw [fourier_apply, ← QuotientAddGroup.mk_zsmul, toCircle, Function.Periodic.lift_coe,
    expMapCircle_apply, Complex.ofReal_mul, Complex.ofReal_div, Complex.ofReal_mul, zsmul_eq_mul,
    Complex.ofReal_mul, Complex.ofReal_int_cast]
  

Proof state:
T : ℝ
n : ℤ
x : ℝ
⊢ Complex.exp (↑2 * ↑π / ↑T * (↑n * ↑x) * Complex.I) = Complex.exp (2 * ↑π * Complex.I * ↑n * ↑x / ↑T)

Next tactic:
norm_num
theorem fourier_coe_apply {n : ℤ} {x : ℝ} :
    fourier n (x : AddCircle T) = Complex.exp (2 * π * Complex.I * n * x / T) := by
  rw [fourier_apply, ← QuotientAddGroup.mk_zsmul, toCircle, Function.Periodic.lift_coe,
    expMapCircle_apply, Complex.ofReal_mul, Complex.ofReal_div, Complex.ofReal_mul, zsmul_eq_mul,
    Complex.ofReal_mul, Complex.ofReal_int_cast]
  norm_num
  

Proof state:
T : ℝ
n : ℤ
x : ℝ
⊢ Complex.exp (2 * ↑π / ↑T * (↑n * ↑x) * Complex.I) = Complex.exp (2 * ↑π * Complex.I * ↑n * ↑x / ↑T)

Next tactic:
congr 1
theorem fourier_coe_apply {n : ℤ} {x : ℝ} :
    fourier n (x : AddCircle T) = Complex.exp (2 * π * Complex.I * n * x / T) := by
  rw [fourier_apply, ← QuotientAddGroup.mk_zsmul, toCircle, Function.Periodic.lift_coe,
    expMapCircle_apply, Complex.ofReal_mul, Complex.ofReal_div, Complex.ofReal_mul, zsmul_eq_mul,
    Complex.ofReal_mul, Complex.ofReal_int_cast]
  norm_num
  congr 1; 

Proof state:
case e_z
T : ℝ
n : ℤ
x : ℝ
⊢ 2 * ↑π / ↑T * (↑n * ↑x) * Complex.I = 2 * ↑π * Complex.I * ↑n * ↑x / ↑T

Next tactic:
ring
@[simp]
theorem fourier_coe_apply' {n : ℤ} {x : ℝ} :
    toCircle (n • (x : AddCircle T) :) = Complex.exp (2 * π * Complex.I * n * x / T) := by
  

Proof state:
T : ℝ
n : ℤ
x : ℝ
⊢ ↑(toCircle (n • ↑x)) = Complex.exp (2 * ↑π * Complex.I * ↑n * ↑x / ↑T)

Next tactic:
rw [← fourier_apply]
@[simp]
theorem fourier_coe_apply' {n : ℤ} {x : ℝ} :
    toCircle (n • (x : AddCircle T) :) = Complex.exp (2 * π * Complex.I * n * x / T) := by
  rw [← fourier_apply]; 

Proof state:
T : ℝ
n : ℤ
x : ℝ
⊢ (fourier n) ↑x = Complex.exp (2 * ↑π * Complex.I * ↑n * ↑x / ↑T)

Next tactic:
exact fourier_coe_apply
theorem fourier_zero {x : AddCircle T} : fourier 0 x = 1 := by
  

Proof state:
T : ℝ
x : AddCircle T
⊢ (fourier 0) x = 1

Next tactic:
induction x using QuotientAddGroup.induction_on'
theorem fourier_zero {x : AddCircle T} : fourier 0 x = 1 := by
  induction x using QuotientAddGroup.induction_on'
  

Proof state:
case H
T z✝ : ℝ
⊢ (fourier 0) ↑z✝ = 1

Next tactic:
simp only [fourier_coe_apply]
theorem fourier_zero {x : AddCircle T} : fourier 0 x = 1 := by
  induction x using QuotientAddGroup.induction_on'
  simp only [fourier_coe_apply]
  

Proof state:
case H
T z✝ : ℝ
⊢ Complex.exp (2 * ↑π * Complex.I * ↑0 * ↑z✝ / ↑T) = 1

Next tactic:
norm_num
@[simp]
theorem fourier_zero' {x : AddCircle T} : @toCircle T 0 = (1 : ℂ) := by
  

Proof state:
T : ℝ
x : AddCircle T
⊢ ↑(toCircle 0) = 1

Next tactic:
have : fourier 0 x = @toCircle T 0 := by rw [fourier_apply, zero_smul]
@[simp]
theorem fourier_zero' {x : AddCircle T} : @toCircle T 0 = (1 : ℂ) := by
  have : fourier 0 x = @toCircle T 0 := by 

Proof state:
T : ℝ
x : AddCircle T
⊢ (fourier 0) x = ↑(toCircle 0)

Next tactic:
rw [fourier_apply, zero_smul]
@[simp]
theorem fourier_zero' {x : AddCircle T} : @toCircle T 0 = (1 : ℂ) := by
  have : fourier 0 x = @toCircle T 0 := by rw [fourier_apply, zero_smul]
  

Proof state:
T : ℝ
x : AddCircle T
this : (fourier 0) x = ↑(toCircle 0)
⊢ ↑(toCircle 0) = 1

Next tactic:
rw [← this]
@[simp]
theorem fourier_zero' {x : AddCircle T} : @toCircle T 0 = (1 : ℂ) := by
  have : fourier 0 x = @toCircle T 0 := by rw [fourier_apply, zero_smul]
  rw [← this]; 

Proof state:
T : ℝ
x : AddCircle T
this : (fourier 0) x = ↑(toCircle 0)
⊢ (fourier 0) x = 1

Next tactic:
exact fourier_zero
theorem fourier_eval_zero (n : ℤ) : fourier n (0 : AddCircle T) = 1 := by
  

Proof state:
T : ℝ
n : ℤ
⊢ (fourier n) 0 = 1

Next tactic:
rw [← QuotientAddGroup.mk_zero, fourier_coe_apply, Complex.ofReal_zero, mul_zero,
    zero_div, Complex.exp_zero]
theorem fourier_one {x : AddCircle T} : fourier 1 x = toCircle x := by 

Proof state:
T : ℝ
x : AddCircle T
⊢ (fourier 1) x = ↑(toCircle x)

Next tactic:
rw [fourier_apply, one_zsmul]
theorem fourier_neg {n : ℤ} {x : AddCircle T} : fourier (-n) x = conj (fourier n x) := by
  

Proof state:
T : ℝ
n : ℤ
x : AddCircle T
⊢ (fourier (-n)) x = (starRingEnd ℂ) ((fourier n) x)

Next tactic:
induction x using QuotientAddGroup.induction_on'
theorem fourier_neg {n : ℤ} {x : AddCircle T} : fourier (-n) x = conj (fourier n x) := by
  induction x using QuotientAddGroup.induction_on'
  

Proof state:
case H
T : ℝ
n : ℤ
z✝ : ℝ
⊢ (fourier (-n)) ↑z✝ = (starRingEnd ℂ) ((fourier n) ↑z✝)

Next tactic:
simp_rw [fourier_apply, toCircle]
theorem fourier_neg {n : ℤ} {x : AddCircle T} : fourier (-n) x = conj (fourier n x) := by
  induction x using QuotientAddGroup.induction_on'
  simp_rw [fourier_apply, toCircle]
  

Proof state:
case H
T : ℝ
n : ℤ
z✝ : ℝ
⊢ ↑(Function.Periodic.lift (_ : Function.Periodic (fun x => expMapCircle (2 * π / T * x)) T) (-n • ↑z✝)) =
    (starRingEnd ℂ)
      ↑(Function.Periodic.lift (_ : Function.Periodic (fun x => expMapCircle (2 * π / T * x)) T) (n • ↑z✝))

Next tactic:
rw [← QuotientAddGroup.mk_zsmul, ← QuotientAddGroup.mk_zsmul]
theorem fourier_neg {n : ℤ} {x : AddCircle T} : fourier (-n) x = conj (fourier n x) := by
  induction x using QuotientAddGroup.induction_on'
  simp_rw [fourier_apply, toCircle]
  rw [← QuotientAddGroup.mk_zsmul, ← QuotientAddGroup.mk_zsmul]
  

Proof state:
case H
T : ℝ
n : ℤ
z✝ : ℝ
⊢ ↑(Function.Periodic.lift (_ : Function.Periodic (fun x => expMapCircle (2 * π / T * x)) T) ↑(-n • z✝)) =
    (starRingEnd ℂ)
      ↑(Function.Periodic.lift (_ : Function.Periodic (fun x => expMapCircle (2 * π / T * x)) T) ↑(n • z✝))

Next tactic:
simp_rw [Function.Periodic.lift_coe, ← coe_inv_circle_eq_conj, ← expMapCircle_neg,
    neg_smul, mul_neg]
@[simp]
theorem fourier_neg' {n : ℤ} {x : AddCircle T} : @toCircle T (-(n • x)) = conj (fourier n x) := by
  

Proof state:
T : ℝ
n : ℤ
x : AddCircle T
⊢ ↑(toCircle (-(n • x))) = (starRingEnd ℂ) ((fourier n) x)

Next tactic:
rw [← neg_smul, ← fourier_apply]
@[simp]
theorem fourier_neg' {n : ℤ} {x : AddCircle T} : @toCircle T (-(n • x)) = conj (fourier n x) := by
  rw [← neg_smul, ← fourier_apply]; 

Proof state:
T : ℝ
n : ℤ
x : AddCircle T
⊢ (fourier (-n)) x = (starRingEnd ℂ) ((fourier n) x)

Next tactic:
exact fourier_neg
theorem fourier_add {m n : ℤ} {x : AddCircle T} : fourier (m+n) x = fourier m x * fourier n x := by
  

Proof state:
T : ℝ
m n : ℤ
x : AddCircle T
⊢ (fourier (m + n)) x = (fourier m) x * (fourier n) x

Next tactic:
simp_rw [fourier_apply, add_zsmul, toCircle_add, coe_mul_unitSphere]
@[simp]
theorem fourier_add' {m n : ℤ} {x : AddCircle T} :
    toCircle ((m + n) • x :) = fourier m x * fourier n x := by
  

Proof state:
T : ℝ
m n : ℤ
x : AddCircle T
⊢ ↑(toCircle ((m + n) • x)) = (fourier m) x * (fourier n) x

Next tactic:
rw [← fourier_apply]
@[simp]
theorem fourier_add' {m n : ℤ} {x : AddCircle T} :
    toCircle ((m + n) • x :) = fourier m x * fourier n x := by
  rw [← fourier_apply]; 

Proof state:
T : ℝ
m n : ℤ
x : AddCircle T
⊢ (fourier (m + n)) x = (fourier m) x * (fourier n) x

Next tactic:
exact fourier_add
theorem fourier_norm [Fact (0 < T)] (n : ℤ) : ‖@fourier T n‖ = 1 := by
  

Proof state:
T : ℝ
inst✝ : Fact (0 < T)
n : ℤ
⊢ ‖fourier n‖ = 1

Next tactic:
rw [ContinuousMap.norm_eq_iSup_norm]
theorem fourier_norm [Fact (0 < T)] (n : ℤ) : ‖@fourier T n‖ = 1 := by
  rw [ContinuousMap.norm_eq_iSup_norm]
  

Proof state:
T : ℝ
inst✝ : Fact (0 < T)
n : ℤ
⊢ ⨆ x, ‖(fourier n) x‖ = 1

Next tactic:
have : ∀ x : AddCircle T, ‖fourier n x‖ = 1 := fun x => abs_coe_circle _
theorem fourier_norm [Fact (0 < T)] (n : ℤ) : ‖@fourier T n‖ = 1 := by
  rw [ContinuousMap.norm_eq_iSup_norm]
  have : ∀ x : AddCircle T, ‖fourier n x‖ = 1 := fun x => abs_coe_circle _
  

Proof state:
T : ℝ
inst✝ : Fact (0 < T)
n : ℤ
this : ∀ (x : AddCircle T), ‖(fourier n) x‖ = 1
⊢ ⨆ x, ‖(fourier n) x‖ = 1

Next tactic:
simp_rw [this]
theorem fourier_norm [Fact (0 < T)] (n : ℤ) : ‖@fourier T n‖ = 1 := by
  rw [ContinuousMap.norm_eq_iSup_norm]
  have : ∀ x : AddCircle T, ‖fourier n x‖ = 1 := fun x => abs_coe_circle _
  simp_rw [this]
  

Proof state:
T : ℝ
inst✝ : Fact (0 < T)
n : ℤ
this : ∀ (x : AddCircle T), ‖(fourier n) x‖ = 1
⊢ ⨆ x, 1 = 1

Next tactic:
exact @ciSup_const _ _ _ Zero.nonempty _
/-- For `n ≠ 0`, a translation by `T / 2 / n` negates the function `fourier n`. -/
theorem fourier_add_half_inv_index {n : ℤ} (hn : n ≠ 0) (hT : 0 < T) (x : AddCircle T) :
    @fourier T n (x + ↑(T / 2 / n)) = -fourier n x := by
  

Proof state:
T : ℝ
n : ℤ
hn : n ≠ 0
hT : 0 < T
x : AddCircle T
⊢ (fourier n) (x + ↑(T / 2 / ↑n)) = -(fourier n) x

Next tactic:
rw [fourier_apply, zsmul_add, ← QuotientAddGroup.mk_zsmul, toCircle_add, coe_mul_unitSphere]
/-- For `n ≠ 0`, a translation by `T / 2 / n` negates the function `fourier n`. -/
theorem fourier_add_half_inv_index {n : ℤ} (hn : n ≠ 0) (hT : 0 < T) (x : AddCircle T) :
    @fourier T n (x + ↑(T / 2 / n)) = -fourier n x := by
  rw [fourier_apply, zsmul_add, ← QuotientAddGroup.mk_zsmul, toCircle_add, coe_mul_unitSphere]
  

Proof state:
T : ℝ
n : ℤ
hn : n ≠ 0
hT : 0 < T
x : AddCircle T
⊢ ↑(toCircle (n • x)) * ↑(toCircle ↑(n • (T / 2 / ↑n))) = -(fourier n) x

Next tactic:
have : (n : ℂ) ≠ 0 := by simpa using hn
/-- For `n ≠ 0`, a translation by `T / 2 / n` negates the function `fourier n`. -/
theorem fourier_add_half_inv_index {n : ℤ} (hn : n ≠ 0) (hT : 0 < T) (x : AddCircle T) :
    @fourier T n (x + ↑(T / 2 / n)) = -fourier n x := by
  rw [fourier_apply, zsmul_add, ← QuotientAddGroup.mk_zsmul, toCircle_add, coe_mul_unitSphere]
  have : (n : ℂ) ≠ 0 := by 

Proof state:
T : ℝ
n : ℤ
hn : n ≠ 0
hT : 0 < T
x : AddCircle T
⊢ ↑n ≠ 0

Next tactic:
simpa using hn
/-- For `n ≠ 0`, a translation by `T / 2 / n` negates the function `fourier n`. -/
theorem fourier_add_half_inv_index {n : ℤ} (hn : n ≠ 0) (hT : 0 < T) (x : AddCircle T) :
    @fourier T n (x + ↑(T / 2 / n)) = -fourier n x := by
  rw [fourier_apply, zsmul_add, ← QuotientAddGroup.mk_zsmul, toCircle_add, coe_mul_unitSphere]
  have : (n : ℂ) ≠ 0 := by simpa using hn
  

Proof state:
T : ℝ
n : ℤ
hn : n ≠ 0
hT : 0 < T
x : AddCircle T
this : ↑n ≠ 0
⊢ ↑(toCircle (n • x)) * ↑(toCircle ↑(n • (T / 2 / ↑n))) = -(fourier n) x

Next tactic:
have : (@toCircle T (n • (T / 2 / n) : ℝ) : ℂ) = -1 := by
    rw [zsmul_eq_mul, toCircle, Function.Periodic.lift_coe, expMapCircle_apply]
    replace hT := Complex.ofReal_ne_zero.mpr hT.ne'
    convert Complex.exp_pi_mul_I using 3
    field_simp; ring
/-- For `n ≠ 0`, a translation by `T / 2 / n` negates the function `fourier n`. -/
theorem fourier_add_half_inv_index {n : ℤ} (hn : n ≠ 0) (hT : 0 < T) (x : AddCircle T) :
    @fourier T n (x + ↑(T / 2 / n)) = -fourier n x := by
  rw [fourier_apply, zsmul_add, ← QuotientAddGroup.mk_zsmul, toCircle_add, coe_mul_unitSphere]
  have : (n : ℂ) ≠ 0 := by simpa using hn
  have : (@toCircle T (n • (T / 2 / n) : ℝ) : ℂ) = -1 := by
    

Proof state:
T : ℝ
n : ℤ
hn : n ≠ 0
hT : 0 < T
x : AddCircle T
this : ↑n ≠ 0
⊢ ↑(toCircle ↑(n • (T / 2 / ↑n))) = -1

Next tactic:
rw [zsmul_eq_mul, toCircle, Function.Periodic.lift_coe, expMapCircle_apply]