const fieldName = "theme"; // Your field with linksconst oldPrefix = "Thoughts/01 Themes/";const newPrefix = "Digital Garden/Topics/";const relatedLinks = dv.current()[fieldName];if (Array.isArray(relatedLinks)) { // Map over the links, replace the path, and output only clickable links dv.el("span", relatedLinks .map(link => { if (link && link.path) { let newPath = link.path.startsWith(oldPrefix) ? link.path.replace(oldPrefix, newPrefix) : link.path; return dv.fileLink(newPath); } }) .filter(Boolean).join(", ") // Remove any undefined/null items );} else { dv.el(dv.current().theme);}
Cauchy-Schwarz Theorem
Let V,⟨,⟩ be an inner product space over K. Then for all x,y∈V we have
∣⟨x,y⟩∣2≤⟨x,x⟩⟨y,y⟩
Or equivalently, if working with a norm induced by an inner product,
∣⟨x,y⟩∣≤∣∣x∣∣⋅∣∣y∣∣
K=C)
For any t,θ∈R it is true that and
(here we prove for
0 &\leq \langle te^{i\theta} + y, te^{i\theta}x,y\rangle \\
&= t^2 e^{i\theta}\overline{e^{i\theta}} \langle x,x \rangle + t e^{i\theta} \langle x,y \rangle + te^{i\theta} \langle y, x \rangle + \langle y, y \rangle \\
&= t^2 \langle x,x \rangle + 2 t Re[e^{i\theta} \langle x,y \rangle] + \langle y, y \rangle \\
\text{choose }\theta \text{ s.t. } Re[e^{i\theta} \langle x,y \rangle] &= \lvert \langle x, y \rangle \rvert \\
&= t^2 \langle x,x \rangle + 2 t \lvert \langle x, y \rangle \rvert + \langle y, y \rangle \\
& \geq 0 \;\;\;\forall t \in \mathbb{R}
\end{aligned}$$
And this is a quadratic in $\mathbb{R}$! So the discriminant must be negative, that is
$$[2\lvert \langle x, y \rangle \rvert]^2 - 4[\langle x,x \rangle \langle y,y \rangle] \leq 0$$
$$\implies \lvert \langle x, y \rangle \rvert^2 \leq \langle x,x \rangle \langle y,y \rangle$$