Library NumAnalysis.Algebra.Finite_dim.Finite_dim_AS_aff_gen
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.
Support for affine generator finite families in affine spaces.
Some results are only valid when the ring of scalars is commutative, or being
ordered, they are only stated in the case of the ring of real numbers R_Ring.
This module may be used through the import of
NumAnalysis.Algebra.Finite_dim.Finite_dim_AS,
NumAnalysis.Algebra.Finite_dim.Finite_dim,
NumAnalysis.Algebra.Algebra,
NumAnalysis.Algebra.Algebra_wDep,
NumAnalysis.LM.LM_wDep, or
NumAnalysis.FEM.FEM_wDep, where it is exported.
Brief description
Description
Usage
From NumAnalysis Require Import ssr_wMC.
From Coquelicot Require Import Hierarchy.
Close Scope R_scope.
From NumAnalysis Require Import Subsets_wDep.
From NumAnalysis Require Import Hierarchy_compl.
From NumAnalysis Require Import Monoid Group Ring ModuleSpace AffineSpace.
From NumAnalysis Require Import Finite_dim_MS.
From NumAnalysis Require Import Finite_dim_AS_def Finite_dim_AS_aff_span.
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 Affine_span_Facts.
Context {K : Ring}.
Context {V : ModuleSpace K}.
Context {E : AffineSpace V}.
Context {PE : E → Prop}.
Lemma aff_gen_aff_span : ∀ {n} (A : 'E^n), aff_gen (aff_span A) A.
Proof. easy. Qed.
Lemma aff_gen_inclF : ∀ {n} {A : 'E^n}, aff_gen PE A → inclF A PE.
Proof. move=>> HA; rewrite HA; apply aff_span_inclF_diag. Qed.
Lemma aff_gen_nonempty :
∀ {n} {A : 'E^n.+1}, aff_gen PE A → ∃ O, PE O.
Proof. move⇒ n A ->; ∃ (A ord0); apply aff_span_inclF_diag. Qed.
Lemma aff_gen_decomp_ex :
∀ {n} {A : 'E^n}, aff_gen PE A → baryc_surjL PE A.
Proof. move=>> ->; apply aff_span_decomp_ex. Qed.
Lemma aff_gen_decomp_ex_rev :
∀ {n} {A : 'E^n},
compatible_as PE → inclF A PE → baryc_surjL PE A → aff_gen PE A.
Proof.
move=>> HA1 HA2 HA3; apply subset_ext_equiv; split.
intros B HB; destruct (HA3 _ HB) as [L [HL1 ->]]; apply aff_span_normal; easy.
intros _ [L]; apply HA1; easy.
Qed.
Lemma aff_gen_decomp_ex_equiv :
∀ {n} {A : 'E^n}, compatible_as PE → inclF A PE →
aff_gen PE A ↔ baryc_surjL PE A.
Proof.
intros; split; [apply aff_gen_decomp_ex | apply aff_gen_decomp_ex_rev; easy].
Qed.
End Affine_span_Facts.
Section AffineSpace_FD_R_Facts.
Context {V : ModuleSpace R_Ring}.
Context {E : AffineSpace V}.
Lemma aff_gen_cas :
∀ {PE n} (A : 'E^n.+1), aff_gen PE A → compatible_as PE.
Proof. move=>> ->; apply aff_span_cas. Qed.
Lemma aff_gen_lin_gen :
∀ {PE n} i0 O {A : 'E^n.+1},
aff_span A O → lin_gen (vectP PE O) (frameF i0 A) → aff_gen PE A.
Proof.
intros PE n i0 O A HO HA; apply (vectP_inj O).
rewrite (aff_span_lin_span i0 HO) vectP_translP; easy.
Qed.
Lemma aff_gen_lin_gen_rev :
∀ {PE n} i0 {O} {A : 'E^n.+1},
PE O → aff_gen PE A → lin_gen (vectP PE O) (frameF i0 A).
Proof.
intros PE n i0 O A HO ->; rewrite (aff_span_lin_span i0 HO) vectP_translP//.
Qed.
Lemma aff_gen_lin_gen_equiv :
∀ {PE n} i0 {O} {A : 'E^n.+1}, PE O → aff_span A O →
aff_gen PE A ↔ lin_gen (vectP PE O) (frameF i0 A).
Proof.
intros; split; [apply aff_gen_lin_gen_rev | apply aff_gen_lin_gen]; easy.
Qed.
Lemma lin_gen_aff_gen :
∀ {PV n} i0 (O : E) {u : 'V^n},
zero_closed PV →
aff_gen (translP PV O) (inv_frameF i0 O u) → lin_gen PV u.
Proof.
move⇒ PV n i0 O u
/(translP_zero_closed_equiv O) HO /(aff_gen_lin_gen_rev i0 HO).
rewrite vectP_translP frameF_inv_frameF; easy.
Qed.
Lemma lin_gen_aff_gen_rev :
∀ {PV n} i0 (O : E) {u : 'V^n},
lin_gen PV u → aff_gen (translP PV O) (inv_frameF i0 O u).
Proof.
intros PV n i0 O u Hu.
apply (aff_gen_lin_gen i0 O); try rewrite vectP_translP frameF_inv_frameF//.
apply aff_span_inv_frameF_orig.
Qed.
Lemma lin_gen_aff_gen_equiv :
∀ {PV n} i0 (O : E) {u : 'V^n}, zero_closed PV →
lin_gen PV u ↔ aff_gen (translP PV O) (inv_frameF i0 O u).
Proof.
intros; split; [apply lin_gen_aff_gen_rev | apply lin_gen_aff_gen; easy].
Qed.
End AffineSpace_FD_R_Facts.
Section ModuleSpace_AffineSpace_Facts.
Context {K : Ring}.
Hypothesis HK : nonzero_struct K.
Context {E : ModuleSpace K}.
Lemma aff_gen_ms_equiv :
∀ {n} (A : 'E^n),
aff_gen_ms fullset A ↔
∀ x, ∃ L, sum L = 1 ∧ x = barycenter_ms L A.
Proof.
intros n A; split; intros HA.
intros x; assert (Hx : aff_span A x) by now rewrite -HA.
induction Hx as [L HL].
destruct (baryc_normalized L A (barycenter L A)) as [L1 ->]; [easy.. |].
∃ (scal (/ (sum L)) L); easy.
apply subset_ext_equiv; split; try easy; intros x _.
destruct (HA x) as [L [HL1 HL2]], n as [| n].
rewrite sum_nil in HL1; contradict HL1; apply not_eq_sym, one_not_zero; easy.
assert (HL1' : invertible (sum L)) by now apply invertible_eq_one.
apply aff_span_ex; ∃ L; split; easy.
Qed.
End ModuleSpace_AffineSpace_Facts.
Section ModuleSpace_AffineSpace_R_Facts.
Context {E : ModuleSpace R_Ring}.
Lemma aff_gen_lin_gen_ms_equiv :
∀ {PE : E → Prop} {n} i0 O {A : 'E^n.+1}, PE O → aff_span_ms A O →
aff_gen_ms PE A ↔
lin_gen (fun u ⇒ PE (O + u)) (skipF i0 A - constF n (A i0)).
Proof.
intros PE n i0 O A; rewrite -vectP_ms_eq -frameF_ms_eq;
apply (aff_gen_lin_gen_equiv i0).
Qed.
Lemma lin_gen_aff_gen_ms_equiv :
∀ {PE : E → Prop} {n} i0 (O : E) {u : 'E^n}, zero_closed PE →
lin_gen PE u ↔
aff_gen_ms (fun A ⇒ PE (A - O)) (constF n.+1 O + insert0F i0 u).
Proof.
move=>>; rewrite -translP_ms_eq -inv_frameF_ms_eq; apply lin_gen_aff_gen_equiv.
Qed.
Lemma aff_gen_ms_equiv_R :
∀ {n} (A : 'E^n),
aff_gen_ms fullset A ↔
∀ x, ∃ L, sum L = 1 ∧ x = barycenter_ms L A.
Proof. intros; apply (aff_gen_ms_equiv nonzero_struct_R). Qed.
Lemma aff_gen_ms_equiv_R_lc :
∀ {n} (A : 'E^n),
aff_gen_ms fullset A ↔ ∀ x, ∃ L, sum L = 1 ∧ x = lin_comb L A.
Proof.
intros; rewrite (aff_gen_ms_equiv_R); split;
intros H x; destruct (H x) as [L [HL ->]]; ∃ L; rewrite baryc_ms_eq//.
Qed.
End ModuleSpace_AffineSpace_R_Facts.