Library NumAnalysis.FEM.FE
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.
[Ern]
Alexandre Ern, Éléments finis, Aide-mémoire, Dunod/L'Usine Nouvelle, 2005,
https://www.dunod.com/sciences-techniques/aide-memoire-elements-finis.
[ErnGuermond]
Alexandre Ern and Jean-Luc Guermond,
Finite Elements I. Approximation and Interpolation,
Texts in Applied Mathematics, vol. 72, Springer Cham, 2021,
https://doi.org/10.1007/978-3-030-56341-7,
https://inria.hal.science/hal-03226049 (with different page numbers).
[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
https://inria.hal.science/hal-03226049 (with different page numbers).
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 Require Import geometry.
Local Open Scope Monoid_scope.
Local Open Scope Group_scope.
Local Open Scope Ring_scope.
Section FE_Def.
Inductive shape_type := Simplex | Cuboid.
Definition nvtx_of_shape (d : nat) (shape : shape_type) : nat :=
match shape with
| Simplex ⇒ d.+1
| Cuboid ⇒ Nat.pow 2 d
end.
Lemma nos_eq :
∀ {d1 d2 s1 s2},
d1 = d2 → s1 = s2 → nvtx_of_shape d1 s1 = nvtx_of_shape d2 s2.
Proof. move=>>; apply f_equal2. Qed.
Record FE (d : nat) : Type := mk_FE {
shape : shape_type;
nvtx : nat := nvtx_of_shape d shape;
K_vertices : [0..nvtx) → 'R^d;
K_geom : 'R^d → Prop := convex_hull K_vertices;
ndof : nat ;
P_approx : FRd d → Prop;
P_approx_has_dim : has_dim P_approx ndof;
S_dof : '(FRd d → R)^ndof ;
S_dof_lm : ∀ i, lin_map (S_dof i);
unisolvence_inj : KerS0 P_approx (gather S_dof);
}.
End FE_Def.
Arguments mk_FE {d} _ _ {ndof} {P_approx} _ {S_dof} _ _.
Arguments shape {d}.
Arguments nvtx {d}.
Arguments K_vertices {d}.
Arguments K_geom {d}.
Arguments ndof {d}.
Arguments P_approx {d}.
Arguments P_approx_has_dim {d}.
Arguments S_dof {d}.
Arguments S_dof_lm {d}.
Arguments unisolvence_inj {d}.
Section FE_Facts0.
Lemma unisolvence :
∀ {d} (fe : FE d), bijS (P_approx fe) fullset (gather (S_dof fe)).
Proof.
intros d fe; apply lmS_bijS_KerS0 with (ndof fe) (ndof fe); try easy.
apply P_approx_has_dim.
apply has_dim_Rn.
apply lm_gather, S_dof_lm.
apply unisolvence_inj.
Qed.
Lemma FE_ext :
∀ {d} {fe1 fe2 : FE d}
(Hs : shape fe1 = shape fe2) (Hn : ndof fe1 = ndof fe2),
K_vertices fe1 = castF (nos_eq eq_refl (eq_sym Hs)) (K_vertices fe2) →
P_approx fe1 = P_approx fe2 → S_dof fe1 = castF (eq_sym Hn) (S_dof fe2) →
fe1 = fe2.
Proof.
intros d fe1 fe2 Hs Hn; destruct fe1, fe2; simpl in *; subst.
rewrite 2!castF_id; intros; subst; f_equal; apply proof_irrel.
Qed.
Lemma cast_FE : ∀ {d1 d2}, d1 = d2 → FE d1 → FE d2.
Proof. intros; subst; easy. Qed.
End FE_Facts0.
Section FE_degenerate_ndof.
Context {d : nat}.
shape : shape_type;
nvtx : nat := nvtx_of_shape d shape;
K_vertices : [0..nvtx) → 'R^d;
K_geom : 'R^d → Prop := convex_hull K_vertices;
ndof : nat ;
P_approx : FRd d → Prop;
P_approx_has_dim : has_dim P_approx ndof;
S_dof : '(FRd d → R)^ndof ;
S_dof_lm : ∀ i, lin_map (S_dof i);
unisolvence_inj : KerS0 P_approx (gather S_dof);
}.
End FE_Def.
Arguments mk_FE {d} _ _ {ndof} {P_approx} _ {S_dof} _ _.
Arguments shape {d}.
Arguments nvtx {d}.
Arguments K_vertices {d}.
Arguments K_geom {d}.
Arguments ndof {d}.
Arguments P_approx {d}.
Arguments P_approx_has_dim {d}.
Arguments S_dof {d}.
Arguments S_dof_lm {d}.
Arguments unisolvence_inj {d}.
Section FE_Facts0.
Lemma unisolvence :
∀ {d} (fe : FE d), bijS (P_approx fe) fullset (gather (S_dof fe)).
Proof.
intros d fe; apply lmS_bijS_KerS0 with (ndof fe) (ndof fe); try easy.
apply P_approx_has_dim.
apply has_dim_Rn.
apply lm_gather, S_dof_lm.
apply unisolvence_inj.
Qed.
Lemma FE_ext :
∀ {d} {fe1 fe2 : FE d}
(Hs : shape fe1 = shape fe2) (Hn : ndof fe1 = ndof fe2),
K_vertices fe1 = castF (nos_eq eq_refl (eq_sym Hs)) (K_vertices fe2) →
P_approx fe1 = P_approx fe2 → S_dof fe1 = castF (eq_sym Hn) (S_dof fe2) →
fe1 = fe2.
Proof.
intros d fe1 fe2 Hs Hn; destruct fe1, fe2; simpl in *; subst.
rewrite 2!castF_id; intros; subst; f_equal; apply proof_irrel.
Qed.
Lemma cast_FE : ∀ {d1 d2}, d1 = d2 → FE d1 → FE d2.
Proof. intros; subst; easy. Qed.
End FE_Facts0.
Section FE_degenerate_ndof.
Context {d : nat}.
When ndof = 0,
has_dim_0_rev provides P_approx = zero_sub_struct := singleton 0,
hat0F_eq provides Sigma = 0.
Lemma FE_ndof_0_P_approx_eq :
∀ {fe : FE d}, ndof fe = 0 → P_approx fe = zero_sub_struct.
Proof.
move=>> Hn; apply: has_dim_0_rev; apply (has_dim_ext _ Hn), P_approx_has_dim.
Qed.
Lemma FE_ndof_0_S_dof_eq : ∀ {fe : FE d}, ndof fe = 0 → S_dof fe = 0.
Proof. move=>> Hn; apply (hat0F_eq _ Hn). Qed.
Variable shp : shape_type.
Let nvtx := nvtx_of_shape d shp.
Variable vtx : [0..nvtx) → 'R^d.
Let P_approx_ndof_0 : FRd d → Prop := zero_sub_struct.
Let S_dof_ndof_0 : '(FRd d → R)^0 := 0.
Lemma S_dof_lm_ndof_0 : ∀ i, lin_map (S_dof_ndof_0 i).
Proof. intros [i Hi]; easy. Qed.
Lemma unisolvence_inj_ndof_0 : KerS0 P_approx_ndof_0 (gather S_dof_ndof_0).
Proof. easy. Qed.
Definition FE_ndof_0 : FE d :=
mk_FE shp vtx has_dim_0 S_dof_lm_ndof_0 unisolvence_inj_ndof_0.
Lemma FE_ndof_0_eq :
∀ (fe : FE d) (Hs : shape fe = shp),
K_vertices fe = castF (nos_eq erefl (eq_sym Hs)) vtx → ndof fe = 0 →
fe = FE_ndof_0.
Proof.
intros; apply: FE_ext; [easy |..].
rewrite !FE_ndof_0_P_approx_eq; easy.
rewrite !FE_ndof_0_S_dof_eq; easy.
Qed.
End FE_degenerate_ndof.
Section FE_degenerate_ndof_uniq.
Context {d : nat}.
Lemma FE_ndof_0_uniq :
∀ (fe1 fe2 : FE d) (Hs : shape fe1 = shape fe2),
K_vertices fe1 = castF (nos_eq erefl (eq_sym Hs)) (K_vertices fe2) →
ndof fe1 = 0 → ndof fe2 = 0 →
fe1 = fe2.
Proof.
intros fe1 fe2 Hs Hv Hn1 Hn2.
pose (FE_eq := FE_ndof_0_eq (shape fe2) (K_vertices fe2)).
rewrite (FE_eq fe1)// (FE_eq fe2)//.
rewrite castF_id; easy.
Qed.
End FE_degenerate_ndof_uniq.
Section FE_degenerate_d.
When d = 0,
- hatm0T_eq provides K_vertices = 0,
- FR0_lin_gen states that (FRd 0) is generated by the constant function of value 1,
- FR0_has_dim states dim FRd 0 = 1,
- FR0_sub_dim provides ndof <> 0 -> ndof = 1,
- FR0_sub_eq provides ndof <> 0 -> P_approx = fullset,
- FR0_dual_lin_gen states that the dual of (FRd 0) is generated by the linear form evaluating (constant) functions at 0,
- FR0_dual_ext states that two linear forms on (FRd 0) are equal if they are equal on the constant function 1.
Lemma FE_d_0_K_vertices_eq : ∀ {fe : FE 0}, K_vertices fe = 0.
Proof. intros fe; rewrite (hatm0T_eq (K_vertices _)); easy. Qed.
Lemma FE_d_0_ndof_n0 : ∀ {fe : FE 0} (i : [0..ndof fe)), ndof fe ≠ 0.
Proof. move=>> [i Hi] H; rewrite H in Hi; easy. Qed.
Lemma FE_d_0_ndof_eq : ∀ {fe : FE 0} (i : [0..ndof fe)), ndof fe = 1%nat.
Proof.
move=>> /FE_d_0_ndof_n0 Hn; apply: (FR0_sub_dim _ _ Hn);
[apply eq_refl | apply P_approx_has_dim].
Qed.
Lemma FE_d_0_P_approx_eq :
∀ {fe : FE 0}, ndof fe ≠ 0 → P_approx fe = fullset.
Proof. move=>> Hn; apply: (FR0_sub_eq _ (P_approx_has_dim _) Hn); easy. Qed.
Lemma FE_d_0_S_dof_ext :
∀ {fe1 fe2 : FE 0}
(Hn2 : ndof fe2 = 1%nat) (Hn : ndof fe1 = ndof fe2) i1 i2,
S_dof fe1 i1 1 = S_dof fe2 i2 1 →
S_dof fe1 = castF (eq_sym Hn) (S_dof fe2).
Proof.
intros fe1 fe2 Hn2 Hn i1 i2 HSig.
apply (eqAF_1 _ i1); [left; easy |]; unfold castF.
apply FR0_dual_ext; [easy | apply S_dof_lm.. |]; rewrite HSig; f_equal.
apply I_1_unit; easy.
Qed.
If there is a degree of freedom, ie ndof ≠ 0, the unisolvence property
implies that any degree of freedom is nonzero on the constant function 1.
In fact, there is only one degree of freedom, but the size ndof is not
structurally nonzero, thus to avoid casts, next lemma is stated for any index.
Lemma FE_d_0_S_dof_n0 : ∀ {fe : FE 0} i, S_dof fe i 1 ≠ 0.
Proof.
intros fe i Hi; move: (FE_d_0_ndof_n0 i) ⇒ Hn0;
move: (FR0_sub_dim eq_refl (P_approx_has_dim fe) Hn0) ⇒ Hn1.
move: (unisolvence_inj fe) ⇒ H; contradict H; apply KerS0_gather_contra.
∃ 1; repeat split.
rewrite (FR0_sub_eq _ (P_approx_has_dim _)); easy.
intros j; rewrite (I_1_unit i Hn1 j); easy.
apply: fct_one_not_zero_R; apply inhabited_m.
Qed.
Variable shp : shape_type.
Let P_approx_d_0 := fullset : FRd 0 → Prop.
Context {coeff : R}.
Hypothesis Hc : coeff ≠ 0.
Let S_dof_d_0 := singleF (scal coeff (fun f : FRd 0 ⇒ f 0)).
Lemma P_approx_has_dim_d_0 : has_dim P_approx_d_0 1.
Proof. apply FR0_has_dim; easy. Qed.
Lemma S_dof_lm_d_0 : ∀ i, lin_map (S_dof_d_0 i).
Proof. intro; apply: lm_fct_scal; apply pt_eval_lm. Qed.
Lemma unisolvence_inj_d_0 : KerS0 P_approx_d_0 (gather S_dof_d_0).
Proof.
assert (Hc' : invertible coeff) by now apply invertible_equiv_R.
intros; apply KerS0_gather_equiv; intros p _; apply (spec_hyp ord0).
unfold S_dof_d_0; rewrite singleF_0 fct_scal_eq (FR0_eq _ p)//.
move⇒ /(scal_zero_reg_r _ _ Hc') ->; easy.
Qed.
Definition FE_d_0 : FE 0 :=
mk_FE shp 0 P_approx_has_dim_d_0 S_dof_lm_d_0 unisolvence_inj_d_0.
Lemma FE_d_0_eq :
∀ (fe : FE 0),
shape fe = shp → (∃ i, S_dof fe i 1 = coeff) → fe = FE_d_0.
Proof.
move⇒ fe Hs [i Hi]; move: (FE_d_0_ndof_eq i) ⇒ Hn; apply FE_ext with Hs Hn;
[apply FE_d_0_K_vertices_eq | rewrite !FE_d_0_P_approx_eq// Hn; easy |].
assert (Hn' : ndof fe = ndof FE_d_0) by easy.
apply: (FE_d_0_S_dof_ext _ _ i (cast_ord Hn' i)); [easy.. |]; rewrite Hi.
simpl; unfold S_dof_d_0; rewrite singleF_0 fct_scal_eq scal_one_r; easy.
Qed.
End FE_degenerate_d.
Section FE_degenerate_d_uniq.
Lemma FE_d_0_uniq :
∀ (fe1 fe2 : FE 0) (c : R),
shape fe1 = shape fe2 → c ≠ 0 →
(∃ i : [0..ndof fe1), S_dof fe1 i 1 = c) →
(∃ i : [0..ndof fe2), S_dof fe2 i 1 = c) →
fe1 = fe2.
Proof.
intros fe1 fe2 c Hs Hc HSig1 HSig2.
pose (FE_eq := FE_d_0_eq (shape fe2) Hc).
rewrite (FE_eq fe1)// (FE_eq fe2)//.
Qed.
End FE_degenerate_d_uniq.
Section FE_Facts1.
Context {d : nat}.
Variable fe : FE d.
Lemma shape_dec : { shape fe = Simplex } + { shape fe = Cuboid }.
Proof. case shape; [left | right]; easy. Qed.
Lemma nvtx_dec : { nvtx fe = d.+1 } + { nvtx fe = Nat.pow 2 d }.
Proof. unfold nvtx; case shape; [left | right]; easy. Qed.
Lemma nvtx_Simplex : shape fe = Simplex → nvtx fe = d.+1.
Proof. unfold nvtx; case shape; [easy | discriminate]. Qed.
Lemma nvtx_Cuboid : shape fe = Cuboid → nvtx fe = Nat.pow 2 d.
Proof. unfold nvtx; case shape; [discriminate | easy]. Qed.
Lemma nvtx_n0 : nvtx fe ≠ 0.
Proof.
case nvtx_dec; move⇒ ->; [easy | apply Nat.neq_0_lt_0, pow_pos, Nat.lt_0_2].
Qed.
Definition is_predual_dof : ([0..ndof fe) → FRd d) → Prop :=
fun theta ⇒ inclF theta (P_approx fe) ∧ dualF theta (S_dof fe).
Proof.
intros fe i Hi; move: (FE_d_0_ndof_n0 i) ⇒ Hn0;
move: (FR0_sub_dim eq_refl (P_approx_has_dim fe) Hn0) ⇒ Hn1.
move: (unisolvence_inj fe) ⇒ H; contradict H; apply KerS0_gather_contra.
∃ 1; repeat split.
rewrite (FR0_sub_eq _ (P_approx_has_dim _)); easy.
intros j; rewrite (I_1_unit i Hn1 j); easy.
apply: fct_one_not_zero_R; apply inhabited_m.
Qed.
Variable shp : shape_type.
Let P_approx_d_0 := fullset : FRd 0 → Prop.
Context {coeff : R}.
Hypothesis Hc : coeff ≠ 0.
Let S_dof_d_0 := singleF (scal coeff (fun f : FRd 0 ⇒ f 0)).
Lemma P_approx_has_dim_d_0 : has_dim P_approx_d_0 1.
Proof. apply FR0_has_dim; easy. Qed.
Lemma S_dof_lm_d_0 : ∀ i, lin_map (S_dof_d_0 i).
Proof. intro; apply: lm_fct_scal; apply pt_eval_lm. Qed.
Lemma unisolvence_inj_d_0 : KerS0 P_approx_d_0 (gather S_dof_d_0).
Proof.
assert (Hc' : invertible coeff) by now apply invertible_equiv_R.
intros; apply KerS0_gather_equiv; intros p _; apply (spec_hyp ord0).
unfold S_dof_d_0; rewrite singleF_0 fct_scal_eq (FR0_eq _ p)//.
move⇒ /(scal_zero_reg_r _ _ Hc') ->; easy.
Qed.
Definition FE_d_0 : FE 0 :=
mk_FE shp 0 P_approx_has_dim_d_0 S_dof_lm_d_0 unisolvence_inj_d_0.
Lemma FE_d_0_eq :
∀ (fe : FE 0),
shape fe = shp → (∃ i, S_dof fe i 1 = coeff) → fe = FE_d_0.
Proof.
move⇒ fe Hs [i Hi]; move: (FE_d_0_ndof_eq i) ⇒ Hn; apply FE_ext with Hs Hn;
[apply FE_d_0_K_vertices_eq | rewrite !FE_d_0_P_approx_eq// Hn; easy |].
assert (Hn' : ndof fe = ndof FE_d_0) by easy.
apply: (FE_d_0_S_dof_ext _ _ i (cast_ord Hn' i)); [easy.. |]; rewrite Hi.
simpl; unfold S_dof_d_0; rewrite singleF_0 fct_scal_eq scal_one_r; easy.
Qed.
End FE_degenerate_d.
Section FE_degenerate_d_uniq.
Lemma FE_d_0_uniq :
∀ (fe1 fe2 : FE 0) (c : R),
shape fe1 = shape fe2 → c ≠ 0 →
(∃ i : [0..ndof fe1), S_dof fe1 i 1 = c) →
(∃ i : [0..ndof fe2), S_dof fe2 i 1 = c) →
fe1 = fe2.
Proof.
intros fe1 fe2 c Hs Hc HSig1 HSig2.
pose (FE_eq := FE_d_0_eq (shape fe2) Hc).
rewrite (FE_eq fe1)// (FE_eq fe2)//.
Qed.
End FE_degenerate_d_uniq.
Section FE_Facts1.
Context {d : nat}.
Variable fe : FE d.
Lemma shape_dec : { shape fe = Simplex } + { shape fe = Cuboid }.
Proof. case shape; [left | right]; easy. Qed.
Lemma nvtx_dec : { nvtx fe = d.+1 } + { nvtx fe = Nat.pow 2 d }.
Proof. unfold nvtx; case shape; [left | right]; easy. Qed.
Lemma nvtx_Simplex : shape fe = Simplex → nvtx fe = d.+1.
Proof. unfold nvtx; case shape; [easy | discriminate]. Qed.
Lemma nvtx_Cuboid : shape fe = Cuboid → nvtx fe = Nat.pow 2 d.
Proof. unfold nvtx; case shape; [discriminate | easy]. Qed.
Lemma nvtx_n0 : nvtx fe ≠ 0.
Proof.
case nvtx_dec; move⇒ ->; [easy | apply Nat.neq_0_lt_0, pow_pos, Nat.lt_0_2].
Qed.
Definition is_predual_dof : ([0..ndof fe) → FRd d) → Prop :=
fun theta ⇒ inclF theta (P_approx fe) ∧ dualF theta (S_dof fe).
is_predual_dof is injective.
Lemma is_predual_dof_uniq :
∀ theta1 theta2,
is_predual_dof theta1 → is_predual_dof theta2 → theta1 = theta2.
Proof.
intros theta1 theta2 [H1a H1b] [H2a H2b];
apply: (predual_basis_uniq _ _ _ H1a H2a H1b H2b).
apply P_approx_has_dim.
apply lm_gather, S_dof_lm.
apply unisolvence_inj.
Qed.
∀ theta1 theta2,
is_predual_dof theta1 → is_predual_dof theta2 → theta1 = theta2.
Proof.
intros theta1 theta2 [H1a H1b] [H2a H2b];
apply: (predual_basis_uniq _ _ _ H1a H2a H1b H2b).
apply P_approx_has_dim.
apply lm_gather, S_dof_lm.
apply unisolvence_inj.
Qed.
Definition shape_fun : ([0..ndof fe) → FRd d) := predual_basis (unisolvence fe).
Lemma shape_fun_correct : is_predual_dof shape_fun.
Proof. split; [apply predual_basis_in_sub | apply predual_basis_dualF]. Qed.
Lemma shape_fun_basis : basis (P_approx fe) shape_fun.
Proof. apply predual_basis_basis; [apply fe | apply lm_gather, S_dof_lm]. Qed.
Lemma shape_fun_lin_gen : lin_gen (P_approx fe) shape_fun.
Proof. apply shape_fun_basis. Qed.
Lemma shape_fun_correct : is_predual_dof shape_fun.
Proof. split; [apply predual_basis_in_sub | apply predual_basis_dualF]. Qed.
Lemma shape_fun_basis : basis (P_approx fe) shape_fun.
Proof. apply predual_basis_basis; [apply fe | apply lm_gather, S_dof_lm]. Qed.
Lemma shape_fun_lin_gen : lin_gen (P_approx fe) shape_fun.
Proof. apply shape_fun_basis. Qed.
[Ern]
Def 4.4, p. 78.
Definition local_interp : FRd d → FRd d :=
fun f ⇒ lin_comb (S_dof fe ^~ f) shape_fun.
Lemma local_interp_is_poly : ∀ f, P_approx fe (local_interp f).
Proof. intro; rewrite shape_fun_lin_gen; easy. Qed.
Lemma local_interp_lm : lin_map local_interp.
Proof. apply (fct_lc_l_lm shape_fun), S_dof_lm. Qed.
Lemma local_interp_shape_fun :
∀ i, local_interp (shape_fun i) = shape_fun i.
Proof.
intros j; unfold local_interp; rewrite (lc_ext_l (kron^~ j));
[apply lc_l_kron_l | intro; apply shape_fun_correct].
Qed.
fun f ⇒ lin_comb (S_dof fe ^~ f) shape_fun.
Lemma local_interp_is_poly : ∀ f, P_approx fe (local_interp f).
Proof. intro; rewrite shape_fun_lin_gen; easy. Qed.
Lemma local_interp_lm : lin_map local_interp.
Proof. apply (fct_lc_l_lm shape_fun), S_dof_lm. Qed.
Lemma local_interp_shape_fun :
∀ i, local_interp (shape_fun i) = shape_fun i.
Proof.
intros j; unfold local_interp; rewrite (lc_ext_l (kron^~ j));
[apply lc_l_kron_l | intro; apply shape_fun_correct].
Qed.
[Ern]
Eq (4.6), p. 78.
Lemma local_interp_proj : ∀ p, P_approx fe p → local_interp p = p.
Proof.
intros p; rewrite shape_fun_lin_gen ⇒ Hp; inversion Hp.
rewrite lm_lc; [| apply local_interp_lm].
apply lc_ext_r, local_interp_shape_fun.
Qed.
Proof.
intros p; rewrite shape_fun_lin_gen ⇒ Hp; inversion Hp.
rewrite lm_lc; [| apply local_interp_lm].
apply lc_ext_r, local_interp_shape_fun.
Qed.
[Ern]
p. 78.
Lemma local_interp_idem :
∀ f, local_interp (local_interp f) = local_interp f.
Proof. intros; apply local_interp_proj, local_interp_is_poly. Qed.
∀ f, local_interp (local_interp f) = local_interp f.
Proof. intros; apply local_interp_proj, local_interp_is_poly. Qed.
[Ern]
Eq (4.4), p. 77.
Lemma S_dof_local_interp :
∀ f i, S_dof fe i (local_interp f) = S_dof fe i f.
Proof.
intros f i; unfold local_interp.
rewrite (lm_lc (S_dof_lm fe i)) lc_comm_R (lc_ext_l (kron i)).
rewrite lc_l_kron_r; easy.
apply shape_fun_correct.
Qed.
End FE_Facts1.
Arguments nvtx_Simplex {d fe}.
Arguments nvtx_Cuboid {d fe}.
Lemma shape_fun_ext :
∀ {d : nat} {fe1 fe2 : FE d} (H : fe1 = fe2),
shape_fun fe1 = castF (eq_sym (f_equal ndof H)) (shape_fun fe2).
Proof. intros; subst; rewrite castF_id; easy. Qed.
∀ f i, S_dof fe i (local_interp f) = S_dof fe i f.
Proof.
intros f i; unfold local_interp.
rewrite (lm_lc (S_dof_lm fe i)) lc_comm_R (lc_ext_l (kron i)).
rewrite lc_l_kron_r; easy.
apply shape_fun_correct.
Qed.
End FE_Facts1.
Arguments nvtx_Simplex {d fe}.
Arguments nvtx_Cuboid {d fe}.
Lemma shape_fun_ext :
∀ {d : nat} {fe1 fe2 : FE d} (H : fe1 = fe2),
shape_fun fe1 = castF (eq_sym (f_equal ndof H)) (shape_fun fe2).
Proof. intros; subst; rewrite castF_id; easy. Qed.