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);}
Theorem
Let A⊂R and let E1,…,En be disjoint and measurable. Then
m∗(A∩[⋃k=1nEk])=∑k=1nm∗(A∩Ek)
NOTE
if E1=E and E2=Ec, this is the definition of measurability.
Proof
Via induction. Trivially true for n=1. Suppose that the equality is true for n=m. Now, suppose we have pairwise disjoint measurable sets E1,…,Em+1 and A⊂R. Since Ek∩Em+1=∅ for all k, we have (since Em+1 is measurable ) that
A \cap \left[ \bigcup_{k=1}^{m+1} E_{k} \right] \cap E_{m+1} &= A \cap E_{m+1} \\
\text{and}\quad A \cap\left[ \bigcup_{k=1}^{m+1} E_{k} \right] \cap E^c_{m+1} &= A \cap \left[ \bigcup_{k=1}^m E_{k} \right] \\
\implies m^*\left( A \cap \left[ \bigcup_{k=1}^{m+1}E_{k} \right] \right) &= m^*\left( A \cap \left[ \bigcup_{k=1}^{m+1} E_{k} \right] \cap E_{m+1} \right) + m^*\left( A \cap\left[ \bigcup_{k=1}^{m+1} E_{k} \right] \cap E^c_{m+1} \right) \\
&= m^*(A \cap E_{m+1} ) + m^*\left(A \cap \left[ \bigcup_{k=1}^m E_{k} \right] \right) \\
&= m^*(A \cap E_{m+1}) + \sum_{k=1}^m m^*(A \cap E_{k})
\end{align}$$
Where the last inequality is due to the induction hypothesis. Thus the result follows via induction.
$$\tag*{$\blacksquare$}$$