Immutability: Proof-by-Set-Theory

Definitions Let a software component denote any function or module with a defined input domain. For a component, $f$, define its effective state space, $S_f$, as $$ \begin{equation} S_f = \mathrm{Input}_f \times \prod_{i \in \mathrm{deps}(f)} D_i. \end{equation} $$Here, $\mathrm{deps}(f)$ denotes the set of all mutable bindings $f$ can observe or mutate, and $D_i$ their value domains. For a referentially transparent component, $g$, $\mathrm{deps}(g) = \varnothing$ definitionally, so it follows that $$ \begin{equation} S_g = \mathrm{Input}_g. \end{equation} $$Next, let $\mathbf{P}$ denote the set of all software components, and $\mathbf{Q} \subset \mathbf{P}$ the subset of referentially transparent components. The containment follows dierctly: every referentially transparent component qualifies as a component, but not the converse (i.e. not every component qualifies as referentially transparent). ...

March 4, 2026 ยท 3 min