Datasets:

Modalities:
Text
Languages:
English
Libraries:
Datasets
License:
proof-pile / formal /lean /mathlib /topology /algebra /continuous_affine_map.lean
Zhangir Azerbayev
squashed?
4365a98
raw
history blame
8.35 kB
/-
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
/-!
# Continuous affine maps.
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).
## Main definitions:
* `continuous_affine_map`
## Notation:
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