Automatic transfer of pointwise metric computations to bundle computations $\newcommand{\M}{\mathcal{M}}$
$\newcommand{\N}{\mathcal{N}}$
$\newcommand{\deriv}[2]{\frac{d#1}{d#2}}$
$\newcommand{\sAverage}[1]{\langle#1\rangle} $
$\newcommand{\IP}[2]{\sAverage{#1,#2}}$
$\newcommand{\Cof}{\text{Cof}}$
$\newcommand{\Hom}{\operatorname{Hom}}$
$\newcommand{\tr}{\operatorname{tr}}$
$\newcommand{\TM}{\operatorname{T\M}}$
$\newcommand{\TN}{\operatorname{T\N}}$
$\newcommand{\TstarM}{\operatorname{T^*\M}}$
There is a well-known folklore saying that "any linear algebraic construction/statement can be lifted to vector bundles" (e.g tensor products, direct sums, quotients etc).
I am interested in a metric version of this phenomena:

Does every statement about inner-prodcut spaces admit a vector bundle analog?   

Specifically, I am interested in "derivations-type" results:
On various occasions, I need to compute derivatives of certain "geometric quantities" associated with bundle maps over a manifold. (examples are given below).
Often, I find it's easier to start with a finite dimensional analogous computation. The computation in the bundle context then becomes a routine adaptation of the original calculation, modulu some extra justifications (revolving around the compatiblity of connections with metrics).
Soft Question: Is there a way to "automate" this transfer? (I want to avoid repeating essentially the same calculation twice). In other words, is there a way to prove a "meta-theorem" which says that the result in the pointwise context carries over to the bundle context?
Main Example: Calculating the derivative of the determinant.
We want to prove the following:

Theorem 1: Let $f:\M \to \N$ be a smooth map between $d$-dimensional oriented Riemannian manifolds. 
  Define $\Cof df= (-1)^{d-1} \star_{f^*TN}^{d-1} (\wedge^{d-1} df) \star_{TM}^1.$
   Then for all $V \in \Gamma(\TM)$
   $$
   d(\det df)(V)= \IP{\Cof df}{\nabla_V df}_{\TM,f^*{\TN}} .
 $$


We start first with the "pointwise" analogy, where the vector spaces are fixed and only the linear map is changing:

Proposition: (The cofactor is the gradient of the determinant)
    Let $V,W$ be oriented $d$-dimensional inner product spaces. Then $$d(\det)_A(B)=\tr\left( \Cof A^T B \right)=\IP{\Cof A}{B}_{V,W}.$$

Specific question: Can we deduce the theorem from the proposition? (without using the proof of the proposition, like I am doing below).
One obvious way to achieve this would be to view $p \to \det(df_p)$ as the determinant of a changing map between fixed vector spaces. This can be done by representing $df$ w.r.t orthonormal frames. However, one then needs to track the derivative of this matrix in terms of $V$ which looks cumbersome. (I would say that even if this approach would work, it is less aesthetic - an invariant way would be better).
Edit:
As pointed out by Deane Yang, there is a more general version of theorem $1$ which is the right "bundle-analog" of the finite-dim proposition:

Theorem 2: Let $E$ and $F$ be rank $d$ oriented vector bundles over $\M$ with smooth metrics and compatible connections. Let $A:E \to F$ be a smooth bundle map.
  Define $\Cof A= (-1)^{d-1} \star_{F}^{d-1} (\wedge^{d-1} A) \star_{E}^1.$
   Then for all $V \in \Gamma(\TM)$
   $$
   d(\det A)(V)= \IP{\Cof A}{\nabla_V A}_{E,F}.
 $$

The proof of theorem $2$ is exactly the same as the proof of theorem 1 (see below) - we just replace $df \to A$ everywhere (that proof does not use the fact $df$ is the differential of a map, just the bundle-structures).
The question still remains- can we use the statement of the proposition
to deduce theorem $2$, without looking at the proof.
(This is not a trivial consequence of the proposition, where the two vector spaces, while different, are fixed).

proof of the proposition:
 Let $A_t$ be a smooth family of mappings in $\Hom(V,W)$: $A(0)=A,A'(0)=B$, and let $e_1,\dots,e_d$ be a positive orthonormal basis of $V$.
$$
 \det(A_t)=   \star^d_W \circ \bigwedge^d A_t \circ \star^0_V(1)=   \star^d_W \bigwedge^d A_t \big( e_1 \wedge \dots \wedge e_d \big)= \star^d_W \big( A_t e_1 \wedge \dots \wedge A_te_d \big)
 $$
Using the Leibniz rule we get:
$$
\left. \deriv{\det A_t}{t} \right|_{t=0}= \star^d_W \left. \deriv{}{t} \right|_{t=0}\big( A_t e_1 \wedge \dots \wedge A_te_d \big) =$$
$$ \star^d_W \sum_{i=1}^d \big( A e_1 \wedge \dots \wedge Be_i \wedge \dots \wedge Ae_d \big) =  \sum_{i=1}^d \star^d_W (-1)^{i-1} \big( Be_i \wedge A e_1  \wedge \dots \wedge \widehat Ae_i \wedge \dots \wedge Ae_d \big) $$
$$ =\sum_{i=1}^d \star^d_W (-1)^{i-1} \big( Be_i \wedge  (-1)^{d-1} \star^1_W \star^{d-1}_W ( A e_1 \wedge \dots \wedge \widehat Ae_i \wedge \dots \wedge Ae_d) \big) = $$
  $$(-1)^{i-1}   (-1)^{d-1} \sum_{i=1}^d \star^d_W  \big( Be_i \wedge  \star^1_W \star^{d-1}_W ( A e_1 \wedge \dots \wedge \widehat Ae_i \wedge \dots \wedge Ae_d) \big) = $$
  $$(-1)^{i-1}   (-1)^{d-1} \sum_{i=1}^d \IP{Be_i}{ \star^{d-1}_W ( A e_1 \wedge \dots \wedge \widehat Ae_i \wedge \dots \wedge Ae_d)}_W = $$
 $$ (-1)^{d-1} \sum_{i=1}^d \IP{Be_i}{ \star^{d-1}_W \big( \bigwedge^{d-1} A ( \star_V^1 e_i )\big)}_W=\sum_{i=1}^d \IP{Be_i}{ \big( (-1)^{d-1}  \star^{d-1}_W  \bigwedge^{d-1} A \star_V^1\big) e_i }_W=$$
 $$\sum_{i=1}^d \IP{Be_i}{  \Cof A(e_i) }_W=\sum_{i=1}^d \IP{(\Cof A)^TBe_i}{  e_i }_V=\tr\left( \Cof A^TB \right)= \IP{\Cof A}{B}_{V,W}.$$

proof of Theorem $1$:
  We want to imitate the proof above:
A positive orthonormal frame  $e_1,\dots,e_d$ of $\TM$ will replace the basis for $V$, covariant differentiation will replace the time derivation, so $A \to df,A'(0)=B \to \nabla_Vdf$.  There are two obstacles with using this analogy verbatim:


*

*The $e_i$ cannot be chosen to be parallel w.r.t $\nabla^{\TM}$ if $\M$ is not flat, while in the original setting, the $e_i$ were constant vectors (time-independent). 

*The derivative w.r.t time commuted with $\star_W$, since it was a fixed linear operator. This time we need to establish a stronger commutation property between Hodge duals and covariant differentiation. 


We shall see that a miracle will happen - metricity shall come to our aid.
  $$
    \det(df)= \star^d_{f^*T\N} \circ \bigwedge^d df \circ \star^0_{\TM}(1)=   \star^d_{f^*T\N} \big( df(e_1) \wedge \dots \wedge df(e_d) \big),$$
So
$$ V\det df = V \star^d_{f^*T\N}\big( df(e_1) \wedge \dots \wedge df(e_d) \big) \stackrel{(1)}{=}  $$
$$ \star^d_{f^*T\N}  \nabla_V \big( df(e_1) \wedge \dots \wedge df(e_d) \big)=
  \star^d_{f^*T\N}  \sum_{i=1}^d \big( df(e_1) \wedge \dots \wedge \nabla_V \big(df(e_i)\big) \wedge \dots \wedge df(e_d) \big) =  
\star^d_{f^*T\N}  \sum_{i=1}^d \big( df(e_1) \wedge \dots \wedge (\nabla_V df)e_i \wedge \dots \wedge df(e_d) \big) + $$
$$ \star^d_{f^*T\N}  \sum_{i=1}^d \big( df(e_1) \wedge \dots \wedge  df(\nabla_{V}e_i) \wedge \dots \wedge df(e_d) \big)  \stackrel{(2)}{=}  $$
$$  \IP{\Cof df}{\nabla_V df}_{\TM,f^*{\TN}}+ \star^d_{f^*T\N} \bigwedge^d df( \sum_{i=1}^d  e_1 \wedge \dots \wedge \nabla_Ve_i \wedge \dots \wedge e_d)=
\IP{\Cof df}{\nabla_V df}_{\TM,f^*{\TN}}+ \star^d_{f^*T\N} \bigwedge^d df\big( \nabla_V  (e_1 \wedge \dots \wedge e_i \wedge \dots \wedge e_d) \big)=\IP{\Cof df}{\nabla_V df}_{\TM,f^*{\TN}}.
$$
Where equality $(1)$ follows since metric connections and Hodge duals commute, and equality $(2)$ is exactly the formal repeatition of the calculation in the pointwise setting (where $A \to df,B \to \nabla_Vdf$).
Admittedly, this repeatition is not huge, but I have other examples on my mind where the computations are much longer, so a general "transfer-principle" would be nice to have.
 A: The following is the meta-theorem I have in mind (I can't swear that what I've written is 100% correct):
Given $G < \mathrm{GL}(n)$, let $\Phi: \mathbb{R}^n \rightarrow \mathbb{R}$ a smooth $G$-invariant function. Let $\Phi': \mathbb{R}^n \rightarrow (\mathbb{R}^n)^*$ denote the differential of $\Phi$, defined to be
$$
\langle\Phi'(x),v\rangle = \left.\frac{d}{dt}\right|_{t=0}\Phi(x + tv).
$$
Let $V$ be a rank $n$ vector bundle with structure group $G$ (using the same representation as above) and compatible connection $\nabla$. The function $\Phi$ induces naturally a function $\widehat\Phi: V \rightarrow \mathbb{R}$, which is equal to $\Phi$ on each fiber $V_x$. Similarly, $\Phi'$ induces a bundle map $\widehat\Phi': V \rightarrow V^*$.
Given any section $v$ of $V$, let $f(x) = \widehat\Phi(v(x))$.
Then given any tangent vector $t \in T_x\mathcal{M}$,
$$
\langle df(x), t\rangle
= \langle \widehat\Phi'(v(x)), \nabla_tv(x)\rangle.
$$
I think this (or something like it) can be proved by using a curve passing through $x$ and tangent to $t$ and a $G$-frame parallel translated along the curve and writing the section $v$ in terms of the frame.
A: I think everything can be reduced to the following (stated without proofs):
Let $E$ and $F$ be rank $n$ oriented vector bundles over $\mathcal{M}$ with smooth inner products and compatible connections. Let $\omega$ be the section of $\Lambda^nE$ such that
$$
\omega = e_1\wedge\cdots\wedge e_n
$$
for any local positively oriented orthonormal frame $e_1, \cdots, e_n$ of $E$. Define $\eta \in \Gamma(\Lambda^nF)$ similarly. Compatibility of the connection with the inner product on each bundle implies that $\nabla \omega = 0$ and $\nabla\eta  = 0$.
A smooth bundle map $A: E\rightarrow F$ naturally induces a map $A: \Lambda^nE \rightarrow \Lambda^nF$. Let $\det A$ be the real-valued function such that
$$
A(\omega) = (\det A)\eta.
$$
Define the cofactor of $A$ to be a bundle map $A^c: F\rightarrow E$, which agrees with the standard definition of the cofactor matrix, when $A$ is written with respect to local orthonormal frames of $E$ and $F$. In particular, $A^cA = (\det A)1_E$.
Then, given any smooth vector field $V$ on $\mathcal{M}$,
$$
\langle d(\det A),V\rangle = \tr A^c\nabla_VA,
$$
where $\nabla$ is the connection on $F\otimes E^*$ induced by the connections on $E$ and $F$. In general, anything invariant formula involving derivatives of maps or tensors of finite dimensional vector spaces translates into a corresponding formula involving vector bundles, where differentiation is replaced by covariant differentiation. A compatible inner product is needed on the bundles, if the vector space formula relies on inner products, too.
In your example, I believe this gives the right formula when $E = T_*\mathcal{M}$ and $F=f^*T_*\mathcal{N}$. Note that the connection on $F$ is the pullback of the Levi-Civita connection on $N$, so, if $x^1, \dots, x^d$ are local coordinates on $\mathcal{M}$ and $y^1, \dots, y^d$ on $\mathcal{N}$, then
$$
\nabla_{X_i}Y_\alpha = \frac{\partial f^\beta}{\partial x^i}\Gamma^\gamma_{\alpha\beta}Y_\gamma,
$$
where
$$
X_i = \frac{\partial}{\partial x^i},\ Y_\alpha = \frac{\partial}{\partial y^\alpha},
$$
and $\Gamma^\gamma_{\alpha\beta}$ are the Christoffel symbols for the metric on $Y$.
Last quick personal comment: I find the Hodge star operator really confusing to work with and often try to avoid it.
A: $\newcommand{\M}{\mathcal{M}}$
$\newcommand{\Hom}{\operatorname{Hom}}$
$\newcommand{\tr}{\operatorname{tr}}$
$\newcommand{\TM}{\operatorname{T\M}}$
$\newcommand{\sAverage}[1]{\langle#1\rangle} $
$\newcommand{\IP}[2]{\sAverage{#1,#2}}$
$\newcommand{\Cof}{\text{Cof}}$
Here is a sort of "meta-theorem:
Background:
Let $V,W$ be oriented $d$-dimensional inner product spaces, and let
$\phi:\Hom(V,W) \to \mathbb{R}$ a smooth function which is "defined canonically" using only  the structures of metric and orientation. We call such a function $\phi$ a geometric function.
(This notion needs to be made more precise).
Examples: $A \to \det A,A \to \tr A,A \to \text{ the i-th coefficient of the characteristic polynomial of $A$}$
Recall the gradient of $\phi$ is defined by requiring
$$d\phi_A(B)=\IP{\nabla \phi(A)}{B}_{V,W}. $$
Note $\nabla \phi$ can be viewed as a map $\Hom(V,W) \to \Hom(V,W)$, and this is also "canonically defined".

Statement:
Let $E$ and $F$ be rank $d$ oriented vector bundles over $\M$ with smooth metrics and compatible connections.
Let $\phi$ be a geometric function. Then $\phi$ induces a map
$$ \tilde \phi :\Hom(E,F) \to C^{\infty}(\M),$$ by acting pointwise.
Similarly, $\nabla \phi$ induces a map:
$$ \widetilde{\nabla \phi} :\Hom(E,F) \to \Hom(E,F).$$

Then, for all $V \in \Gamma(\TM),A \in \Hom(E,F)$
$$ V\cdot \tilde \phi(A)=\IP{\widetilde{\nabla \phi}(A)}{\nabla^{\Hom(E,F)}_VA}_{E,F}.$$

I am not sure how to prove this. (I tried using the chain rule and pullback connection along a path but failed. I think the definition of goemetric function should be made precise in order to establish the proof).
Further comments:

*

*In the example of $\phi(A)=\det A$, we recover theorem $2$ from the question, since $ \nabla \phi(A)=\Cof A$.

*This metha-theorem can probably be generalized to geometric maps, that is maps from $\Hom(V,W)$ which takes values in spaces "constructed from $V,W$ and $\mathbb{R}$"  (not only $\mathbb{R}$).
A natural exmaple is the cofactor itself:
$A \to \Cof A$ is a map $\Hom(V,W) \to \Hom(V,W)$
