Manuscript Offprint
arXiv:2611.22948Symmetries of Counterfactuals: Identification and Testability of Counterfactual Maps from Covariate Heterogeneity
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
SCM structural causal model rhs right hand side lhs left hand side w.l.o.g. without loss of generality CI conditional independence KR Knothe-Rosenblatt
\jmlrpages
Symmetries of Counterfactuals: Identification and Testability of Counterfactual Maps from Covariate Heterogeneity
Abstract
In general, counterfactuals are not identified from data alone, because many causal models produce the same observed distributions but different counterfactuals. A common approach to circumvent this problem is to restrict the mechanism to a class in which it becomes unique, such as triangular monotone maps or optimal transport maps. However, whether the assumed class is correct is usually not examined. In this work, we study what the data can tell us when covariates are available that influence the outcome only through its latent cause. First, we characterise all counterfactual maps that are consistent with the data. They differ from the true map by a group of symmetries that preserve the conditional outcome distributions given the covariates. The more these distributions vary across covariate values, the smaller the group. Second, we show that for the classes above, consistency with the data is equivalent to a single conditional independence, which yields a test of the assumed class. We illustrate both results on synthetic data and on the ACTG 175 HIV trial.
1 Introduction
Suppose an HIV-infected patient was treated with zidovudine (ZDV) and their CD4 and CD8 cell counts were measured after 20 weeks. Would the counts have been different had the patient instead received zidovudine plus didanosine (ZDV+ddI)? A randomised trial such as ACTG 175 (Hammer et al., 1996) tells us how the two treatments affect the counts on average, but a personalised recommendation requires us to answer the question for this patient under a treatment they did not receive. Such questions are called counterfactual. Counterfactuals play an important role in medicine, fairness (Kusner et al., 2017), and in explainability of algorithmic decisions (Karimi et al., 2021). We return to the ACTG 175 example with real data in Section 6.2.
Counterfactual questions cannot be answered from data alone (Pearl, 2009). Even if the outcome distributions under both treatments were known exactly, the data would not reveal how individual outcomes are linked across treatments. In general, infinitely many mechanisms (or outcome functions) produce the same observed distributions and give different answers for the same patient.
A common way to circumvent this problem is to restrict the causal model to a structured class in which it becomes unique, for instance triangular monotone maps, as implemented by autoregressive normalising flows (Khemakhem et al., 2021), or optimal transport maps (Ribeiro et al., 2025). Within such a class the counterfactual is point identified, but different classes give different answers, and whether the assumed class is correct is usually not examined. In general, it cannot be: the class is chosen precisely because, without additional information, the data does not determine the outcome function.
In this work, we ask what the data can say about the outcome function once covariates are available that are associated with the latent cause of the outcome but do not cause the outcome directly. The covariates need not be confounders. What matters is that they are informative about the latent cause, so randomised trials with informative baseline covariates are as useful as observational data. Our contributions are the following.
- Characterisation of symmetries (Section 4, Theorem 5). The counterfactual maps consistent with the data are exactly the true map composed with a transformation that preserves the conditional outcome distributions given the covariates. These transformations form a group, the symmetry group.
- Two extremes (Propositions 6 and 7). We show that a heterogeneity condition proposed by Nasr-Esfahany et al. (2023) for continuous treatments makes the symmetry group trivial also for discrete treatments so that counterfactuals are point identified. Without any heterogeneity, every outcome is a possible counterfactual.
- Testability (Section 5, Theorem 11). For a candidate outcome function, a single ci (ci) condition is equivalent to data consistency and passing the test identifies the counterfactual map up to the symmetry group. Some structural classes single out one outcome function, so testing it becomes a test about the whole structural class. We show how to measure the resolution of the test along rotations of the latent (Proposition 12).
- Experiments (Section 6). We illustrate the results on synthetic data and apply the ci test to the ACTG 175 trial, where it rejects a reflected map decisively but cannot distinguish the triangular monotone and optimal transport classes. We quantify the resolution of the test on this data.
2 Background and Problem Setup
This section introduces our notation, recalls structural causal models, and states the assumptions under which our results hold.
Notation.
Random variables are denoted by capital letters and their realisations by lower-case letters. We write for the distribution of a random variable , i.e. the probability measure , and for its density. For a measurable map , the pushforward of under is .
Definition 1 (Structural causal model).
A scm (scm) is a tuple consisting of endogenous variables , exogenous variables with joint distribution , and structural functions such that , where indexes the direct causes of .
An scm induces a causal graph with nodes and an edge whenever , and a distribution over . The exogenous variables are unobserved. Two scm over the same endogenous variables are observationally equivalent if they induce the same . An intervention replaces by the constant , and we write for the resulting scm and for the interventional distribution.
Problem setup.
Let be an scm where takes values in a finite set , takes values in , and takes values in . Let be a family of functions with .
Assumption 2.
We make the following structural assumptions about .
(i) (ii) (iii) for all , i.e. is a bijection with and continuously differentiable (iv) Overlap: for all and
The causal graph of this scm is shown in Figure 1.
V$$A$$Y$$U
Figure 1: Causal graph of our setup. The latent variable is drawn as a dashed node. The dashed edge between and denotes that they may be dependent.
The variable represents an outcome variable of interest and the variable some treatment that effects through the function . We introduce the following shorthand notation for the distributions we use most often: . The variable is sufficient to control for confounding between and , because . The first equality follows from the definition of the interventional distribution and Assumption 2 (i), and the second one from marginalising over and using Assumptions 2 (ii) and (iv). We therefore may write and interchangeably.
Definition 3 (Data consistency).
We say that an scm is data consistent if it is observationally equivalent to the true scm , i.e. its induced data distribution is equal to the observed data distribution , and if it satisfies Assumption 2.
Definition 4 (Counterfactual map and outcome).
We call the counterfactual map from to for outcome function . Given an observation , we call the counterfactual outcome of under .
In our setup, this definition corresponds exactly to the classical abduction, action, prediction framework for counterfactual inference proposed by Pearl (2009).
Given an observation , practical applications often require us to answer the counterfactual question what the outcome would have been had the treatment been . After reviewing related work in the next section, we will characterise the set of all counterfactual maps that are data consistent in Section 4.
3 Related Work
Non-identifiability and partial identification.
For a one-dimensional outcome and a strictly monotone outcome function, counterfactuals are identified: the latent is the rank of the outcome, and the counterfactual map is the quantile-to-quantile map between treatment arms (Lu et al., 2020; Nasr-Esfahany and Kiciman, 2023). Without monotonicity, counterfactuals are not identified even in one dimension, and Melnychuk et al. (2023) derive bounds that depend on the curvature of the outcome function. In more than one dimension, bijectivity alone does not help: many scm with bijective outcome functions induce the same observed distribution but different counterfactuals (Nasr-Esfahany and Kiciman, 2023). Our Theorem 5 describes this set of scm exactly, and Proposition 7 shows that without covariate heterogeneity it is as large as it can be.
Point identification through structured classes.
To restore point identification, the outcome function is restricted to a class in which it is unique. De Lara et al. (2024) use optimal transport maps between the interventional distributions as counterfactual maps. Such maps are unique for a given cost, but they do not compose: transporting from to and then to need not agree with transporting from to directly. Ribeiro et al. (2025) require the outcome functions themselves to be optimal transport maps from a fixed latent reference distribution , which yields transitive counterfactual maps but, as we show in Appendix A.2.2, makes them depend on the choice of . The other common class consists of triangular monotone outcome functions, which are unique for any reference distribution and are implemented by autoregressive normalising flows (Khemakhem et al., 2021; Javaloy et al., 2023; Chen and Du, 2025). Deep structural causal models (Pawlowski et al., 2020; Balgi et al., 2025) learn outcome functions in such classes from data. Closest to our work, Nasr-Esfahany et al. (2023) give a sufficient condition for point identification of bijective outcome functions when covariates of the outcome are available and the treatment is continuous. We adapt it to discrete treatments in Proposition 6 and characterise what remains unidentified when it fails.
Nonlinear ICA.
Our setting is related to nonlinear ICA with auxiliary variables. There, a latent variable is observed through an unknown invertible transformation, which is not identifiable from the observed distribution alone (Hyvärinen and Pajunen, 1999). Identifiability up to a restricted class of transformations is recovered when an auxiliary variable modulates the latent distribution sufficiently (Hyvarinen et al., 2019; Khemakhem et al., 2020). In our setup the covariate plays the role of the auxiliary variable, and the condition of Proposition 6 is an analogue of the sufficient-variability conditions in that literature. Our target differs: we are interested in the counterfactual map rather than in the latent itself, and we use the auxiliary variable not only for identification but to test a hypothesised model class.
4 Symmetry Group for Counterfactuals
(a) marginalY\mid\doop(A=0)$$Y\mid\doop(A=1)$$f_{1}\circ f_{0}^{-1}(b) conditional on V$$Y\mid\doop(A=0),\,V=v$$Y\mid\doop(A=1),\,V=v$$V\!=\!v_{0}$$V\!=\!v_{1}$$V\!=\!v_{0}$$V\!=\!v_{1}$$f_{1}\circ f_{0}^{-1}
Figure 2: The transport map pushes forward to (a). Conditioning on does not change the map, but it must now also push each conditional distribution to for every (b, shaded regions). The more these conditional distributions vary with , the fewer maps satisfy the constraint.
Before we formally state our characterisation of the set of data consistent counterfactual maps, we provide some intuition. Let us assume for now that is binary and we would like to know the counterfactual map from to . Then we know that this map has to transport the interventional distribution of to the distribution of . We call this the marginal transport condition and illustrate it in Figure 2 (a). In more than one dimension, there are infinitely many diffeomorphisms that can realise this transport. For example, when is a standard Gaussian, then where is a rotation is another such function. However, according to our setup, the counterfactual map also has to transport the conditional distribution of to the distribution of for all . We call this the conditional transport condition (Figure 2 (b)). At the same time, the counterfactual map does not change with because is not a direct cause of according to Assumption 2 (i). Therefore, every new conditional distribution adds another restriction, so heterogeneity of with respect to helps to find the correct counterfactual map. This can be seen in Figure 2 (b), where for example the bottom two points cannot be moved to any of the top two points, because has no support there. In general the conditional transport condition introduces additional constraints even when the supports overlap.
We characterise the exact set of counterfactual maps that are consistent with the data in the following theorem.
Theorem 5 (Counterfactual Symmetry Group).
Let with and let . The set of counterfactual maps achievable by data consistent scm is exactly . Furthermore, for all the tuple with the composition operator is a group.
Theorem 5 tells us that the counterfactual maps from to that are consistent with the data differ exactly by those transformations that preserve the conditional distribution for . It furthermore allows us to characterise the set of counterfactual outcomes for an observation under intervention that can be reached by data consistent scm as where is the orbit of under . When , , and are clear from the context, we call the identified set of counterfactuals. Counterfactuals are point identified if for all . In particular, counterfactuals are point identified if and only if since is a bijection.
Proposition 6 shows that a condition proposed by Nasr-Esfahany et al. (2023) for continuous treatments also yields point identification for discrete treatments, and connects it to the symmetry group .
Proposition 6 (Point identification).
Let be continuously differentiable. If there exist values with such that
then is trivial for all , i.e. .
The condition requires sufficiently different conditional distributions of and is sufficient for point identification. Section 6.1 illustrates how the symmetry group shrinks as their number grows. The opposite extreme is when there is no heterogeneity at all, as stated in Proposition 7.
Proposition 7 (No heterogeneity).
Let and let have a smooth, everywhere positive density. If (equivalently, for ), then for all and every ,
What we can conclude from Proposition 6 and from Proposition 7 is that enough heterogeneity in the data reduces the symmetry group to , while independence of and makes the group so large that counterfactuals are fundamentally unidentified. Loosely speaking, we can say that heterogeneity helps identifiability while no heterogeneity destroys it.
5 Testability of Structural Assumptions
Theorem 5 describes what the data can say about counterfactual maps in general. In practice, one usually assumes a structured class of outcome functions, such as triangular monotone or optimal transport maps, for which the marginal transport condition already determines the outcome function (Figure 2 (a)). We show that the conditional transport condition (Figure 2 (b)) makes the assumption testable: a hypothesised outcome function is compatible with the data if and only if a single ci holds, and the more heterogeneous the conditional distributions are, the more this test can tell us.
Definition 8 (Function and model classes).
Let
For a function class and a distribution on , the model class is the set of scm that satisfy Assumption 2 with for all and .
We write if for all . Triangular monotone maps are what autoregressive normalising flows implement, and gradients of convex functions are the optimal transport maps for the quadratic cost.
Definition 9 (Selective class).
A model class is called selective if for every there is at most one (up to equality) with . If such maps exist for all , we write for them and call the canonical outcome function and the canonical counterfactual map.
For any absolutely continuous , both and are selective (Appendix A.2.1), so the marginal transport alone, the only constraint available without covariates, already singles out one outcome function. For the canonical outcome function is called the kr (kr) map, and for the Brenier map. The two classes differ in how they depend on the choice of . For the canonical counterfactual map does not depend on (Appendix A.2.1), so the reference distribution can be chosen freely. For it does in general depend on (Appendix A.2.2), so the reference distribution is part of the hypothesis being tested.
Remark 10.
The reason for this difference is that the proof for (Appendix A.2.1) relies on closure under composition of triangular monotone maps. The composition of two gradients of convex functions is in general not a gradient of a convex function, so the argument does not carry over to , and the counterexample in Appendix A.2.2 shows that uniqueness within for a fixed , as in Theorem 4.12 of Ribeiro et al. (2025), does not extend across reference distributions.
The canonical outcome function of a selective class is the only candidate for a data-consistent scm within the class, because it is the only one that satisfies the marginal transport condition (Appendix A.2.4). This follows from the definition of a selective class, but the definition says nothing about the conditional transport condition, which is what data consistency requires. Theorem 5 characterises the set of data-consistent counterfactual maps, but it does not tell us how to check whether a given outcome function belongs to it. Theorem 11 provides such a check in the form of a single ci condition.
Theorem 11 (Testability).
Let for all . Then the following are equivalent:
(i) there exists a data-consistent scm with outcome function , (ii) , (iii) for all .
Y\mid A=0,\,V=v$$Y\mid A=1,\,V=v$$U\mid V=v$$f_{0}$$f_{1}(a) Both conditionals come from one latent distribution.Y\mid A=0,\,V=v$$Y\mid A=1,\,V=v$$h_{A}^{-1}(Y)\mid V=v$$h_{0}^{-1}$$h_{1}^{-1}(b) Pulled back, the conditionals must coincide.
Figure 3: Intuition for (ii) of Theorem 11. (a) Since , both conditionals are images of the same latent distribution. (b) Pulled back with , they must therefore coincide. Requiring this for every is the independence of Theorem 11 (ii). In the example in (b) they do not coincide, so an eventual hypothesis test will likely be rejected.
The ci requirement (ii) in Theorem 11 is a testable form of the conditional transport condition from Section 4: for binary it holds if and only if transports to for . Testing whether the distribution induced by the outcome function is equal to the observed distribution directly is not possible, because the distribution of the latent conditioned on is unspecified for a model class even when is fixed. Condition (ii) is this comparison with the latent eliminated: both arms are pulled back to the latent space where they must agree (Figure 3).
Theorem 11 tells us when an outcome function is consistent with the data, not whether its counterfactual map is the true one. If the ci test rejects, then the counterfactual map differs from the true one. If it does not reject, then the counterfactual map lies in and may still differ from the true map by an element of . The more the conditional distributions vary across covariate values, the smaller the group and the more wrong counterfactual maps the test can detect. When is trivial, every wrong map is detectable and passing the test identifies the true counterfactual map. In the opposite case where is independent of , the canonical outcome function of any selective class is the outcome function of a data-consistent scm, because the conditional transport condition then reduces to the marginal one (Appendix A.2.4). Without heterogeneity, structural assumptions are therefore not testable.
In practice, a ci test on limited data may lack the power to reject an outcome function that is not data consistent, so a non-rejection could be either due to low power or because the outcome function is indeed data consistent. The following proposition lets us tell the two apart along rotations.
Proposition 12 (Resolution along rotations).
Let , for all , and fix . For a rotation by angle define by and for . Let be an arc of angles of length such that for every outside of , there exists no data-consistent scm with outcome function . Then within , there is at most one for which a data-consistent scm with outcome function exists.
Intuitively, if two rotations of the latent were both data consistent, then the rotation by their difference would be an element in , so applying it repeatedly would produce further data-consistent rotations, and some of them would land among the rejected angles. The same argument applies in to rotations within a fixed two-dimensional plane.
Suppose the ci test rejects for all outside an arc of length and does not reject inside . By Proposition 12, at most one of the unrejected outcome functions is data consistent. All others are wrong maps that the test fails to detect, so the width reflects the power of the test and not the size of . We illustrate this in our experiments in Section 6.2, where we choose for the canonical outcome function of a selective class with . Then, satisfies the marginal transport condition by definition and so does every because is rotation invariant. Because every satisfies the marginal transport condition, informs us about the power of the test to detect whether an outcome function fails to satisfy the conditional transport conditions on the given data. We then refer to as the resolution of the test on the data and for the chosen .
6 Experiments
In this section, we present two experiments. The first experiment uses synthetic data and illustrates how the identified set of counterfactuals varies with different levels of heterogeneity of . The second experiment applies the ci test (Theorem 11) to real-world data and evaluates the resolution of the data along rotations (Proposition 12).
6.1 Synthetic Data: Identified Sets and Power of the Test
We consider a two-dimensional outcome with a binary treatment and a latent with . The covariate takes values and partitions the latent space into angular sectors: indicates the sector of a noisy version of , and a parameter controls how strongly the conditional distributions differ across sectors. The outcome is generated as for and for , i.e. and , for one of three matrices that define three settings. The matrices induce the same interventional distributions and differ only in the conditional distributions (Figure 4). In Setting 1, is the kr map in ordering , so . In Setting 2, is the Brenier map, so . In Setting 3, with the reflection , so lies in neither class. The exact data generating process is given in Appendix B.1.
Figure 4: Observed distributions for the three different settings when coloured by . (a) shows which is equal in all settings. (b–d) show for the three settings. Larger points denote the means of .
Identified set.
Figure 5 shows how the identified set shrinks as the number of angular sectors grows. According to Theorem 5, depends only on the family , which is the same in all three settings. Therefore, while the figure shows Setting 2, the following remarks apply to all three settings.
Figure 5: Identified sets in the synthetic example (Setting 2) for an increasing number of sectors . The background shows the conditional distributions , coloured by . Three factual points , and the identified set of the counterfactual of each : the whole plane for , two points for , and the single point for .
For , is constant and consists of all maps preserving . Any point can be moved to any other point by such a map, so (Proposition 7). For , one can show (Appendix B.1) that with , so the identified set has two points, . Since , this also means that for , Settings 1 and 3 induce the same conditional distributions and cannot be distinguished by any test. For , no non-trivial map preserves all simultaneously, so and counterfactuals are point identified.
Power of the test.
For , is trivial, so any wrong outcome function is detectable. We evaluate the model classes with and with , i.e. with the correct reference distribution. Figure 6 shows how the rejection rate of the ci test from Theorem 11 depends on how strongly the conditional distributions differ across , which in our data generating process is controlled by (panel (b)). Since is discrete and binary, testing amounts to two-sample tests of , one for each value . We test for equal means with James’ two-sample statistic in each stratum (James, 1954) (details in Appendix B.1).
Figure 6: (a) Rejection rate of the ci test against for three combinations of true outcome function and hypothesised model class and three sample sizes. (b) The conditional distributions for two values of .
Panel (a) shows that larger increases power in much the same way as more samples do. When the hypothesised model class is correct (green: true , hypothesis ), the rejection rate stays at the nominal level . When the data is generated with but the hypothesised model class is (red), then the class is rejected almost always for , even with . When the hypothesised model class is but the true outcome function is (purple), rejection requires more data or larger .
6.2 Testing Structural Assumptions on ACTG 175
We evaluate the model classes (in both orderings) and with on the ACTG 175 trial (Hammer et al., 1996), which randomly assigned HIV-infected adults to different treatment arms. We compare zidovudine monotherapy (ZDV, , ) with zidovudine plus didanosine (ZDV+ddI, , ). The outcome is the vector of CD4 and CD8 (log-transformed and standardised) cell counts 20 weeks after the start of treatment. The dataset also contains the CD4 and CD8 counts just before the start of the treatment, which are strongly associated with the outcome. We use them as under the assumption that they are associated with only through the patient’s latent state (Assumption 2 (i)), which is plausible if represents the patient’s underlying immune status. We discretise these baseline CD4 and CD8 counts into terciles, so takes nine values. Since the treatment was randomised, and , so we have no confounding but heterogeneous conditional distributions (Appendix Figure 8(b)).
Canonical counterfactual maps.
For we fit one autoregressive normalising flow per arm by maximum likelihood, in the orderings (CD4, CD8) and (CD8, CD4). For we solve a discrete optimal transport problem between samples from and the observed outcomes of arm and extend the resulting discrete map to by -nearest-neighbour regression on the matched pairs (). The three counterfactual maps closely agree: all three predict that ZDV+ddI increases the CD4 count of almost every patient and leaves CD8 essentially unchanged (Appendix Figure 9). The median distance between the kr and Brenier predictions over the ZDV sample is standard deviations. The largest disagreement is at high CD4 and low CD8, where predicts a decrease and an increase in CD8, but there is little data in that region.
Testing data consistency.
We apply the ci test of Theorem 11 as in Section 6.1, with one two-sample James’ statistic per value of . None of the three classes is rejected (, , for , , ). Figure 7(a–c) shows why: for each , the pulled-back conditional ZDV mean lands on the pulled-back conditional ZDV+ddI mean , which is implied by requirement (ii) in Theorem 11 and exactly what we test for. Our test therefore only checks a necessary consequence of (ii) and has less power than a full distributional ci test.
Figure 7: Pulled-back conditional means of the observed ZDV outcome (circles) and the observed ZDV+ddI outcome (crosses), coloured by , for the three hypothesised classes (a–c) and the reflected Brenier map (d). A data-consistent map must pull back each treated mean onto its untreated counterpart (compare Figure 3 (b)). The reflection does not achieve that.
As discussed in Section 5, non-rejection does not mean that the three maps are correct, only that each lies in . Since the three maps differ, either is non-trivial, or the test lacks the power to reject the wrong ones because they are too similar given the resolution of the test on the data. We can measure how different two maps have to be before the test distinguishes according to Proposition 12.
Power on real data.
We construct new hypothesised outcome functions that agree with on the marginals and , but differ in the counterfactual map. For any orthogonal matrix , we have that , because is invariant to rotations and reflections. Similar to Proposition 12, we can define with counterfactual map , without changing the marginal transport and . We can test if requirement (ii) of Theorem 11 is satisfied using the same ci test as before. For example, for the reflection , Figure 7(d) illustrates why the independence test rejects it (): the pulled-back conditional means differ between the treatment arms.
We repeat this ci test for rotation matrices (Appendix Figure 10). The test does not reject for , rejects at for all three base classes except at , and rejects with for . Proposition 12 with then implies that at most one of the unrejected rotated maps is data consistent and the remaining unrejected rotations are wrong maps that the test fails to detect. The pulled-back data under the three maps differ from each other by a median rotation of to , but the part of this rotation that differs between the two arms, which is all the test can detect, is less than for every pair of classes. This lies within and explains why all three maps pass the ci test.
7 Discussion
Our results rely on the assumption that the covariate affects the outcome only through the latent . This assumption enters the ci test only jointly with the hypothesised outcome function, so a rejection may indicate a wrong model class or a violated assumption, and a non-rejection does not verify the assumption, since a direct effect of on can leave the conditional transport condition satisfied for a map that is not the true counterfactual map. What matters beyond this is heterogeneity of the latent distribution across the values of . It determines how much the data says about the counterfactual map. The covariate does not need to be a confounder for this, so randomised trials with informative baseline covariates are as useful as observational data.
A non-rejection can be due to a lack of power or to a genuine symmetry in . Proposition 12 lets us tell the two apart along rotations of the latent, but only in that direction and for the given outcome function. Symmetries that do not lie on a rotation path, such as reflections, have to be tested separately. In our experiments we only test for equal conditional means, which is a necessary consequence of the ci condition, and more general kernel based ci tests can be used without changing the theory. In the synthetic example we treat the canonical outcome functions as known, whereas in practice they are estimated, and we do not analyse how estimation error affects the test.
Future work may investigate how the elements of can be computed or bounded to allow for partial identification of counterfactuals. Another line of research may use an instrumental variable instead of the covariate similar to the control function approach of Imbens and Newey (2009).
References
S. Balgi, A. Daoud, J. M. Peña, G. T. Wodtke, and J. Zhou Deep Learning With DAGs. Sociological Methods & Research 54 (4), pp. 1624–1682 (EN). External Links: ISSN 0049-1241, Link, Document Cited by: §3.
V. I. Bogachev, A. V. Kolesnikov, and K. V. Medvedev Triangular transformations of measures. Sbornik: Mathematics 196 (3), pp. 309–335. External Links: ISSN 1468-4802, Document Cited by: Lemma 14.
W. M. Boothby Transitivity of the Automorphisms of Certain Geometric Structures. Transactions of the American Mathematical Society 137, pp. 93–100. External Links: ISSN 0002-9947, Link, Document Cited by: §A.1.4.
Y. Chen and D. Du Exogenous Isomorphism for Counterfactual Identifiability. arXiv. Note: arXiv:2505.02212 [cs.LG] External Links: Link, Document Cited by: §3.
L. De Lara, A. González-Sanz, N. Asher, L. Risser, and J. Loubes Transport-based counterfactual models. Journal of Machine Learning Research 25 (136), pp. 1–59. External Links: Link Cited by: §3.
S. M. Hammer, D. A. Katzenstein, M. D. Hughes, H. Gundacker, R. T. Schooley, R. H. Haubrich, W. K. Henry, M. M. Lederman, J. P. Phair, M. Niu, M. S. Hirsch, and T. C. Merigan A Trial Comparing Nucleoside Monotherapy with Combination Therapy in HIV-Infected Adults with CD4 Cell Counts from 200 to 500 per Cubic Millimeter. New England Journal of Medicine 335 (15), pp. 1081–1090 (en). External Links: ISSN 0028-4793, 1533-4406, Link, Document Cited by: §1, §6.2.
A. Hyvärinen and P. Pajunen Nonlinear independent component analysis: Existence and uniqueness results. Neural Networks 12 (3), pp. 429–439. External Links: ISSN 0893-6080, Link, Document Cited by: §3.
A. Hyvarinen, H. Sasaki, and R. Turner Nonlinear ICA Using Auxiliary Variables and Generalized Contrastive Learning. In Proceedings of the Twenty-Second International Conference on Artificial Intelligence and Statistics, pp. 859–868 (en). External Links: ISSN 2640-3498, Link Cited by: §3.
G. W. Imbens and W. K. Newey Identification and Estimation of Triangular Simultaneous Equations Models without Additivity. Econometrica 77 (5), pp. 1481–1512. External Links: ISSN 00129682, 14680262 Cited by: §7.
G. S. James Tests of Linear Hypotheses in Univariate and Multivariate Analysis when the Ratios of the Population Variances are Unknown. Biometrika 41 (1/2), pp. 19–43. External Links: ISSN 0006-3444, Link, Document Cited by: §6.1.
A. Javaloy, P. Sanchez-Martin, and I. Valera Causal normalizing flows: from theory to practice. In Advances in Neural Information Processing Systems, A. Oh, T. Naumann, A. Globerson, K. Saenko, M. Hardt, and S. Levine (Eds.), Vol. 36, pp. 58833–58864. External Links: Link, Document Cited by: §3.
A. Karimi, B. Schölkopf, and I. Valera Algorithmic Recourse: from Counterfactual Explanations to Interventions. In Proceedings of the 2021 ACM Conference on Fairness, Accountability, and Transparency, FAccT ’21, New York, NY, USA, pp. 353–362. External Links: ISBN 978-1-4503-8309-7, Link, Document Cited by: §1.
I. Khemakhem, D. Kingma, R. Monti, and A. Hyvarinen Variational Autoencoders and Nonlinear ICA: A Unifying Framework. In Proceedings of the Twenty Third International Conference on Artificial Intelligence and Statistics, pp. 2207–2217 (en). External Links: ISSN 2640-3498, Link Cited by: §3.
I. Khemakhem, R. Monti, R. Leech, and A. Hyvarinen Causal Autoregressive Flows. In Proceedings of The 24th International Conference on Artificial Intelligence and Statistics, pp. 3520–3528 (en). External Links: ISSN 2640-3498, Link Cited by: §1, §3.
M. J. Kusner, J. Loftus, C. Russell, and R. Silva Counterfactual Fairness. In Advances in Neural Information Processing Systems, I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (Eds.), Vol. 30. External Links: Link Cited by: §1.
C. Lu, B. Huang, K. Wang, J. M. Hernández-Lobato, K. Zhang, and B. Schölkopf Sample-Efficient Reinforcement Learning via Counterfactual-Based Data Augmentation. arXiv. Note: arXiv:2012.09092 [cs.LG] External Links: Link, Document Cited by: §3.
R. J. McCann Existence and uniqueness of monotone measure-preserving maps. Duke Mathematical Journal 80 (2), pp. 309–323 (en). External Links: ISSN 0012-7094, 1547-7398, Link, Document Cited by: Lemma 15.
V. Melnychuk, D. Frauen, and S. Feuerriegel Partial Counterfactual Identification of Continuous Outcomes with a Curvature Sensitivity Model. In Advances in Neural Information Processing Systems, Vol. 36, pp. 32020–32060. External Links: Link, Document Cited by: §3.
A. Nasr-Esfahany, M. Alizadeh, and D. Shah Counterfactual Identifiability of Bijective Causal Models. In Proceedings of the 40th International Conference on Machine Learning, A. Krause, E. Brunskill, K. Cho, B. Engelhardt, S. Sabato, and J. Scarlett (Eds.), Proceedings of Machine Learning Research, Vol. 202, pp. 25733–25754. External Links: Link Cited by: 2nd item, §3, §4.
A. Nasr-Esfahany and E. Kiciman Counterfactual (Non-)identifiability of Learned Structural Causal Models. arXiv. Note: arXiv:2301.09031 [stat.ML] External Links: Link, Document Cited by: §3.
N. Pawlowski, D. Coelho de Castro, and B. Glocker Deep Structural Causal Models for Tractable Counterfactual Inference. In Advances in Neural Information Processing Systems, H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin (Eds.), Vol. 33, pp. 857–869. External Links: Link Cited by: §3.
J. Pearl Causality. Cambridge University Press (en). External Links: ISBN 978-0-521-89560-6 Cited by: §1, §2.
F. D. S. Ribeiro, A. Santhirasekaram, and B. Glocker Counterfactual Identifiability via Dynamic Optimal Transport. In Advances in Neural Information Processing Systems, External Links: Link Cited by: §1, §3, Remark 10.
P. A. Smith A Theorem on Fixed Points for Periodic Transformations. The Annals of Mathematics 35 (3), pp. 572–578. External Links: ISSN 0003486X, Link, Document Cited by: §A.1.3.
Appendix A Proofs
A.1 Symmetry Group
A.1.1 Theorem 5: Symmetry Group
Proof.
Instead of for counterfactuals , we write the proof for counterfactuals without loss of generality. We first show that for every there exists an scm with alternative outcome function that satisfies , and that is observationally equivalent to with outcome function .
We prove this claim by constructing an alternative outcome function as
Because by assumption , this outcome function then satisfies
by construction. We furthermore have that
which together implies for all and and therefore observational equivalence. The constructed scm satisfies Assumption 2.
We now show that for a given alternative outcome function and conditional exogenous distribution that define an observationally equivalent scm , there exists an with . Let us define a candidate (note that does indeed not vary with ). Then by definition . It remains to show that . Because of the observational equivalence of we have that
This implies
But because of , this implies that
At the same time we have that if and only if because is a measurable bijection with . It therefore follows that , which means exactly .
It remains to show that is a group. We show that it satisfies all properties of a group.
(i) Associativity. Let . Then, for every , We therefore have (ii) Identity element. Let denote the identity map. Clearly, and Thus, . Moreover, for every we have Therefore, is the identity element of . (iii) Inverse elements. Let . Since its inverse satisfies Furthermore, since applying to both sides gives Hence, . (iv) Closure under composition. Let . Since and are -diffeomorphisms, Moreover, Therefore,
∎
A.1.2 Point-identification under trivial symmetry
We now prove the claim that counterfactuals are point identified if and only if is trivial.
Proof.
() Let counterfactuals be point identified and let us assume there exists with . Then there exists a such that . Consequently we have for that because of the bijectivity of . Therefore, counterfactuals are not point identified which is a contradiction.
() Let . Fix and . Then according to Theorem 5, all counterfactual maps achievable by data consistent scm are exactly . Because the set contains only one element, counterfactuals are point identified. ∎
A.1.3 Proposition 6: Nasr-Esfahany
Proof.
Let be fixed, , and .
Then
We know that and for all . Note that if we can show that , then it immediately follows that and is trivial.
Let be the pdf of . According to the change of variables formula we then have
This equality implies that if , then . If for any and any we had , then would have a local minimum in and we would therefore have . Then, the -th row would consist only of zero entries so the non-zero determinant assumption would be violated. We therefore conclude that for all . If we then divide Equation 1 for by itself for , we get
If we then define
then Equation 2 implies
We observe that if is injective, then Equation 3 already implies .
Note that if for all , then also -times preserves the law. We therefore also have
We will now show that for each , is locally injective, i.e. there exists a neighbourhood of restricted to which is injective.
According to our assumption we have
At the same time we can use basic rules for calculating determinants to show that for all . For each row we first subtract times the first row to get
At the same time we have
which implies
Using the Laplace expansion for the first column gives us
Consequently, we can conclude that and the inverse function theorem therefore implies that is locally injective everywhere.
We now show the following lemma.
Lemma 13.
if there is a fixed point of , i.e. , then every point in is a fixed point and consequently .
Because is continuous, for every we can find a neighbourhood of such that
That means that we can find a neighbourhood of that is small enough such that it is a subset of a neighbourhood of for which restricted to is injective. According to Equation 4 we then have
In other words, every point in is also a fixed point. Because the initial fixed point was arbitrary, that means that for any fixed point we can find a neighbourhood that only contains fixed points. This implies that the fixed point set is open.
At the same time we have that the fixed point set is closed which can be seen as follows. Let , i.e. is continuous with . Then the fixed point set is exactly
Because is continuous and is closed we conclude that the fixed point set must be closed.
The only sets in that are both open and closed are the empty set and itself, and because by assumption is in the fixed point set, we can conclude that the fixed point set is equal to and consequently .
We will now show that has finite order, i.e. there exists a such that . Let be the neighbourhood of a point where is injective. Because of we then have . There are now two possibilities: Either 1. the sets are pairwise disjoint or 2. they are not pairwise disjoint.
In the first case we have that are pairwise disjoint. Because preserves the distribution of we have that for all . Because the aforementioned sets are disjoint, we have that
which is a contradiction. Hence we can conclude that we are in case 2 where the sets are not pairwise disjoint.
Then there exist with such that
So there exists such that
By Equation 4 we then have
and because is injective on this implies . Therefore, has a fixed point and according to Lemma 13 it then follows for that .
It now remains to show that the order of is exactly , to rule out finite-order symmetries (e.g. for we have but ). We show this by contradiction and assume that the order of is (i.e. . There then exists a prime that divides and we define . Then has order because and for . Then is a p-group that acts on and according to Smith fixed point theory there then exists a fixed point with (Smith, 1934). But according to Lemma 13 it then follows that which contradicts that has order . We therefore have and .
immediately implies and because was chosen arbitrarily in , this implies that is trivial. ∎
A.1.4 Proposition 7: No heterogeneity
Proof.
Under the hypothesis, . Since has a smooth positive density and , the diffeomorphisms of preserving act transitively on (Boothby, 1969): for every there is with . Hence , and since is a bijection of , . ∎
A.2 Testability
We start by recalling two well established results.
Lemma 14 (Bogachev et al. (2005)).
Let be absolutely continuous on . There is a unique measurable triangular monotone map with . In particular, at most one element of transports to , up to equality. Moreover, is closed under composition and inversion.
Lemma 15 (McCann (1995)).
Let be absolutely continuous on and any distribution on . There is a unique gradient of a convex function with . In particular, at most one element of transports to , up to equality.
A.2.1 and are selective, and the KR counterfactual map does not depend on the reference distribution
Proof.
Let be absolutely continuous. Selectivity of and is the uniqueness statement in Lemmas 14 and 15, applied with for each .
For the second claim, let and be absolutely continuous and let and be the canonical outcome functions of and , assumed to exist. Then for all . The map lies in by closure under composition and inversion, and for every . By Lemma 14, for all , hence
That the analogous statement fails for is shown by the counterexample in Appendix A.2.2. ∎
A.2.2 Remark 10: the Brenier counterfactual map depends on the reference distribution
Let , , , and let be constant, so that Assumption 2 (ii) and (iv) hold trivially. We use that the Brenier map between centred Gaussians and is the linear map with the unique symmetric positive definite satisfying , namely . Every such map is the gradient of the convex function and a -diffeomorphism, hence in .
Define
and let the observed data be and .
First scm. Let and , . Then and for , so the scm with latent distribution and outcome function lies in and is data consistent. Its counterfactual map is
a symmetric matrix.
Second scm. Let and , . Both matrices are symmetric positive definite ( has trace and determinant ), and
so is the Brenier map from to , , and the scm with latent distribution and outcome function lies in and is data consistent. Its counterfactual map is
which is not symmetric. Hence , although both scm have Brenier outcome functions and induce the same observed distribution.
The mechanism is the one described in Remark 10. The Brenier map transports to , and transports to , but it is not symmetric and hence not in . The Brenier map from to is instead. In one dimension this cannot happen, since then coincides with the increasing maps and is closed under composition.
A.2.3 Theorem 11: Testability
Proof.
Throughout, the conditional distributions are defined for every and , because is finite and for by overlap (Assumption 2 (iv)). For the same reason, a statement that holds for holds for every and .
(i) (ii). Let be a data-consistent scm with outcome function and latent , so that and, by Assumption 2 (ii), . Since induces the observed distribution of , the distribution of under the observed distribution equals the distribution of under . Hence .
(ii) (i). The conditional distribution of given and is . By (ii) it does not depend on , so we may define for , independently of the choice of . Let be an scm with , , for all , and , where is the observed distribution. By construction, , for all , and overlap holds, so satisfies Assumption 2. Moreover,
so induces the observed distribution of and is data consistent.
(i) (iii). A data-consistent scm with outcome function has counterfactual maps , and Theorem 5 states that the counterfactual maps of data-consistent scm lie in .
(iii) (ii). Fix . For every there is with . Since preserves and transports to (both for ), we have for
The left-hand side is the conditional distribution of given and , and the right-hand side the one given and . As was arbitrary, this conditional distribution does not depend on the treatment, which is (ii). Note that this direction uses (iii) only for a single fixed and all . ∎
A.2.4 Consequences for selective classes
We prove the two claims made in Section 5 about selective classes.
Proof that the canonical outcome function is the only candidate.
Let be selective and let be data consistent with outcome function and latent . Then by definition of the model class, and for every by the same argument as in Section 2, applied to . Since and the class is selective, for all . ∎
Proof that without heterogeneity every selective class contains a data-consistent scm.
Let , so that and hence for every and . Let be selective with canonical outcome function . Then for every and ,
so the conditional distribution of given and equals for all , which is condition (ii) of Theorem 11 for . By Theorem 11 there is a data-consistent scm with outcome function , and the one constructed in the proof of (ii) (i) has for , hence . It therefore lies in . ∎
A.2.5 Proposition 12: Resolution along rotations
Proof.
Let . Then
and for all , because .
Suppose that for some in there are data-consistent scm with outcome functions and . By Theorem 11, (i) (iii), there are with
Writing , these give
since is a group (Theorem 5), and hence for every . Therefore
For every other treatment we have , so by data consistency of and Theorem 11, (i) (iii). Hence condition (iii) of Theorem 11 holds for the fixed and all targets, which suffices for (iii) (ii) (i) by the note at the end of its proof. A data-consistent scm with outcome function therefore exists for every .
Measured along the circle, , while the complement of is an arc of length . Consecutive angles differ by , which is smaller than the length of that arc, so some lies outside . This contradicts the assumption that no data-consistent scm with outcome function exists for . Hence at most one admits a data-consistent scm with outcome function . ∎
Appendix B Experiments
The code and data for all experiments can be found under https://github.com/marbr987/symmetries_of_counterfactuals.
B.1 Synthetic Example
Data generating process.
We fix and and partition into angular sectors of equal angle . The data is generated as
with , , and mutually independent. Hence and , so there is no confounding in this example. The heterogeneity of in arises solely because depends on through . The conditional latent distributions are noisy versions of the sectors of (Figure 4(a)), and controls how strongly they differ across . Since and , we have , , and . The index selects one of three outcome functions,
All three satisfy , so they induce the same interventional distributions and and differ only in the conditional distributions (Figure 4(b–d)). In Setting 1, is the kr map in ordering , so . In Setting 2, is the Brenier map, so . In Setting 3, applies after reflecting the second coordinate of . This leaves invariant but not , and lies in neither class.
Conditional latent distributions.
Let denote the open angular sectors of angle , centred at the angles , , so that the boundary rays lie at the angles . For the sectors are the right and left half-planes, and for they are the four quadrants rotated by . Write and . Since is jointly Gaussian with , we have , and by symmetry. Bayes’ rule therefore gives
where is the standard normal density on : is reweighted by the posterior probability that lies in sector given . Since , , and because the densities in (11) are continuous and positive, if and only if
Dividing (12) for two strata shows that every preserves the likelihood ratios,
: the identified set has two points.
With we have , so the ratio is the function of alone, which is strictly increasing for . Hence (13) forces , i.e. for a function with . Inserting this into (12) and cancelling the common factor leaves
For fixed the map is a bijection of with non-vanishing derivative, hence strictly monotone, and it transports to itself, so it equals or . By continuity in the same alternative holds for every . Both alternatives do lie in , and therefore
The identified set consists of the true counterfactual and its image under the reflection of the second latent coordinate. Since , Settings 1 and 3 induce the same family for and cannot be distinguished by any test.
: point identification.
Let denote the rotation by . Since and the conditional law of given are invariant under rotations, if and only if satisfies (12) and (13) with the sectors , which are the quadrants , . For the quadrants the posterior factorises, . Applying (13) to the strata and gives , hence by strict monotonicity as in the case . Applying it to and gives in the same way. Hence , so and .
Additional figures.
Figure 4 shows samples with and , and Figure 5 shows samples with , drawn from the same latent sample for every , so that only changes between the panels. The three factual points are the sample points closest to three fixed locations. Figure 6(b) shows samples with .
Test statistic and simulation settings.
For the power experiment we use , sample sizes , and . Since and are known, we use the exact canonical outcome functions rather than estimates: and for and for . These are the same in all three settings because for . The power study thus isolates the effect of heterogeneity on the test from estimation error in . The ACTG 175 example in Section 6.2 uses estimated maps. For each run we draw i.i.d. samples of , compute within each stratum James’ statistic for the two samples and , and sum over the strata. James’ statistic is the two-sample Hotelling statistic with unpooled covariance matrices, with the difference of the two sample means and the sum of the two estimated covariance matrices of the means. Mean independence is a necessary condition for the conditional independence to hold but weaker than a full ci test. Under the null each statistic is asymptotically , so the sum is compared to the quantile at level . Rejection rates in Figure 6 are averaged over independent runs. Error bars show one standard error of the estimated rejection rate. The green curves confirm that the test is well calibrated.
B.2 Real-world example: ACTG 175
Data and preprocessing.
We use the patients of the ZDV arm () and the ZDV+ddI arm () of the ACTG 175 data with CD4 and CD8 counts recorded at week 20. The outcome is the natural logarithm of the two counts at week 20, standardised with one affine map for both arms (mean and standard deviation of the pooled sample). The pooled standardisation matters for , whose canonical map is not invariant to arm-specific rescaling. The covariate is the pair of tercile indices of the baseline CD4 and CD8 counts, with terciles computed on the pooled sample, so takes nine values with to patients per arm and stratum. Figure 8 shows the outcomes and strata.
Canonical outcome functions.
For we fit one autoregressive rational-quadratic spline flow per arm with base distribution in the orderings (CD4, CD8) and (CD8, CD4). Each flow has six spline bins on and an autoregressive conditioner with one hidden layer of units, and is trained by full-batch maximum likelihood for steps with Adam (learning rate , weight decay , cosine learning-rate schedule) at fixed seeds. For we draw a reference sample of size from as a scrambled Halton sequence mapped through the normal quantile function and exactly centred and whitened, solve the assignment problem with quadratic cost between the reference sample and the observed outcomes of arm exactly, and extend the resulting discrete map and its inverse to by -nearest-neighbour regression on the matched pairs (). The maps in Figure 9 are fitted on all patients of each arm.
Test details.
We test with the statistic of Appendix B.1: James’ statistic in each of the nine strata, summed, with as the asymptotic null distribution. We also compute a permutation -value by permuting within strata ( permutations). The two agree to two decimals, and we report the -values in the main text and in Figure 10. For the triangular classes the latents entering the test are cross-fitted: the patients are split at random into two halves, a flow per arm is fitted on each half and pulls back the patients of the other half, so no patient is evaluated with a flow that was fitted on them. For the latent of a patient is the reference point they are assigned to, which is an in-sample quantity. Figure 7 shows the stratum means of these latents.
Power on real data.
For the reflection the test rejects for all three classes with -values between and and a permutation -value of , the smallest value attainable with permutations. For the rotation sweep we evaluate on the grid with the same cross-fitted or in-sample latents, rotating the latents of the ZDV+ddI arm by . Figure 10 shows the -values. The rotation angles quoted in Section 6.2 are computed from the maps fitted on all patients of each arm: for every patient we take the signed angle, counter-clockwise positive, from their pulled-back latent under one class to their pulled-back latent under another, and report the median over all patients of both arms (from to : and from either kr class to : and ) and separately over the patients of each arm ( and , and , and for ZDV and ZDV+ddI, respectively). The difference between the two arms is what the ci test can detect.
Additional figures.
Figure 8: ACTG 175 outcomes. (a) Standardised log CD4 and CD8 counts at week 20 by arm. (b) The ZDV arm coloured by . Circles mark the conditional means . (c) Shift of the conditional means from ZDV () to ZDV+ddI ().
Figure 9: Estimated counterfactual maps from ZDV to ZDV+ddI for the three hypothesised model classes, drawn as arrows on a grid over the ZDV sample.
Figure 10: -value of the ci test for the hypotheses , which transport to for every but rotate the treated latents by . Outside the shown window for all three classes.