Datasets:

Modalities:
Text
Languages:
English
Libraries:
Datasets
License:
Zhangir Azerbayev
I think it's all done!
fc5e983
raw
history blame
6.49 kB
import analysis.calculus.cont_diff
import linear_algebra.dual
import notations
import to_mathlib.analysis.normed_space.operator_norm
import to_mathlib.analysis.calculus
import to_mathlib.linear_algebra.basic
noncomputable theory
open function continuous_linear_map
section no_norm
variables (E : Type*) {E' F G : Type*}
variables [add_comm_group E] [module ℝ E] [topological_space E]
variables [add_comm_group E'] [module ℝ E'] [topological_space E']
variables [normed_add_comm_group F] [normed_space ℝ F] [normed_add_comm_group G] [normed_space ℝ G]
-- TODO: move mathlib's dual_pair out of the root namespace!
/-- A continuous linear form `Ο€` and a vector `v` that pair to one. In particular `ker Ο€` is a
hyperplane and `v` spans a complement of this hyperplane. -/
structure dual_pair' :=
(Ο€ : E β†’L[ℝ] ℝ)
(v : E)
(pairing : Ο€ v = 1)
namespace dual_pair'
variables {E F}
local attribute [simp] continuous_linear_map.to_span_singleton_apply
lemma ker_pi_ne_top (p : dual_pair' E) : p.Ο€.ker β‰  ⊀ :=
begin
intro H,
have : (p.Ο€ : E β†’β‚—[ℝ] ℝ) p.v = 1 := p.pairing,
simpa [linear_map.ker_eq_top.mp H]
end
/-- Given a dual pair `p`, `p.span_v` is the line spanned by `p.v`. -/
def span_v (p : dual_pair' E) : submodule ℝ E := submodule.span ℝ {p.v}
lemma mem_span_v (p : dual_pair' E) {u : E} : u ∈ p.span_v ↔ βˆƒ t : ℝ, u = t β€’ p.v :=
by simp [dual_pair'.span_v, submodule.mem_span_singleton, eq_comm]
/-- Update a continuous linear map `Ο† : E β†’L[ℝ] F` using a dual pair `p` on `E` and a
vector `w : F`. The new map coincides with `Ο†` on `ker p.Ο€` and sends `p.v` to `w`. -/
def update (p : dual_pair' E) (Ο† : E β†’L[ℝ] F) (w : F) : E β†’L[ℝ] F :=
Ο† + (w - Ο† p.v) ⬝ p.Ο€
@[simp]
lemma update_ker_pi (p : dual_pair' E) (Ο† : E β†’L[ℝ] F) (w : F) {u} (hu : u ∈ p.Ο€.ker) :
p.update Ο† w u = Ο† u :=
begin
rw continuous_linear_map.mem_ker at hu,
simp only [update, hu, continuous_linear_map.to_span_singleton_apply, add_zero,
continuous_linear_map.coe_comp', comp_app, zero_smul, continuous_linear_map.add_apply]
end
@[simp]
lemma update_v (p : dual_pair' E) (Ο† : E β†’L[ℝ] F) (w : F) :
p.update Ο† w p.v = w :=
by simp only [update, p.pairing, continuous_linear_map.to_span_singleton_apply,
continuous_linear_map.coe_comp', add_sub_cancel'_right, one_smul, comp_app,
continuous_linear_map.add_apply]
@[simp]
lemma update_self (p : dual_pair' E) (Ο† : E β†’L[ℝ] F) :
p.update Ο† (Ο† p.v) = Ο† :=
by simp only [update, add_zero, continuous_linear_map.to_span_singleton_zero,
continuous_linear_map.zero_comp, sub_self]
lemma inf_eq_bot (p : dual_pair' E) : p.Ο€.ker βŠ“ p.span_v = βŠ₯ :=
begin
rw eq_bot_iff,
intros x hx,
have : p.Ο€ x = 0 ∧ βˆƒ a : ℝ, a β€’ p.v = x,
by simpa [dual_pair'.span_v, submodule.mem_span_singleton] using hx,
rcases this with ⟨H, t, rfl⟩,
rw [p.Ο€.map_smul, p.pairing, algebra.id.smul_eq_mul, mul_one] at H,
simp [H]
end
lemma sup_eq_top (p : dual_pair' E) : p.Ο€.ker βŠ” p.span_v = ⊀ :=
begin
rw submodule.sup_eq_top_iff,
intro x,
refine ⟨x - p.Ο€ x β€’ p.v, _, p.Ο€ x β€’ p.v, _, _⟩;
simp [dual_pair'.span_v, submodule.mem_span_singleton, p.pairing]
end
lemma decomp (p : dual_pair' E) (e : E) : βˆƒ u ∈ p.Ο€.ker, βˆƒ t : ℝ, e = u + tβ€’p.v :=
begin
have : e ∈ p.Ο€.ker βŠ” p.span_v,
{ rw p.sup_eq_top,
exact submodule.mem_top },
simp_rw [submodule.mem_sup, dual_pair'.mem_span_v] at this,
rcases this with ⟨u, hu, -, ⟨t, rfl⟩, rfl⟩,
use [u, hu, t, rfl]
end
/-- Map a dual pair under a linear equivalence. -/
@[simps] def map (p : dual_pair' E) (L : E ≃L[ℝ] E') : dual_pair' E' :=
⟨p.Ο€ ∘L ↑L.symm, L p.v, (congr_arg p.Ο€ $ L.symm_apply_apply p.v).trans p.pairing⟩
lemma update_comp_left (p : dual_pair' E) (ψ : F β†’L[ℝ] G) (Ο† : E β†’L[ℝ] F) (w : F) :
p.update (ψ ∘L Ο†) (ψ w) = ψ ∘L p.update Ο† w :=
begin
ext1 u,
simp only [update, add_apply, continuous_linear_map.comp_apply, to_span_singleton_apply,
ψ.map_add, ψ.map_smul, ψ.map_sub],
end
lemma update_comp_right (p : dual_pair' E) (ψ : E' β†’L[ℝ] F) (Ο† : E ≃L[ℝ] E') (w : F) :
p.update (ψ ∘L ↑φ) w = (p.map Ο†).update ψ w ∘L ↑φ :=
begin
ext1 u,
simp only [update, add_apply, continuous_linear_map.comp_apply, to_span_singleton_apply, map,
continuous_linear_equiv.coe_coe, Ο†.symm_apply_apply],
end
lemma map_update_comp_right (p : dual_pair' E) (ψ : E β†’L[ℝ] F) (Ο† : E ≃L[ℝ] E') (w : F) :
(p.map Ο†).update (ψ ∘L ↑φ.symm) w = p.update ψ w ∘L ↑φ.symm :=
begin
-- todo: use `update_comp_right`
ext1 u,
simp only [update, add_apply, continuous_linear_map.comp_apply, to_span_singleton_apply, map,
continuous_linear_equiv.coe_coe, Ο†.symm_apply_apply],
end
end dual_pair'
end no_norm
namespace dual_pair'
variables {E : Type*} [normed_add_comm_group E] [normed_space ℝ E]
{F : Type*} [normed_add_comm_group F] [normed_space ℝ F]
/- In the next two lemmas, finite dimensionality of `E` is clearly uneeded, but allows
to use `cont_diff_clm_apply` and `continuous_clm_apply`. -/
lemma smooth_update [finite_dimensional ℝ E] (p : dual_pair' E)
{G : Type*} [normed_add_comm_group G] [normed_space ℝ G]
{Ο† : G β†’ (E β†’L[ℝ] F)} (hΟ† : π’ž ∞ Ο†) {w : G β†’ F} (hw : π’ž ∞ w) :
π’ž ∞ (Ξ» g, p.update (Ο† g) (w g)) :=
begin
apply hφ.add,
rw cont_diff_clm_apply,
intro y,
exact (hw.sub (cont_diff_clm_apply.mp hφ p.v)).const_smul _,
end
lemma continuous_update [finite_dimensional ℝ E] (p : dual_pair' E)
{X : Type*} [topological_space X]
{Ο† : X β†’ (E β†’L[ℝ] F)} (hΟ† : continuous Ο†) {w : X β†’ F} (hw : continuous w) :
continuous (Ξ» g, p.update (Ο† g) (w g)) :=
begin
apply hφ.add,
rw continuous_clm_apply,
intro y,
exact (hw.sub (continuous_clm_apply.mp hφ p.v)).const_smul _
end
/-- Given a finite basis `e : basis ΞΉ ℝ E`, and `i : ΞΉ`, `e.dual_pair' i`
is given by the `i`th basis element and its dual. -/
def _root_.basis.dual_pair' [finite_dimensional ℝ E] {ΞΉ : Type*} [fintype ΞΉ] [decidable_eq ΞΉ]
(e : basis ΞΉ ℝ E) (i : ΞΉ) : dual_pair' E :=
{ Ο€ := (e.dual_basis i).to_continuous_linear_map,
v := e i,
pairing := by simp only [basis.coord_apply, finsupp.single_eq_same, basis.repr_self,
linear_map.coe_to_continuous_linear_map', basis.coe_dual_basis] }
end dual_pair'