Library NumAnalysis.FEM.LagP_node
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.
[RR9557v1]
François Clément and Vincent Martin,
Finite element method. Detailed proofs to be formalized in Coq,
RR-9557, first version, Inria Paris, 2024,
https://inria.hal.science/hal-04713897v1.
Bibliography
From NumAnalysis Require Import stdlib_wR ssr_wMC.
From Coquelicot Require Import Hierarchy.
Close Scope R_scope.
From NumAnalysis Require Import Algebra_wDep.
From NumAnalysis.FEM Require Import R_compl multi_index poly_Pdk poly_LagP1k.
From NumAnalysis Require Import poly_LagPd1_ref LagP_node_ref.
From NumAnalysis Require Import geom_transf_affine poly_LagPd1.
Local Open Scope Monoid_scope.
Local Open Scope Group_scope.
Local Open Scope Ring_scope.
Section Node_Def.
Context {d k : nat}.
From Coquelicot Require Import Hierarchy.
Close Scope R_scope.
From NumAnalysis Require Import Algebra_wDep.
From NumAnalysis.FEM Require Import R_compl multi_index poly_Pdk poly_LagP1k.
From NumAnalysis Require Import poly_LagPd1_ref LagP_node_ref.
From NumAnalysis Require Import geom_transf_affine poly_LagPd1.
Local Open Scope Monoid_scope.
Local Open Scope Group_scope.
Local Open Scope Ring_scope.
Section Node_Def.
Context {d k : nat}.
[RR9557v1]
Lem 1604, p. 101.
[RR9557v1]
Lem 1604, p. 101.
Definition node (vtx : [0..d] → 'R^d) : [0..pbinom d k] → 'R^d :=
mapF (T_geom vtx) node_ref.
Lemma nodeF : ∀ vtx, node vtx = mapF (T_geom vtx) node_ref.
Proof. easy. Qed.
mapF (T_geom vtx) node_ref.
Lemma nodeF : ∀ vtx, node vtx = mapF (T_geom vtx) node_ref.
Proof. easy. Qed.
[RR9557v1]
Lem 1599, p. 100.
Lemma node_ref_node : node_ref = node vtx_ref.
Proof. unfold node; extF; rewrite T_geom_ref; easy. Qed.
Context {vtx : [0..d] → 'R^d}.
Hypothesis Hvtx : aff_indep_ms vtx.
Lemma node_inj : injective (node vtx).
Proof. move=>> /(T_geom_inj Hvtx) /node_ref_inj; easy. Qed.
End Node_Def.
Section Node_Facts1.
Proof. unfold node; extF; rewrite T_geom_ref; easy. Qed.
Context {vtx : [0..d] → 'R^d}.
Hypothesis Hvtx : aff_indep_ms vtx.
Lemma node_inj : injective (node vtx).
Proof. move=>> /(T_geom_inj Hvtx) /node_ref_inj; easy. Qed.
End Node_Def.
Section Node_Facts1.
We need a dimension which is structurally nonzero.
We take d = d1.+1 with d1 : nat.
Context {d1 k : nat}.
Let d := d1.+1.
Hypothesis Hk : k ≠ 0.
Context {vtx : [0..d] → 'R^d}.
Hypothesis Hvtx : aff_indep_ms vtx.
Let d := d1.+1.
Hypothesis Hk : k ≠ 0.
Context {vtx : [0..d] → 'R^d}.
Hypothesis Hvtx : aff_indep_ms vtx.
[RR9557v1]
Lem 1605, Eq (9.96), p. 101.
For i \in 0..d, we have a_alpha \in Hface_i iff alpha \in ASdki, ie sum alpha = k (when i = 0), or alpha{i-1} = 0 (when i <> 0).
For i \in 0..d, we have a_alpha \in Hface_i iff alpha \in ASdki, ie sum alpha = k (when i = 0), or alpha{i-1} = 0 (when i <> 0).
Lemma node_Hface :
∀ i (idk : [0..pbinom d k]),
Hface vtx i (node vtx idk) ↔ in_ASdki i idk.
Proof.
intros; unfold Hface, node; rewrite Im_equiv; [| apply T_geom_inj; easy].
apply node_ref_Hface_ref; easy.
Qed.
End Node_Facts1.
Section Node_Facts2.
∀ i (idk : [0..pbinom d k]),
Hface vtx i (node vtx idk) ↔ in_ASdki i idk.
Proof.
intros; unfold Hface, node; rewrite Im_equiv; [| apply T_geom_inj; easy].
apply node_ref_Hface_ref; easy.
Qed.
End Node_Facts1.
Section Node_Facts2.
We need a dimension which is structurally nonzero.
We take d = d1.+1 with d1 : nat.
[RR9557v1]
Lem 1607, p. 102.
See also Rem 1606.
See also Rem 1606.
Lemma inj_Hface_node :
∀ {i} (idk : [0..pbinom d1 k]),
inj_Hface vtx i (node_ref idk) = node vtx (inj_ASdki i idk).
Proof.
intros; unfold inj_Hface; rewrite comp_correct inj_Hface_ref_node_ref//.
Qed.
End Node_Facts2.
Section Nodes_d1_Facts.
Context {d : nat}.
Lemma node_vtx_d1 : ∀ vtx, node vtx = castF (eq_sym (pbinomS_1_r d)) vtx.
Proof.
intro; unfold node; rewrite node_vtx_ref_d1 mapF_castF T_geom_vtxF; easy.
Qed.
Context {vtx : [0..d] → 'R^d}.
Hypothesis Hvtx : aff_indep_ms vtx.
Lemma LagPd1_decomp_node :
∀ {p}, Pdk d 1 p →
p = lin_comb (mapF p (node vtx))
(castF (eq_sym (pbinomS_1_r d)) (LagPd1 Hvtx)).
Proof.
intro; rewrite node_vtx_d1 mapF_castF lc_castF; apply LagPd1_decomp_vtx.
Qed.
End Nodes_d1_Facts.
Section Sub_vertices_Def.
Context {d : nat}.
Variable k : nat.
Variable vtx : [0..d] → 'R^d.
∀ {i} (idk : [0..pbinom d1 k]),
inj_Hface vtx i (node_ref idk) = node vtx (inj_ASdki i idk).
Proof.
intros; unfold inj_Hface; rewrite comp_correct inj_Hface_ref_node_ref//.
Qed.
End Node_Facts2.
Section Nodes_d1_Facts.
Context {d : nat}.
Lemma node_vtx_d1 : ∀ vtx, node vtx = castF (eq_sym (pbinomS_1_r d)) vtx.
Proof.
intro; unfold node; rewrite node_vtx_ref_d1 mapF_castF T_geom_vtxF; easy.
Qed.
Context {vtx : [0..d] → 'R^d}.
Hypothesis Hvtx : aff_indep_ms vtx.
Lemma LagPd1_decomp_node :
∀ {p}, Pdk d 1 p →
p = lin_comb (mapF p (node vtx))
(castF (eq_sym (pbinomS_1_r d)) (LagPd1 Hvtx)).
Proof.
intro; rewrite node_vtx_d1 mapF_castF lc_castF; apply LagPd1_decomp_vtx.
Qed.
End Nodes_d1_Facts.
Section Sub_vertices_Def.
Context {d : nat}.
Variable k : nat.
Variable vtx : [0..d] → 'R^d.
[RR9557v1]
Def 1594, Eq (9.88), p. 98.
sub_vtx 0 = \underline{v}0 = v_0,
sub_vtx i = \underline{v}i = a{(k-1)e^i}, for i <> 0.
Definition sub_vtx : [0..d.+1) → 'R^d := mapF (T_geom vtx) (sub_vtx_ref k).
End Sub_vertices_Def.
Section Sub_vertices_Facts.
Context {d k : nat}.
Hypothesis Hk : (1 < k)%coq_nat.
Context {vtx : [0..d] → 'R^d}.
Hypothesis Hvtx : aff_indep_ms vtx.
End Sub_vertices_Def.
Section Sub_vertices_Facts.
Context {d k : nat}.
Hypothesis Hk : (1 < k)%coq_nat.
Context {vtx : [0..d] → 'R^d}.
Hypothesis Hvtx : aff_indep_ms vtx.
[RR9557v1]
Lem 1597, pp. 99-100.
Lemma sub_vtx_aff_indep : aff_indep_ms (sub_vtx k vtx).
Proof.
apply (am_aff_indep (T_geom_am _));
[apply T_geom_inj | apply sub_vtx_ref_aff_indep]; easy.
Qed.
End Sub_vertices_Facts.
Section Sub_nodes_Def.
Context {d : nat}.
Variable k : nat.
Variable vtx : [0..d] → 'R^d.
Proof.
apply (am_aff_indep (T_geom_am _));
[apply T_geom_inj | apply sub_vtx_ref_aff_indep]; easy.
Qed.
End Sub_vertices_Facts.
Section Sub_nodes_Def.
Context {d : nat}.
Variable k : nat.
Variable vtx : [0..d] → 'R^d.
[RR9557v1]
Lem 1604, p. 101.
Definition sub_node : [0..pbinom d k.-1] → 'R^d :=
mapF (T_geom vtx) sub_node_ref.
End Sub_nodes_Def.
Section Sub_nodes_Facts1.
Context {d k : nat}.
Hypothesis Hk : (1 < k)%coq_nat.
Variable vtx : [0..d] → 'R^d.
Lemma sub_node_node : sub_node k vtx = node (sub_vtx k vtx).
Proof.
rewrite nodeF -T_geom_comp mapF_comp T_geom_scal_ref//.
apply INR_ratio_invertible; easy.
Qed.
mapF (T_geom vtx) sub_node_ref.
End Sub_nodes_Def.
Section Sub_nodes_Facts1.
Context {d k : nat}.
Hypothesis Hk : (1 < k)%coq_nat.
Variable vtx : [0..d] → 'R^d.
Lemma sub_node_node : sub_node k vtx = node (sub_vtx k vtx).
Proof.
rewrite nodeF -T_geom_comp mapF_comp T_geom_scal_ref//.
apply INR_ratio_invertible; easy.
Qed.
[RR9557v1]
Lem 1598, p. 100.
Lemma sub_node_eq :
sub_node k vtx = widenF (pbinomS_monot_pred d k) (node vtx).
Proof. extF; unfold sub_node; rewrite sub_node_ref_eq//. Qed.
End Sub_nodes_Facts1.
Section Sub_nodes_Facts2.
sub_node k vtx = widenF (pbinomS_monot_pred d k) (node vtx).
Proof. extF; unfold sub_node; rewrite sub_node_ref_eq//. Qed.
End Sub_nodes_Facts1.
Section Sub_nodes_Facts2.
We need a dimension which is structurally nonzero.
We take d = d1.+1 with d1 : nat.
Context {d1 k : nat}.
Let d := d1.+1.
Hypothesis Hk : (1 < k)%coq_nat.
Context {vtx : [0..d] → 'R^d}.
Hypothesis Hvtx : aff_indep_ms vtx.
Let d := d1.+1.
Hypothesis Hk : (1 < k)%coq_nat.
Context {vtx : [0..d] → 'R^d}.
Hypothesis Hvtx : aff_indep_ms vtx.
sub_node \notin Hface_0
Lemma sub_node_out_Hface_0 :
∀ (idk : [0..pbinom d k.-1]),
¬ Hface vtx ord0 (sub_node k vtx idk).
Proof.
intro; unfold Hface; rewrite Im_equiv;
[apply sub_node_ref_out_Hface_ref_0 | apply T_geom_inj]; easy.
Qed.
End Sub_nodes_Facts2.
∀ (idk : [0..pbinom d k.-1]),
¬ Hface vtx ord0 (sub_node k vtx idk).
Proof.
intro; unfold Hface; rewrite Im_equiv;
[apply sub_node_ref_out_Hface_ref_0 | apply T_geom_inj]; easy.
Qed.
End Sub_nodes_Facts2.