Theorem: orthonormal_fourier
File: Mathlib/Analysis/Fourier/AddCircle.lean

tactic: rw [orthonormal_iff_ite]
state_before: T : ℝ
hT : Fact (0 < T)
⊢ Orthonormal ℂ (fourierLp 2)
state_after: T : ℝ
hT : Fact (0 < T)
⊢ ∀ (i j : ℤ), ⟪fourierLp 2 i, fourierLp 2 j⟫_ℂ = if i = j then 1 else 0

tactic: intro i j
state_before: T : ℝ
hT : Fact (0 < T)
⊢ ∀ (i j : ℤ), ⟪fourierLp 2 i, fourierLp 2 j⟫_ℂ = if i = j then 1 else 0
state_after: T : ℝ
hT : Fact (0 < T)
i j : ℤ
⊢ ⟪fourierLp 2 i, fourierLp 2 j⟫_ℂ = if i = j then 1 else 0

tactic: rw [ContinuousMap.inner_toLp (@haarAddCircle T hT) (fourier i) (fourier j)]
state_before: T : ℝ
hT : Fact (0 < T)
i j : ℤ
⊢ ⟪fourierLp 2 i, fourierLp 2 j⟫_ℂ = if i = j then 1 else 0
state_after: T : ℝ
hT : Fact (0 < T)
i j : ℤ
⊢ ∫ (x : AddCircle T), (starRingEnd ℂ) ((fourier i) x) * (fourier j) x ∂haarAddCircle = if i = j then 1 else 0

tactic: simp_rw [← fourier_neg, ← fourier_add]
state_before: T : ℝ
hT : Fact (0 < T)
i j : ℤ
⊢ ∫ (x : AddCircle T), (starRingEnd ℂ) ((fourier i) x) * (fourier j) x ∂haarAddCircle = if i = j then 1 else 0
state_after: T : ℝ
hT : Fact (0 < T)
i j : ℤ
⊢ ∫ (x : AddCircle T), (fourier (-i + j)) x ∂haarAddCircle = if i = j then 1 else 0

tactic: split_ifs with h
state_before: T : ℝ
hT : Fact (0 < T)
i j : ℤ
⊢ ∫ (x : AddCircle T), (fourier (-i + j)) x ∂haarAddCircle = if i = j then 1 else 0
state_after: case pos
T : ℝ
hT : Fact (0 < T)
i j : ℤ
h : i = j
⊢ ∫ (x : AddCircle T), (fourier (-i + j)) x ∂haarAddCircle = 1

case neg
T : ℝ
hT : Fact (0 < T)
i j : ℤ
h : ¬i = j
⊢ ∫ (x : AddCircle T), (fourier (-i + j)) x ∂haarAddCircle = 0

tactic: have hij : -i + j ≠ 0 := by
  rw [add_comm]
  exact sub_ne_zero.mpr (Ne.symm h)
state_before: case neg
T : ℝ
hT : Fact (0 < T)
i j : ℤ
h : ¬i = j
⊢ ∫ (x : AddCircle T), (fourier (-i + j)) x ∂haarAddCircle = 0
state_after: case neg
T : ℝ
hT : Fact (0 < T)
i j : ℤ
h : ¬i = j
hij : -i + j ≠ 0
⊢ ∫ (x : AddCircle T), (fourier (-i + j)) x ∂haarAddCircle = 0

tactic: convert integral_eq_zero_of_add_right_eq_neg (μ := haarAddCircle)
  (fourier_add_half_inv_index hij hT.elim)
state_before: case neg
T : ℝ
hT : Fact (0 < T)
i j : ℤ
h : ¬i = j
hij : -i + j ≠ 0
⊢ ∫ (x : AddCircle T), (fourier (-i + j)) x ∂haarAddCircle = 0
state_after: no goals

tactic: simp_rw [h, neg_add_self]
state_before: case pos
T : ℝ
hT : Fact (0 < T)
i j : ℤ
h : i = j
⊢ ∫ (x : AddCircle T), (fourier (-i + j)) x ∂haarAddCircle = 1
state_after: case pos
T : ℝ
hT : Fact (0 < T)
i j : ℤ
h : i = j
⊢ ∫ (x : AddCircle T), (fourier 0) x ∂haarAddCircle = 1

tactic: have : ⇑(@fourier T 0) = (fun _ => 1 : AddCircle T → ℂ) := by ext1; exact fourier_zero
state_before: case pos
T : ℝ
hT : Fact (0 < T)
i j : ℤ
h : i = j
⊢ ∫ (x : AddCircle T), (fourier 0) x ∂haarAddCircle = 1
state_after: case pos
T : ℝ
hT : Fact (0 < T)
i j : ℤ
h : i = j
this : ⇑(fourier 0) = fun x => 1
⊢ ∫ (x : AddCircle T), (fourier 0) x ∂haarAddCircle = 1

tactic: rw [this, integral_const, measure_univ, ENNReal.one_toReal, Complex.real_smul,
  Complex.ofReal_one, mul_one]
state_before: case pos
T : ℝ
hT : Fact (0 < T)
i j : ℤ
h : i = j
this : ⇑(fourier 0) = fun x => 1
⊢ ∫ (x : AddCircle T), (fourier 0) x ∂haarAddCircle = 1
state_after: no goals

tactic: ext1
state_before: T : ℝ
hT : Fact (0 < T)
i j : ℤ
h : i = j
⊢ ⇑(fourier 0) = fun x => 1
state_after: case h
T : ℝ
hT : Fact (0 < T)
i j : ℤ
h : i = j
x✝ : AddCircle T
⊢ (fourier 0) x✝ = 1

tactic: exact fourier_zero
state_before: case h
T : ℝ
hT : Fact (0 < T)
i j : ℤ
h : i = j
x✝ : AddCircle T
⊢ (fourier 0) x✝ = 1
state_after: no goals

tactic: rw [add_comm]
state_before: T : ℝ
hT : Fact (0 < T)
i j : ℤ
h : ¬i = j
⊢ -i + j ≠ 0
state_after: T : ℝ
hT : Fact (0 < T)
i j : ℤ
h : ¬i = j
⊢ j + -i ≠ 0

tactic: exact sub_ne_zero.mpr (Ne.symm h)
state_before: T : ℝ
hT : Fact (0 < T)
i j : ℤ
h : ¬i = j
⊢ j + -i ≠ 0
state_after: no goals