Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: port Analysis.Fourier.FourierTransform (#4927)
- Loading branch information
1 parent
0a81ec1
commit 708e990
Showing
2 changed files
with
282 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,281 @@ | ||
/- | ||
Copyright (c) 2023 David Loeffler. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: David Loeffler | ||
! This file was ported from Lean 3 source module analysis.fourier.fourier_transform | ||
! leanprover-community/mathlib commit fd5edc43dc4f10b85abfe544b88f82cf13c5f844 | ||
! Please do not edit these lines, except to modify the commit id | ||
! if you have ported upstream changes. | ||
-/ | ||
import Mathlib.Analysis.Complex.Circle | ||
import Mathlib.MeasureTheory.Group.Integration | ||
import Mathlib.MeasureTheory.Measure.Haar.OfBasis | ||
|
||
/-! | ||
# The Fourier transform | ||
We set up the Fourier transform for complex-valued functions on finite-dimensional spaces. | ||
## Design choices | ||
In namespace `VectorFourier`, we define the Fourier integral in the following context: | ||
* `π` is a commutative ring. | ||
* `V` and `W` are `π`-modules. | ||
* `e` is a unitary additive character of `π`, i.e. a homomorphism `(Multiplicative π) β* circle`. | ||
* `ΞΌ` is a measure on `V`. | ||
* `L` is a `π`-bilinear form `V Γ W β π`. | ||
* `E` is a complete normed `β`-vector space. | ||
With these definitions, we define `fourierIntegral` to be the map from functions `V β E` to | ||
functions `W β E` that sends `f` to | ||
`Ξ» w, β« v in V, e [-L v w] β’ f v βΞΌ`, | ||
where `e [x]` is notational sugar for `(e (Multiplicative.ofAdd x) : β)` (available in locale | ||
`fourier_transform`). This includes the cases `W` is the dual of `V` and `L` is the canonical | ||
pairing, or `W = V` and `L` is a bilinear form (e.g. an inner product). | ||
In namespace `fourier`, we consider the more familiar special case when `V = W = π` and `L` is the | ||
multiplication map (but still allowing `π` to be an arbitrary ring equipped with a measure). | ||
The most familiar case of all is when `V = W = π = β`, `L` is multiplication, `ΞΌ` is volume, and | ||
`e` is `Real.fourierChar`, i.e. the character `Ξ» x, exp ((2 * Ο * x) * I)`. The Fourier integral | ||
in this case is defined as `Real.fourierIntegral`. | ||
## Main results | ||
At present the only nontrivial lemma we prove is `fourierIntegral_continuous`, stating that the | ||
Fourier transform of an integrable function is continuous (under mild assumptions). | ||
-/ | ||
|
||
|
||
noncomputable section | ||
|
||
local notation "π" => circle | ||
|
||
open MeasureTheory Filter | ||
|
||
open scoped Topology | ||
|
||
-- To avoid messing around with multiplicative vs. additive characters, we make a notation. | ||
scoped[FourierTransform] notation e "[" x "]" => (e (Multiplicative.ofAdd x) : β) | ||
|
||
open FourierTransform | ||
|
||
/-! ## Fourier theory for functions on general vector spaces -/ | ||
|
||
|
||
namespace VectorFourier | ||
|
||
variable {π : Type _} [CommRing π] {V : Type _} [AddCommGroup V] [Module π V] [MeasurableSpace V] | ||
{W : Type _} [AddCommGroup W] [Module π W] {E : Type _} [NormedAddCommGroup E] [NormedSpace β E] | ||
|
||
section Defs | ||
|
||
variable [CompleteSpace E] | ||
|
||
/-- The Fourier transform integral for `f : V β E`, with respect to a bilinear form `L : V Γ W β π` | ||
and an additive character `e`. -/ | ||
def fourierIntegral (e : Multiplicative π β* π) (ΞΌ : Measure V) (L : V ββ[π] W ββ[π] π) (f : V β E) | ||
(w : W) : E := | ||
β« v, e[-L v w] β’ f v βΞΌ | ||
#align vector_fourier.fourier_integral VectorFourier.fourierIntegral | ||
|
||
theorem fourierIntegral_smul_const (e : Multiplicative π β* π) (ΞΌ : Measure V) | ||
(L : V ββ[π] W ββ[π] π) (f : V β E) (r : β) : | ||
fourierIntegral e ΞΌ L (r β’ f) = r β’ fourierIntegral e ΞΌ L f := by | ||
ext1 w | ||
-- Porting note: was | ||
-- simp only [Pi.smul_apply, fourierIntegral, smul_comm _ r, integral_smul] | ||
simp only [Pi.smul_apply, fourierIntegral, β integral_smul] | ||
congr; funext | ||
rw [smul_comm] | ||
#align vector_fourier.fourier_integral_smul_const VectorFourier.fourierIntegral_smul_const | ||
|
||
/-- The uniform norm of the Fourier integral of `f` is bounded by the `LΒΉ` norm of `f`. -/ | ||
theorem norm_fourierIntegral_le_integral_norm (e : Multiplicative π β* π) (ΞΌ : Measure V) | ||
(L : V ββ[π] W ββ[π] π) (f : V β E) (w : W) : | ||
βfourierIntegral e ΞΌ L f wβ β€ β« v : V, βf vβ βΞΌ := by | ||
refine' (norm_integral_le_integral_norm _).trans (le_of_eq _) | ||
simp_rw [norm_smul, Complex.norm_eq_abs, abs_coe_circle, one_mul] | ||
#align vector_fourier.norm_fourier_integral_le_integral_norm VectorFourier.norm_fourierIntegral_le_integral_norm | ||
|
||
/-- The Fourier integral converts right-translation into scalar multiplication by a phase factor.-/ | ||
theorem fourierIntegral_comp_add_right [MeasurableAdd V] (e : Multiplicative π β* π) (ΞΌ : Measure V) | ||
[ΞΌ.IsAddRightInvariant] (L : V ββ[π] W ββ[π] π) (f : V β E) (vβ : V) : | ||
fourierIntegral e ΞΌ L (f β fun v => v + vβ) = | ||
fun w => e[L vβ w] β’ fourierIntegral e ΞΌ L f w := by | ||
ext1 w | ||
dsimp only [fourierIntegral, Function.comp_apply] | ||
conv in L _ => rw [β add_sub_cancel v vβ] | ||
rw [integral_add_right_eq_self fun v : V => e[-L (v - vβ) w] β’ f v] | ||
dsimp only | ||
rw [β integral_smul] | ||
congr 1 with v | ||
rw [β smul_assoc, smul_eq_mul, β Submonoid.coe_mul, β e.map_mul, β ofAdd_add, β | ||
LinearMap.neg_apply, β sub_eq_add_neg, β LinearMap.sub_apply, LinearMap.map_sub, neg_sub] | ||
#align vector_fourier.fourier_integral_comp_add_right VectorFourier.fourierIntegral_comp_add_right | ||
|
||
end Defs | ||
|
||
section Continuous | ||
|
||
/- In this section we assume π, V, W have topologies, and L, e are continuous (but f needn't be). | ||
This is used to ensure that `e [-L v w]` is (ae strongly) measurable. We could get away with | ||
imposing only a measurable-space structure on π (it doesn't have to be the Borel sigma-algebra of | ||
a topology); but it seems hard to imagine cases where this extra generality would be useful, and | ||
allowing it would complicate matters in the most important use cases. | ||
-/ | ||
variable [TopologicalSpace π] [TopologicalRing π] [TopologicalSpace V] [BorelSpace V] | ||
[TopologicalSpace W] {e : Multiplicative π β* π} {ΞΌ : Measure V} {L : V ββ[π] W ββ[π] π} | ||
|
||
/-- For any `w`, the Fourier integral is convergent iff `f` is integrable. -/ | ||
theorem fourier_integral_convergent_iff (he : Continuous e) | ||
(hL : Continuous fun p : V Γ W => L p.1 p.2) {f : V β E} (w : W) : | ||
Integrable f ΞΌ β Integrable (fun v : V => e[-L v w] β’ f v) ΞΌ := by | ||
-- first prove one-way implication | ||
have aux : | ||
β {g : V β E} (_ : Integrable g ΞΌ) (x : W), Integrable (fun v : V => e[-L v x] β’ g v) ΞΌ := by | ||
intro g hg x | ||
have c : Continuous fun v => e[-L v x] := by | ||
refine' (continuous_induced_rng.mp he).comp (continuous_ofAdd.comp (Continuous.neg _)) | ||
exact hL.comp (continuous_prod_mk.mpr β¨continuous_id, continuous_constβ©) | ||
rw [β integrable_norm_iff (c.aestronglyMeasurable.smul hg.1)] | ||
convert hg.norm using 2 | ||
rw [norm_smul, Complex.norm_eq_abs, abs_coe_circle, one_mul] | ||
-- then use it for both directions | ||
refine' β¨fun hf => aux hf w, fun hf => _β© | ||
convert aux hf (-w) | ||
rw [β smul_assoc, smul_eq_mul, β Submonoid.coe_mul, β MonoidHom.map_mul, β ofAdd_add, | ||
LinearMap.map_neg, neg_neg, β sub_eq_add_neg, sub_self, ofAdd_zero, MonoidHom.map_one, | ||
Submonoid.coe_one, one_smul] | ||
#align vector_fourier.fourier_integral_convergent_iff VectorFourier.fourier_integral_convergent_iff | ||
|
||
variable [CompleteSpace E] | ||
|
||
theorem fourierIntegral_add (he : Continuous e) (hL : Continuous fun p : V Γ W => L p.1 p.2) | ||
{f g : V β E} (hf : Integrable f ΞΌ) (hg : Integrable g ΞΌ) : | ||
fourierIntegral e ΞΌ L f + fourierIntegral e ΞΌ L g = fourierIntegral e ΞΌ L (f + g) := by | ||
ext1 w | ||
dsimp only [Pi.add_apply, fourierIntegral] | ||
simp_rw [smul_add] | ||
rw [integral_add] | ||
Β· exact (fourier_integral_convergent_iff he hL w).mp hf | ||
Β· exact (fourier_integral_convergent_iff he hL w).mp hg | ||
#align vector_fourier.fourier_integral_add VectorFourier.fourierIntegral_add | ||
|
||
/-- The Fourier integral of an `L^1` function is a continuous function. -/ | ||
theorem fourierIntegral_continuous [TopologicalSpace.FirstCountableTopology W] (he : Continuous e) | ||
(hL : Continuous fun p : V Γ W => L p.1 p.2) {f : V β E} (hf : Integrable f ΞΌ) : | ||
Continuous (fourierIntegral e ΞΌ L f) := by | ||
apply continuous_of_dominated | ||
Β· exact fun w => ((fourier_integral_convergent_iff he hL w).mp hf).1 | ||
Β· refine' fun w => ae_of_all _ fun v => _ | ||
Β· exact fun v => βf vβ | ||
Β· rw [norm_smul, Complex.norm_eq_abs, abs_coe_circle, one_mul] | ||
Β· exact hf.norm | ||
Β· rw [continuous_induced_rng] at he | ||
refine' ae_of_all _ fun v => (he.comp (continuous_ofAdd.comp _)).smul continuous_const | ||
refine' (hL.comp (continuous_prod_mk.mpr β¨continuous_const, continuous_idβ©)).neg | ||
#align vector_fourier.fourier_integral_continuous VectorFourier.fourierIntegral_continuous | ||
|
||
end Continuous | ||
|
||
end VectorFourier | ||
|
||
/-! ## Fourier theory for functions on `π` -/ | ||
|
||
|
||
namespace Fourier | ||
|
||
variable {π : Type _} [CommRing π] [MeasurableSpace π] {E : Type _} [NormedAddCommGroup E] | ||
[NormedSpace β E] | ||
|
||
section Defs | ||
|
||
variable [CompleteSpace E] | ||
|
||
/-- The Fourier transform integral for `f : π β E`, with respect to the measure `ΞΌ` and additive | ||
character `e`. -/ | ||
def fourierIntegral (e : Multiplicative π β* π) (ΞΌ : Measure π) (f : π β E) (w : π) : E := | ||
VectorFourier.fourierIntegral e ΞΌ (LinearMap.mul π π) f w | ||
#align fourier.fourier_integral Fourier.fourierIntegral | ||
|
||
theorem fourierIntegral_def (e : Multiplicative π β* π) (ΞΌ : Measure π) (f : π β E) (w : π) : | ||
fourierIntegral e ΞΌ f w = β« v : π, e[-(v * w)] β’ f v βΞΌ := | ||
rfl | ||
#align fourier.fourier_integral_def Fourier.fourierIntegral_def | ||
|
||
theorem fourierIntegral_smul_const (e : Multiplicative π β* π) (ΞΌ : Measure π) (f : π β E) (r : β) : | ||
fourierIntegral e ΞΌ (r β’ f) = r β’ fourierIntegral e ΞΌ f := | ||
VectorFourier.fourierIntegral_smul_const _ _ _ _ _ | ||
#align fourier.fourier_integral_smul_const Fourier.fourierIntegral_smul_const | ||
|
||
/-- The uniform norm of the Fourier transform of `f` is bounded by the `LΒΉ` norm of `f`. -/ | ||
theorem norm_fourierIntegral_le_integral_norm (e : Multiplicative π β* π) (ΞΌ : Measure π) | ||
(f : π β E) (w : π) : βfourierIntegral e ΞΌ f wβ β€ β« x : π, βf xβ βΞΌ := | ||
VectorFourier.norm_fourierIntegral_le_integral_norm _ _ _ _ _ | ||
#align fourier.norm_fourier_integral_le_integral_norm Fourier.norm_fourierIntegral_le_integral_norm | ||
|
||
/-- The Fourier transform converts right-translation into scalar multiplication by a phase factor.-/ | ||
theorem fourierIntegral_comp_add_right [MeasurableAdd π] (e : Multiplicative π β* π) (ΞΌ : Measure π) | ||
[ΞΌ.IsAddRightInvariant] (f : π β E) (vβ : π) : | ||
fourierIntegral e ΞΌ (f β fun v => v + vβ) = fun w => e[vβ * w] β’ fourierIntegral e ΞΌ f w := | ||
VectorFourier.fourierIntegral_comp_add_right _ _ _ _ _ | ||
#align fourier.fourier_integral_comp_add_right Fourier.fourierIntegral_comp_add_right | ||
|
||
end Defs | ||
|
||
end Fourier | ||
|
||
open scoped Real | ||
|
||
namespace Real | ||
|
||
/-- The standard additive character of `β`, given by `Ξ» x, exp (2 * Ο * x * I)`. -/ | ||
def fourierChar : Multiplicative β β* π where | ||
toFun z := expMapCircle (2 * Ο * Multiplicative.toAdd z) | ||
map_one' := by simp only; rw [toAdd_one, MulZeroClass.mul_zero, expMapCircle_zero] | ||
map_mul' x y := by simp only; rw [toAdd_mul, mul_add, expMapCircle_add] | ||
#align real.fourier_char Real.fourierChar | ||
|
||
theorem fourierChar_apply (x : β) : Real.fourierChar[x] = Complex.exp (β(2 * Ο * x) * Complex.I) := | ||
by rfl | ||
#align real.fourier_char_apply Real.fourierChar_apply | ||
|
||
@[continuity] | ||
theorem continuous_fourierChar : Continuous Real.fourierChar := | ||
(map_continuous expMapCircle).comp (continuous_const.mul continuous_toAdd) | ||
#align real.continuous_fourier_char Real.continuous_fourierChar | ||
|
||
variable {E : Type _} [NormedAddCommGroup E] [CompleteSpace E] [NormedSpace β E] | ||
|
||
theorem vector_fourierIntegral_eq_integral_exp_smul {V : Type _} [AddCommGroup V] [Module β V] | ||
[MeasurableSpace V] {W : Type _} [AddCommGroup W] [Module β W] (L : V ββ[β] W ββ[β] β) | ||
(ΞΌ : Measure V) (f : V β E) (w : W) : | ||
VectorFourier.fourierIntegral fourierChar ΞΌ L f w = | ||
β« v : V, Complex.exp (β(-2 * Ο * L v w) * Complex.I) β’ f v βΞΌ := | ||
by simp_rw [VectorFourier.fourierIntegral, Real.fourierChar_apply, mul_neg, neg_mul] | ||
#align real.vector_fourier_integral_eq_integral_exp_smul Real.vector_fourierIntegral_eq_integral_exp_smul | ||
|
||
/-- The Fourier integral for `f : β β E`, with respect to the standard additive character and | ||
measure on `β`. -/ | ||
def fourierIntegral (f : β β E) (w : β) := | ||
Fourier.fourierIntegral fourierChar volume f w | ||
#align real.fourier_integral Real.fourierIntegral | ||
|
||
theorem fourierIntegral_def (f : β β E) (w : β) : | ||
fourierIntegral f w = β« v : β, fourierChar[-(v * w)] β’ f v := | ||
rfl | ||
#align real.fourier_integral_def Real.fourierIntegral_def | ||
|
||
scoped[FourierTransform] notation "π" => Real.fourierIntegral | ||
|
||
theorem fourierIntegral_eq_integral_exp_smul {E : Type _} [NormedAddCommGroup E] [CompleteSpace E] | ||
[NormedSpace β E] (f : β β E) (w : β) : | ||
π f w = β« v : β, Complex.exp (β(-2 * Ο * v * w) * Complex.I) β’ f v := by | ||
simp_rw [fourierIntegral_def, Real.fourierChar_apply, mul_neg, neg_mul, mul_assoc] | ||
#align real.fourier_integral_eq_integral_exp_smul Real.fourierIntegral_eq_integral_exp_smul | ||
|
||
end Real |