Library NumAnalysis.Algebra.Group.Group_morphism

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.

Brief description

Support for morphisms on commutative groups.

Description

Let G1 G2 : AbelianGroup. Let f : G1 → G2.
Lemmas about predicate morphism_g have "mg" in their names, usually as prefix "mg_", sometimes as suffix "_mg".

Usage

This module mat be used through the import of NumAnalysis.Algebra.Group.Group, NumAnalysis.Algebra.Algebra, NumAnalysis.Algebra.Algebra_wDep, NumAnalysis.LM.LM_wDep, or NumAnalysis.FEM.FEM_wDep, where it is exported.

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 Monoid Group_compl.

Local Open Scope Monoid_scope.
Local Open Scope Group_scope.

Section Group_Morphism_Def.

Context {G1 G2 : AbelianGroup}.

Definition morphism_g (f : G1 → G2) : Prop := f_plus_compat f.

Definition f_opp_compat (f : G1 → G2) : Prop := ∀ x1, f (- x1) = - f x1.

Definition f_minus_compat (f : G1 → G2) : Prop :=
  ∀ x1 y1, f (x1 - y1) = f x1 - f y1.

End Group_Morphism_Def.

Section Group_Morphism_Facts1a.

Context {G1 G2 : AbelianGroup}.

Lemma f_zero_minus_opp_compat :
  ∀ {f : G1 → G2}, f_zero_compat f → f_minus_compat f → f_opp_compat f.
Proof.
intros f Hf0 Hf1 x1; rewrite -(plus_zero_l (- x1)) Hf1 Hf0 minus_zero_l; easy.
Qed.

Lemma f_opp_minus_plus_compat :
  ∀ {f : G1 → G2}, f_opp_compat f → f_minus_compat f → f_plus_compat f.
Proof. intros f Hf1 Hf2 x1 y1; rewrite -(opp_opp y1) Hf1 Hf2; easy. Qed.

Lemma f_plus_opp_minus_compat :
  ∀ {f : G1 → G2}, f_plus_compat f → f_opp_compat f → f_minus_compat f.
Proof. intros f Hf1 Hf2 x1 y1; rewrite minus_eq Hf1 Hf2; easy. Qed.

Lemma mg_plus : ∀ {f : G1 → G2}, morphism_g f → f_plus_compat f.
Proof. easy. Qed.

Lemma mg_zero : ∀ {f : G1 → G2}, morphism_g f → f_zero_compat f.
Proof.
intros f Hf; apply (plus_reg_l (f 0)); rewrite -Hf 2!plus_zero_r; easy.
Qed.

Lemma mg_mm : ∀ {f : G1 → G2}, morphism_g f → morphism_m f.
Proof. intros; split; try apply mg_zero; easy. Qed.

Lemma mg_mm_rev : ∀ {f : G1 → G2}, morphism_m f → morphism_g f.
Proof. move=>> H; apply H. Qed.

Lemma mg_mm_equiv : ∀ {f : G1 → G2}, morphism_g f ↔ morphism_m f.
Proof. intros; split; [apply mg_mm | apply mg_mm_rev]. Qed.

Lemma mg_sum : ∀ {f : G1 → G2}, morphism_g f → f_sum_compat f.
Proof. intros; apply mm_sum, mg_mm; easy. Qed.

Lemma mg_opp : ∀ {f : G1 → G2}, morphism_g f → f_opp_compat f.
Proof.
intros f Hf x1; apply (plus_reg_l (f x1)); rewrite -Hf 2!plus_opp_r.
apply mg_zero; easy.
Qed.

Lemma mg_minus : ∀ {f : G1 → G2}, morphism_g f → f_minus_compat f.
Proof. move=>> Hf x1 y1; rewrite Hf mg_opp; easy. Qed.

Lemma mg_fct_plus :
  ∀ {f g : G1 → G2}, morphism_g f → morphism_g g → morphism_g (f + g).
Proof. move=>>; rewrite !mg_mm_equiv; apply mm_fct_plus. Qed.

Lemma mg_fct_zero : morphism_g (0 : G1 → G2).
Proof. rewrite mg_mm_equiv; apply mm_fct_zero. Qed.

Lemma mg_fct_sum :
  ∀ {n} {f : '(G1 → G2)^n},
    (∀ i, morphism_g (f i)) → morphism_g (sum f).
Proof.
intros; rewrite mg_mm_equiv; apply mm_fct_sum.
intros; apply mg_mm; easy.
Qed.

Lemma mg_fct_opp : ∀ {f : G1 → G2}, morphism_g f → morphism_g (- f).
Proof. move=>> H; intros x1 y1; rewrite 3!fct_opp_eq H; apply opp_plus. Qed.

Lemma mg_fct_minus :
  ∀ {f g : G1 → G2}, morphism_g f → morphism_g g → morphism_g (f - g).
Proof. intros; rewrite minus_eq; apply mg_fct_plus, mg_fct_opp; easy. Qed.

Lemma mg_ext :
  ∀ f g : G1 → G2, (∀ x, f x = g x) → morphism_g f → morphism_g g.
Proof. move=>> /fun_ext H; subst; easy. Qed.

End Group_Morphism_Facts1a.

Section Group_Morphism_Facts1b.

Context {T : Type}.
Context {G G1 G2 G3 : AbelianGroup}.

Lemma pt_eval_mg : ∀ (t : T), morphism_g (fun (f : T → G) ⇒ f t).
Proof. easy. Qed.

Lemma component_mg : ∀ {n} i, morphism_g (fun B1 : 'G1^n ⇒ B1 i).
Proof. easy. Qed.

Lemma constF_mg : ∀ n, morphism_g (@constF G n).
Proof. easy. Qed.

Lemma skipF_mg : ∀ {n} i0, morphism_g (skipF i0 : 'G^n.+1 → 'G^n).
Proof. easy. Qed.

Lemma insert0F_mg : ∀ {n} i0, morphism_g (insert0F i0 : 'G^n → 'G^n.+1).
Proof. intros; apply mg_mm_rev, insert0F_mm. Qed.

Lemma mapF_f_opp_compat :
  ∀ {n} {f : G1 → G2},
    f_opp_compat f → f_opp_compat (mapF f : 'G1^n → 'G2^n).
Proof. move=>> Hf x1; extF; rewrite mapF_correct Hf; easy. Qed.

Lemma mapF_f_minus_compat :
  ∀ {n} {f : G1 → G2},
    f_minus_compat f → f_minus_compat (mapF f : 'G1^n → 'G2^n).
Proof. move=>> Hf x1 y1; extF; rewrite mapF_correct Hf; easy. Qed.

Lemma mapF_mg :
  ∀ {n} {f : G1 → G2},
    morphism_g f → morphism_g (mapF f : 'G1^n → 'G2^n).
Proof. move=>>; rewrite !mg_mm_equiv; apply mapF_mm. Qed.

Lemma map2F_mg :
  ∀ {n} {f : G1 → G2 → G3} (u1 : 'G1^n),
    (∀ i1, morphism_g (f (u1 i1))) → morphism_g (map2F f u1).
Proof.
move=>> Hf; apply mg_mm.
apply map2F_mm; intros; apply mg_mm; easy.
Qed.

End Group_Morphism_Facts1b.

Section Group_Morphism_Facts2.

Context {T : Type}.
Context {G1 G2 G3 : AbelianGroup}.

Lemma mg_bij_compat :
  ∀ {f : G1 → G2} (Hf : bijective f),
    morphism_g f → morphism_g (f_inv Hf).
Proof.
intros f Hf1 Hf2; move=>>; apply (bij_inj Hf1); rewrite Hf2 !f_inv_can_r; easy.
Qed.

Lemma comp_f_opp_compat :
  ∀ {f : G1 → G2} {g : G2 → G3},
    f_opp_compat f → f_opp_compat g → f_opp_compat (g \o f).
Proof. intros f g Hf Hg x1; rewrite !comp_correct Hf Hg; easy. Qed.

Lemma comp_f_minus_compat :
  ∀ {f : G1 → G2} {g : G2 → G3},
    f_minus_compat f → f_minus_compat g → f_minus_compat (g \o f).
Proof. intros f g Hf Hg x1 y1; rewrite !comp_correct Hf; easy. Qed.

Lemma comp_mg :
  ∀ {f : G1 → G2} {g : G2 → G3},
    morphism_g f → morphism_g g → morphism_g (g \o f).
Proof. move=>>; apply comp_f_plus_compat. Qed.

Variable f : T → G2.

Lemma pullback_f_opp_compat : f_opp_compat (@pullback T G2 G3 f).
Proof. easy. Qed.

Lemma pullback_f_minus_compat : f_minus_compat (@pullback T G2 G3 f).
Proof. easy. Qed.

Lemma pullback_mg : morphism_g (@pullback T G2 G3 f).
Proof. easy. Qed.

Variable g : G1 → G2.

Lemma comp_r_f_opp_compat : f_opp_compat g → f_opp_compat (@comp_r G1 G2 T g).
Proof.
intros Hg; move=>>; fun_ext; unfold comp_r;
    rewrite fct_opp_eq !comp_correct Hg; easy.
Qed.

Lemma comp_r_f_minus_compat :
  f_minus_compat g → f_minus_compat (@comp_r G1 G2 T g).
Proof.
intros Hg; move=>>; fun_ext; unfold comp_r;
    rewrite fct_minus_eq !comp_correct Hg; easy.
Qed.

Lemma comp_r_mg : morphism_g g → morphism_g (@comp_r G1 G2 T g).
Proof. move=>>; apply comp_r_f_plus_compat. Qed.

End Group_Morphism_Facts2.

Section Group_Morphism_Functional_Facts.

Context {G1 G2 G3 G4 : AbelianGroup}.

Variable phi : G1 → G2.
Variable sigma : (G1 → G3) → G4.

Lemma pushforward_opp :
  f_opp_compat sigma → f_opp_compat (pushforward phi sigma).
Proof. intros H f; apply H. Qed.

Lemma pushforward_minus :
  f_minus_compat sigma → f_minus_compat (pushforward phi sigma).
Proof. intros H f g; apply H. Qed.

Lemma pushforward_mg : morphism_g sigma → morphism_g (pushforward phi sigma).
Proof. intros H; apply pushforward_plus, H. Qed.

End Group_Morphism_Functional_Facts.

Section Compose_n_Group_Facts.

Context {E : AbelianGroup}.

Lemma comp_n_mg :
  ∀ {n} (f : '(E → E)^n),
    (∀ i, morphism_g (f i)) → morphism_g (comp_n f).
Proof. move=>>; apply comp_n_f_plus_compat. Qed.

End Compose_n_Group_Facts.

Section Compose_n_part_Group_Facts.

Context {E : AbelianGroup}.

Lemma comp_n_part_mg :
  ∀ {n} (f : '(E → E)^n) j,
    (∀ i, morphism_g (widenF (leq_ord j) f i)) →
    morphism_g (comp_n_part f j).
Proof. move=>>; apply comp_n_part_f_plus_compat. Qed.

End Compose_n_part_Group_Facts.