Library NumAnalysis.Algebra.AffineSpace.AffineSpace_ModuleSpace
This file is part of the Rocq Numerical Analysis library
Copyright (C) Boldo, Clément, Martin, Mayero, Mouhcine
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
COPYING file for more details.
Affine spaces are module spaces too!
Given any point serving as the zero vector, any affine space can be endorsed
with the module space structure.
[GostiauxT4]
Bernard Gostiaux,
Cours de mathématiques spéciales - 4. Géométrie affine et métrique
Mathématiques, Presses Universitaires de France, Paris, 1995,
https://www.puf.com/cours-de-mathematiques-speciales-tome-4-geometrie-affine-et-metrique.
Note that using this canonical structure can generate looping typing
problems...
Brief description
Description
Bibliography
Usage
From NumAnalysis Require Import stdlib_wR ssr.
From Coquelicot Require Import Hierarchy.
Close Scope R_scope.
From NumAnalysis Require Import Subsets_wDep.
From NumAnalysis Require Import Hierarchy_compl Monoid Group ModuleSpace.
From NumAnalysis Require Import AffineSpace_def.
Local Open Scope Monoid_scope.
Local Open Scope Group_scope.
Local Open Scope Ring_scope.
Local Open Scope ModuleSpace_scope.
Local Open Scope AffineSpace_scope.
Section AffineSpace_Is_ModuleSpace.
[GostiauxT4]
Th 1.8, p. 3.
Context {K : Ring}.
Context {V : ModuleSpace K}.
Context {E : AffineSpace V}.
Variable O : E.
Definition as_plus (A B : E) : E := O +++ ((O --> A) + (O --> B)).
Definition as_zero : E := O.
Lemma as_plus_comm : ∀ A B, as_plus A B = as_plus B A.
Proof. intros; unfold as_plus; rewrite plus_comm; easy. Qed.
Lemma as_plus_assoc :
∀ A B C, as_plus A (as_plus B C) = as_plus (as_plus A B) C.
Proof.
intros; unfold as_plus; apply (vect_l_inj O); rewrite !transl_correct_r.
rewrite plus_assoc; easy.
Qed.
Lemma as_plus_zero_r : ∀ A, as_plus A as_zero = A.
Proof.
intros; unfold as_plus, as_zero.
rewrite vect_zero plus_zero_r transl_correct_l; easy.
Qed.
Definition AffineSpace_AbelianMonoid_mixin :=
AbelianMonoid.Mixin _ _ _ as_plus_comm as_plus_assoc as_plus_zero_r.
Canonical Structure AffineSpace_AbelianMonoid :=
AbelianMonoid.Pack _ AffineSpace_AbelianMonoid_mixin E.
Lemma as_plus_eq : ∀ A B : E, A + B = O +++ ((O --> A) + (O --> B)).
Proof. easy. Qed.
Lemma as_zero_eq : (0 : E) = O.
Proof. easy. Qed.
Definition as_opp (A : E) : E := O +++ (- (O --> A)).
Lemma as_plus_opp_r : ∀ A, as_plus A (as_opp A) = as_zero.
Proof.
intros; unfold as_plus, as_opp, as_zero.
rewrite transl_correct_r plus_opp_r transl_zero; easy.
Qed.
Definition AffineSpace_AbelianGroup_mixin :=
AbelianGroup.Mixin _ _ as_plus_opp_r.
Canonical Structure AffineSpace_AbelianGroup :=
AbelianGroup.Pack _
(AbelianGroup.Class _ _ AffineSpace_AbelianGroup_mixin) E.
Lemma as_opp_eq : ∀ A : E, - A = O +++ (- (O --> A)).
Proof. easy. Qed.
Lemma as_minus_eq : ∀ A B : E, A - B = O +++ ((O --> A) - (O --> B)).
Proof.
intros; rewrite minus_eq as_opp_eq as_plus_eq transl_correct_r; easy.
Qed.
Definition as_scal (x : K) (A : E) : E := O +++ (scal x (O --> A)).
Lemma as_scal_assoc :
∀ x y A, as_scal x (as_scal y A) = as_scal (x × y) A.
Proof.
intros; unfold as_scal; rewrite transl_correct_r scal_assoc; easy.
Qed.
Lemma as_scal_one_l : ∀ A, as_scal 1 A = A.
Proof. intros; unfold as_scal; rewrite scal_one transl_correct_l; easy. Qed.
Lemma as_scal_plus_l :
∀ x y A, as_scal (x + y) A = as_scal x A + as_scal y A.
Proof.
intros; unfold as_scal; rewrite as_plus_eq.
rewrite !transl_correct_r scal_plus_l; easy.
Qed.
Lemma as_scal_plus_r :
∀ x A B, as_scal x (A + B) = as_scal x A + as_scal x B.
Proof.
intros; unfold as_scal; rewrite !as_plus_eq.
rewrite !transl_correct_r scal_plus_r; easy.
Qed.
Definition AffineSpace_ModuleSpace_mixin :=
ModuleSpace.Mixin _ _ _
as_scal_assoc as_scal_one_l as_scal_plus_r as_scal_plus_l.
Canonical Structure AffineSpace_ModuleSpace :=
ModuleSpace.Pack _ _
(ModuleSpace.Class _ _ _ AffineSpace_ModuleSpace_mixin) E.
Lemma as_scal_eq : ∀ x A, scal x A = O +++ (scal x (O --> A)).
Proof. easy. Qed.
Lemma vect_l_lm : lin_map (vect O).
Proof.
split; move=>>; [rewrite as_plus_eq | rewrite as_scal_eq];
rewrite transl_correct_r; easy.
Qed.
Lemma transl_l_lm :
lin_map (transl O : V → AffineSpace_ModuleSpace).
Proof.
split; move=>>; [rewrite as_plus_eq | rewrite as_scal_eq];
rewrite !transl_correct_r; easy.
Qed.
End AffineSpace_Is_ModuleSpace.