Model-theoretic Elekes–Szabó for stable and o-minimal hypergraphs | Synapse