Datasets:
Tasks:
Text Generation
Modalities:
Text
Sub-tasks:
language-modeling
Languages:
English
Size:
100K - 1M
License:
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' | |