Learning and using causal representations