Datasets:
Tasks:
Text Generation
Modalities:
Text
Sub-tasks:
language-modeling
Languages:
English
Size:
100K - 1M
License:
/- | |
Copyright (c) 2021 Oliver Nash. All rights reserved. | |
Released under Apache 2.0 license as described in the file LICENSE. | |
Authors: Oliver Nash | |
-/ | |
import linear_algebra.affine_space.affine_map | |
import topology.continuous_function.basic | |
import topology.algebra.module.basic | |
/-! | |
This file defines a type of bundled continuous affine maps. | |
Note that the definition and basic properties established here require minimal assumptions, and do | |
not even assume compatibility between the topological and algebraic structures. Of course it is | |
necessary to assume some compatibility in order to obtain a useful theory. Such a theory is | |
developed elsewhere for affine spaces modelled on _normed_ vector spaces, but not yet for general | |
topological affine spaces (since we have not defined these yet). | |
* `continuous_affine_map` | |
We introduce the notation `P βA[R] Q` for `continuous_affine_map R P Q`. Note that this is parallel | |
to the notation `E βL[R] F` for `continuous_linear_map R E F`. | |
-/ | |
/-- A continuous map of affine spaces. -/ | |
structure continuous_affine_map (R : Type*) {V W : Type*} (P Q : Type*) [ring R] | |
[add_comm_group V] [module R V] [topological_space P] [add_torsor V P] | |
[add_comm_group W] [module R W] [topological_space Q] [add_torsor W Q] | |
extends P βα΅[R] Q := | |
(cont : continuous to_fun) | |
notation P ` βA[`:25 R `] ` Q := continuous_affine_map R P Q | |
namespace continuous_affine_map | |
variables {R V W P Q : Type*} [ring R] | |
variables [add_comm_group V] [module R V] [topological_space P] [add_torsor V P] | |
variables [add_comm_group W] [module R W] [topological_space Q] [add_torsor W Q] | |
include V W | |
/-- see Note [function coercion] -/ | |
instance : has_coe_to_fun (P βA[R] Q) (Ξ» _, P β Q) := β¨Ξ» f, f.to_affine_map.to_funβ© | |
lemma to_fun_eq_coe (f : P βA[R] Q) : f.to_fun = βf := rfl | |
lemma coe_injective : | |
@function.injective (P βA[R] Q) (P β Q) coe_fn := | |
begin | |
rintros β¨β¨f, β¨f', hfβ, hfββ©, hfββ©, hfββ© β¨β¨g, β¨g', hgβ, hgββ©, hgββ©, hgββ© h, | |
have : f = g β§ f' = g', { simpa only using affine_map.coe_fn_injective h, }, | |
congr, | |
exacts [this.1, this.2], | |
end | |
@[ext] lemma ext {f g : P βA[R] Q} (h : β x, f x = g x) : f = g := | |
coe_injective $ funext h | |
lemma ext_iff {f g : P βA[R] Q} : f = g β β x, f x = g x := | |
β¨by { rintro rfl x, refl, }, extβ© | |
lemma congr_fun {f g : P βA[R] Q} (h : f = g) (x : P) : f x = g x := h βΈ rfl | |
instance : has_coe (P βA[R] Q) (P βα΅[R] Q) := | |
β¨to_affine_mapβ© | |
/-- Forgetting its algebraic properties, a continuous affine map is a continuous map. -/ | |
def to_continuous_map (f : P βA[R] Q) : C(P, Q) := | |
β¨f, f.contβ© | |
instance : has_coe (P βA[R] Q) (C(P, Q)) := | |
β¨to_continuous_mapβ© | |
@[simp] lemma to_affine_map_eq_coe (f : P βA[R] Q) : | |
f.to_affine_map = βf := | |
rfl | |
@[simp] lemma to_continuous_map_coe (f : P βA[R] Q) : f.to_continuous_map = βf := | |
rfl | |
@[simp, norm_cast] lemma coe_to_affine_map (f : P βA[R] Q) : | |
((f : P βα΅[R] Q) : P β Q) = f := | |
rfl | |
@[simp, norm_cast] lemma coe_to_continuous_map (f : P βA[R] Q) : | |
((f : C(P, Q)) : P β Q) = f := | |
rfl | |
lemma to_affine_map_injective {f g : P βA[R] Q} | |
(h : (f : P βα΅[R] Q) = (g : P βα΅[R] Q)) : f = g := | |
by { ext a, exact affine_map.congr_fun h a, } | |
lemma to_continuous_map_injective {f g : P βA[R] Q} | |
(h : (f : C(P, Q)) = (g : C(P, Q))) : f = g := | |
by { ext a, exact continuous_map.congr_fun h a, } | |
@[norm_cast] lemma coe_affine_map_mk (f : P βα΅[R] Q) (h) : | |
((β¨f, hβ© : P βA[R] Q) : P βα΅[R] Q) = f := | |
rfl | |
@[norm_cast] lemma coe_continuous_map_mk (f : P βα΅[R] Q) (h) : | |
((β¨f, hβ© : P βA[R] Q) : C(P, Q)) = β¨f, hβ© := | |
rfl | |
@[simp] lemma coe_mk (f : P βα΅[R] Q) (h) : | |
((β¨f, hβ© : P βA[R] Q) : P β Q) = f := | |
rfl | |
@[simp] lemma mk_coe (f : P βA[R] Q) (h) : | |
(β¨(f : P βα΅[R] Q), hβ© : P βA[R] Q) = f := | |
by { ext, refl, } | |
@[continuity] | |
protected lemma continuous (f : P βA[R] Q) : continuous f := f.2 | |
variables (R P) | |
/-- The constant map is a continuous affine map. -/ | |
def const (q : Q) : P βA[R] Q := | |
{ to_fun := affine_map.const R P q, | |
cont := continuous_const, | |
.. affine_map.const R P q, } | |
@[simp] lemma coe_const (q : Q) : (const R P q : P β Q) = function.const P q := rfl | |
noncomputable instance : inhabited (P βA[R] Q) := | |
β¨const R P $ nonempty.some (by apply_instance : nonempty Q)β© | |
variables {R P} {Wβ Qβ : Type*} | |
variables [add_comm_group Wβ] [module R Wβ] [topological_space Qβ] [add_torsor Wβ Qβ] | |
include Wβ | |
/-- The composition of morphisms is a morphism. -/ | |
def comp (f : Q βA[R] Qβ) (g : P βA[R] Q) : P βA[R] Qβ := | |
{ cont := f.cont.comp g.cont, | |
.. (f : Q βα΅[R] Qβ).comp (g : P βα΅[R] Q), } | |
@[simp, norm_cast] lemma coe_comp (f : Q βA[R] Qβ) (g : P βA[R] Q) : | |
(f.comp g : P β Qβ) = (f : Q β Qβ) β (g : P β Q) := | |
rfl | |
lemma comp_apply (f : Q βA[R] Qβ) (g : P βA[R] Q) (x : P) : | |
f.comp g x = f (g x) := | |
rfl | |
omit Wβ | |
section module_valued_maps | |
variables {S : Type*} | |
variables [topological_space W] | |
instance : has_zero (P βA[R] W) := β¨continuous_affine_map.const R P 0β© | |
@[norm_cast, simp] lemma coe_zero : ((0 : P βA[R] W) : P β W) = 0 := rfl | |
lemma zero_apply (x : P) : (0 : P βA[R] W) x = 0 := rfl | |
section mul_action | |
variables [monoid S] [distrib_mul_action S W] [smul_comm_class R S W] | |
variables [has_continuous_const_smul S W] | |
instance : has_smul S (P βA[R] W) := | |
{ smul := Ξ» t f, { cont := f.continuous.const_smul t, .. (t β’ (f : P βα΅[R] W)) } } | |
@[norm_cast, simp] lemma coe_smul (t : S) (f : P βA[R] W) : β(t β’ f) = t β’ f := rfl | |
lemma smul_apply (t : S) (f : P βA[R] W) (x : P) : (t β’ f) x = t β’ (f x) := rfl | |
instance [distrib_mul_action Sα΅α΅α΅ W] [is_central_scalar S W] : is_central_scalar S (P βA[R] W) := | |
{ op_smul_eq_smul := Ξ» t f, ext $ Ξ» _, op_smul_eq_smul _ _ } | |
instance : mul_action S (P βA[R] W) := | |
function.injective.mul_action _ coe_injective coe_smul | |
end mul_action | |
variables [topological_add_group W] | |
instance : has_add (P βA[R] W) := | |
{ add := Ξ» f g, { cont := f.continuous.add g.continuous, .. ((f : P βα΅[R] W) + (g : P βα΅[R] W)) }, } | |
@[norm_cast, simp] lemma coe_add (f g : P βA[R] W) : β(f + g) = f + g := rfl | |
lemma add_apply (f g : P βA[R] W) (x : P) : (f + g) x = f x + g x := rfl | |
instance : has_sub (P βA[R] W) := | |
{ sub := Ξ» f g, { cont := f.continuous.sub g.continuous, .. ((f : P βα΅[R] W) - (g : P βα΅[R] W)) }, } | |
@[norm_cast, simp] lemma coe_sub (f g : P βA[R] W) : β(f - g) = f - g := rfl | |
lemma sub_apply (f g : P βA[R] W) (x : P) : (f - g) x = f x - g x := rfl | |
instance : has_neg (P βA[R] W) := | |
{ neg := Ξ» f, { cont := f.continuous.neg, .. (-(f : P βα΅[R] W)) }, } | |
@[norm_cast, simp] lemma coe_neg (f : P βA[R] W) : β(-f) = -f := rfl | |
lemma neg_apply (f : P βA[R] W) (x : P) : (-f) x = -(f x) := rfl | |
instance : add_comm_group (P βA[R] W) := | |
coe_injective.add_comm_group _ coe_zero coe_add coe_neg coe_sub | |
(Ξ» _ _, coe_smul _ _) (Ξ» _ _, coe_smul _ _) | |
instance [monoid S] [distrib_mul_action S W] [smul_comm_class R S W] | |
[has_continuous_const_smul S W] : | |
distrib_mul_action S (P βA[R] W) := | |
function.injective.distrib_mul_action β¨Ξ» f, f.to_affine_map.to_fun, rfl, coe_addβ© | |
coe_injective coe_smul | |
instance [semiring S] [module S W] [smul_comm_class R S W] [has_continuous_const_smul S W] : | |
module S (P βA[R] W) := | |
function.injective.module S β¨Ξ» f, f.to_affine_map.to_fun, rfl, coe_addβ© coe_injective coe_smul | |
end module_valued_maps | |
end continuous_affine_map | |
namespace continuous_linear_map | |
variables {R V W : Type*} [ring R] | |
variables [add_comm_group V] [module R V] [topological_space V] | |
variables [add_comm_group W] [module R W] [topological_space W] | |
/-- A continuous linear map can be regarded as a continuous affine map. -/ | |
def to_continuous_affine_map (f : V βL[R] W) : V βA[R] W := | |
{ to_fun := f, | |
linear := f, | |
map_vadd' := by simp, | |
cont := f.cont, } | |
@[simp] lemma coe_to_continuous_affine_map (f : V βL[R] W) : | |
βf.to_continuous_affine_map = f := | |
rfl | |
@[simp] lemma to_continuous_affine_map_map_zero (f : V βL[R] W) : | |
f.to_continuous_affine_map 0 = 0 := | |
by simp | |
end continuous_linear_map | |