# Proving the Geometric Utilitarian Theorem

This is a supplemental post to [Geometric Utilitarianism (And Why It Matters)](https://www.lesswrong.com/posts/gJGYDsyxj3rZDp86E/geometric-utilitarianism-and-why-it-matters), which sets out to prove what I think are the main interesting results about Geometric Utilitarianism:

*   Maximizing a geometric weighted average $G(\_, \psi)$ can always lead to Pareto optimality.
*   Given any Pareto optimal joint utility $p$, we can calculate weights $\psi$ which make $p$ optimal according to $G(\_, \psi)$.

That post describes why this problem is interesting, but the quick summary is: geometric utility aggregation is a candidate alternative to Harsanyi utility aggregation (which is an [arithmetic weighted average](https://en.wikipedia.org/wiki/Weighted_arithmetic_mean)), which handles some tradeoffs better than Harsanyi aggregation. The resulting choice function is [geometrically rational](https://www.lesswrong.com/s/4hmf7rdfuXDJkxhfg), whereas the Harsanyi choice function is [VNM-rational](https://en.wikipedia.org/wiki/Von_Neumann-Morgenstern_utility_theorem). This post is mostly math supporting the main post, with some details moved to their own posts later in this sequence.

We as a community, and I individually, would need pretty strong reasons to endorse a theory of rationality based on a broadening of the VNM axioms. I've been sufficiently radicalized by [Scott Garrabrant](https://www.lesswrong.com/users/scott-garrabrant), and thinking about how each system handles common decision problems, that I think more work in this direction is potentially very valuable. Here's how I solved a couple of the subproblems towards making progress in that direction.

Assumptions
-----------

Most of these proofs can be understood geometrically, and we'll need to make some geometric assumptions. One big property we'll be using is the fact that set of feasible joint utilities $\mathcal F \in \mathbb R^n$ is always [convex](https://en.wikipedia.org/wiki/Convex_set). This is always true for [VNM-rational](https://en.wikipedia.org/wiki/Von_Neumann%E2%80%93Morgenstern_utility_theorem) agents with utility functions, but we can prove the same result for agents with other functions describing their preferences, as long as the feasible utilities stay convex. This will be helpful when we start combining utilities in ways that make the resulting social choice function [violate the VNM axioms](https://www.lesswrong.com/posts/Xht9swezkGZLAxBrd/geometric-rationality-is-not-vnm-rational), but preserve convexity.

We'll also need $\mathcal F$ to be [compact](https://en.wikipedia.org/wiki/Compact_space), if we want to be able to find optimal points according to $G$ or $H$. If $\mathcal F$ extends infinitely in any direction, there might not be any Pareto optimal joint utilities. This "problem" also appears in classic individual rationality: what does a rational agent do when they can simply pick a number $u \in \mathbb R$ and receive that much utility? Individual VNM-rationality isn't well-defined when there isn't an optimal option, so compactness seems like a weak assumption, but it implies that utilities are bounded with respect to the options our agents are facing, so I want to call it out.

It will be easier to prove uniqueness results if there aren't any redundant agents with constant utility. Any weight assigned to these agents has no effect on the optima of $H$ or $G$, and in the context of optimizing over a set of feasible options it's safe to ignore such agents. There's no choice we can make which will affect them in any way. Geometrically, this corresponds to the requirement that $\mathcal F$ be $n$-dimensional.

It will make the math nicer if we [shift](https://en.wikipedia.org/wiki/Von_Neumann%E2%80%93Morgenstern_utility_theorem#The_theorem) all utility functions so that each agent assigns 0 utility to their least favorite option. If $\mathcal F$ is generated by taking the Pareto improvements over some [disagreement point](https://en.wikipedia.org/wiki/Best_alternative_to_a_negotiated_agreement) $d$, as is done in the [bargaining](https://en.wikipedia.org/wiki/Cooperative_bargaining) setting, this disagreement point will become the baseline for 0 utility for all agents.

I'll also be assuming that the number of players $n$ is finite. I don't have any reason to think the results fail for the infinite case, but there are things we'd need to worry about for [infinite-dimensional](https://en.wikipedia.org/wiki/Dimension_(vector_space)) vector spaces that I didn't worry about for these first results. We'd want to swap out all the finite sums $\sum_{i=1}^n$ for integrals $\int di$, for example, if we wanted to use continuous indices for agents.

Maximizing G Can Always Lead to Pareto Optimality
-------------------------------------------------

Showing that maximizing $G(\_, \psi)$ can always lead to Pareto optimality is relatively straightforward.

Our decision to shift away from negative utilities is already paying dividends: the weighted geometric average is [monotonically increasing](https://en.wikipedia.org/wiki/Monotonic_function) with respect to all individual utilities. Any Pareto improvement in utilities will lead to a weighted average that's at least what we started with.[^b4b6b2y006v]

**Pareto Monotonicity**: If $p$ is a Pareto improvement over $f$, then $G(p, \psi) \geq G(f, \psi)$ for all weights $\psi \in \mathbb [0, 1]^n$. Symbolically: $p \succeq f \implies G(p, \psi) \geq G(f, \psi)$

Among agents with positive weight $\psi_i$, any increase to their utility will increase $G(\_, \psi)$; maximizing $G(\_, \psi)$ will automatically pick up any Pareto improvements among these agents.

It turns out that when all agents have positive weight, $\psi_i > 0$, this Pareto optimal point $p$ will be the *unique* optimum of $G$ among $\mathcal F$. We'll prove this more rigorously in the [next post](https://www.lesswrong.com/posts/AhwgnWg95Wt4PfXik/deriving-the-geometric-utilitarian-weights), but intuitively when $\psi_i > 0$ for all agents, the contour surface of joint utilities with the same $G$ score as $p$ (colored green in the picture below) curves away from $\mathcal F$.

![Geometric Weight Calculation](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/27e3da21d07b7ef7938efed8475695be6b37338398ae83f2.png)

Check out an interactive version [here](https://www.geogebra.org/calculator/rvcgru37)!

Will maximizing $G(\_, \psi)$ lead to Pareto optimality among a group of agents where some have 0 weight? In that case it depends on how we break ties! Assigning an agent 0 weight makes $G$ and $H$ insensitive to their welfare, so there can be optima of $G$ and $H$ which are not Pareto optimal in this case.[^fedhtutjn8b]

As an example, consider Alice deciding how much money she and Bob should receive, up to $100 each. There is no trade-off between her utility and Bob's and the only Pareto optimum is ($100, $100). But if Alice is a pure $G$ or $H$ maximizer and assigns Bob 0 weight, she's indifferent to Bob's utility and the optima are wherever Alice receives $100.

Fortunately, there are always optima of $G(\_, \psi)$ which are Pareto optimal, and we can use a tie-breaking rule which always picks one of these. One approach would be to derive new weights $\beta$ which are guaranteed to be positive for all agents, and which are very close to $\psi$.

$\lim\limits_{\epsilon \to 0} \beta(\psi, \epsilon) = \psi$

Then we could pick the point $p$ on the Pareto frontier which is the limit as $\epsilon$ approaches 0.

$p(\psi) = \lim\limits_{\epsilon \to 0} \underset{u \in \mathcal F}{\arg\!\max} \, G(u, \beta(\psi, \epsilon))$

Maximizing $G$ or $H$ can always be done Pareto optimally. It turns out that this particular tie-breaking rule isn't guaranteed to make $p(\psi)$ continuous, and in fact there might be cases where no such tie-breaking rule exists. However, it turns out that we can make $p(\psi)$ continuous if we're willing to accept an arbitrarily good approximation of $\underset{u \in \mathcal F}{\arg\!\max} \, G(u, \psi)$. See [Individual Utilities Shift Continuously as Geometric Weights Shift](https://www.lesswrong.com/posts/gDBuetmcFWNoWSFvC/individual-utilities-shift-continuously-as-geometric-weights) for more details.

Making p an Optimum of G
------------------------

Going the other direction, let's pick a Pareto optimal joint utility $p \in \mathcal P$ and find weights $\psi \in \mathbb [0, 1]^n$ which make that point optimal among $\mathcal F$ with respect to $G(\_, \psi)$. These geometric weights $\psi$ won't always be unique, for example at corners where the Harsanyi weights $\phi$ aren't unique. $G$ won't always have unique optima either, which can happen when we give any agents 0 weight.

Let's handle a few easy cases up front: when $n = 1$, the only option is $\psi = [1]$. This means that $G(u, \psi) = u$, and $G(\_, \psi)$ maximization reduces to individual utility maximization for a single agent. This is a nice base case for any sort of recursion: the aggregate of one utility function is just that same utility function, and Harsanyi aggregation works the same way.

Similarly, when $\mathcal P$ is a single point $p$, any weights will make $p$ optimal according to $G(\_, \psi)$ or $H(\_, \phi)$. Feel free to use any convention that works for your application, the simplest option is to just inherit $\psi(\vec 0) = \phi(\vec 0)$, but if $\mathcal F$ is shrinking towards becoming 0 dimensional then I prefer $\psi(\vec 0) = \lim\limits_{p \to \vec 0} \psi(p)$.

For two or more agents and a Pareto frontier with multiple options, here's the high-level overview of the proof:

1.  Identify the Harsanyi hyperplane $\mathcal H$, and the Harsanyi weights $\phi$
2.  Calculate geometric weights $\psi$ which make $p$ optimal among $\mathcal H$ according to $G(\_, \psi)$
3.  Show that this is sufficient to make $p$ optimal among $\mathcal F$.

### The Harsanyi Hyperplane

One way to derive the Harsanyi weights for $\mathcal F$ is to find a hyperplane which [separates](https://en.wikipedia.org/wiki/Hahn%E2%80%93Banach_theorem) $\mathcal F$ from the rest of $\mathbb R^n$.

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/db0d9ec173aedd3233a2557465c18a54c928a2a3075cea66.png)

[Diffractor](https://www.lesswrong.com/users/diffractor) uses this technique [here](https://www.lesswrong.com/posts/RZNmNwc9SxdKayeQh/unifying-bargaining-notions-2-2) in that same great [Unifying Bargaining](https://www.lesswrong.com/s/hCt6GL4SXX6ezkcJn) sequence, and I'd actually forgotten I learned it from there, it's become so ingrained in my thinking. The idea is that maximizing a weighted arithmetic average can be thought of as picking a slope for a hyperplane, then [sliding that hyperplane](https://www.lesswrong.com/posts/RZNmNwc9SxdKayeQh/unifying-bargaining-notions-2-2) away from the origin until it just barely touches $\mathcal F$.

The slope of this Harsanyi hyperplane $\mathcal H \subset \mathbb R^n$ matches up with the slope of the Pareto frontier at $p$. If $p$ is at a corner, where the slope change suddenly on either side, any convex combination of the slopes around $p$ will work. The equation for a any [hyperplane](https://en.wikipedia.org/wiki/Hyperplane) looks like $a \cdot u = a_1 u_1 + a_2 u_2 + ... + a_n u_n = b$, where $a \in \mathbb R^n$ and $b \in \mathbb R$ are constants. Given some Harsanyi weights $\phi \in [0, 1]^n$, the Harsanyi hyperplane shows us all of the joint utilities with the same weighted average, and is defined by $H(u, \phi) = u \cdot \phi = H(p, \phi)$. We can pick any joint utility $u$ on $\mathcal H$ and it will have the same $H$ score as $p$.

### The Geometric Utilitarian Weights

The trick that makes all of this work is to pick weights $\psi$ which cause $p$ to be optimal with respect to $G(\_, \psi)$ among $\mathcal H$. It turns out these are easy to calculate! For individual elements we can use the formula

$\psi_i = \frac{p_i \phi_i}{p \, \cdot \, \phi}$

And for all of the weights at once we can use 

$\psi = \frac{p \, ⊙ \, \phi}{p \, \cdot \, \phi}$

Where $p \, ⊙ \, \phi \in \mathbb R^n$ is the element-wise product of $p$ and $\phi$: $(p ⊙ \phi)_i = p_i \phi_i$ and $p \cdot \phi \in \mathbb R^n$ is the dot product $p \cdot \phi = \sum_{j=1}^n p_j\phi_j$. Check out [Deriving the Geometric Utilitarian Weights](https://www.lesswrong.com/posts/AhwgnWg95Wt4PfXik/deriving-the-geometric-utilitarian-weights) for the details of how this was derived, and how we know that $p$ is the unique optimum of $G(\_, \psi)$ among $\mathcal H$ if we use these weights. (So long as $\psi_i > 0$ for all agents.)

### Gradient Ascent

One way to think about maximizing $G$ is to imagine a robot flying around in joint utility space $\mathbb R^n$, following the gradient $\nabla_u G$ to increase $G$ as quickly as possible. This is the gradient ascent algorithm, and it can be used to find [local optima](https://en.wikipedia.org/wiki/Gradient_descent) of any function. Some functions have multiple optima, and in those cases it matters where your robot starts. But when there's just one global optimum, gradient ascent will find it.

If we ignore $\mathcal F$ and just set our robot loose trying to maximize $G$, it will never find an optimum. There's always an agent's utility where increasing their utility increases $G$. ($\nabla_u G_i \geq 0$ for all agents, and $\nabla_u G_i > 0$ for some agent).

However, if we use those weights $\psi$ we calculated, $\nabla_u G$ will always point at least a little in the direction of $h$, the normal vector to the Harsanyi hyperplane $\mathcal H$. Check out [Gradient Ascenders Reach the Harsanyi Hyperplane](https://www.lesswrong.com/posts/NMKsT5bBdMp7GjPjo/gradient-ascenders-reach-the-harsanyi-hyperplane) for the details there. 

Now if we add the single constraint that our robots can't travel beyond $\mathcal H$, they'll bump into $\mathcal H$ and then travel along $\nabla_v (G \circ \mathcal H)$, since that's the gradient of $G$ when our robots are constrained to only move along $\mathcal H$.

But when $\psi_i > 0$ for all agents, $G(\_, \psi)$ has a unique optimum on $\mathcal H$, and it's $p$! No matter where our robots start within the interior of $\mathcal F$, they'll find themselves inexorably drawn to the $p$ given just the constraint that they can't cross $\mathcal H$. If we add in the constraint that the robots need to stay within $\mathcal F$, they might bump into those boundaries first, but they'll make their way over to the unique optimum of $G(\_, \psi)$ among all options in $\mathcal F$, which is still $p$.

When $\psi_i = 0$ for some agent, $G(\_, \psi)$ may have multiple optima where our robots might land, but those optima always include $p$!

More Details
------------

The next two posts in this sequence go into more detail about two subproblems we summarized briefly here.

[Deriving the Geometric Utilitarian Weights](https://www.lesswrong.com/posts/AhwgnWg95Wt4PfXik/deriving-the-geometric-utilitarian-weights) goes into more detail about how those weights $\psi$ can be derived, and how we know $p$ is the unique optimum among $\mathcal H$ if we use them.

[Gradient Ascenders Reach the Harsanyi Hyperplane](https://www.lesswrong.com/posts/NMKsT5bBdMp7GjPjo/gradient-ascenders-reach-the-harsanyi-hyperplane) describes what the gradient of $G(\_, \psi)$ looks like, and how we know it always points at least a little towards $\mathcal H$ (and then away from $\mathcal H$ once we cross it).

Then we show a bonus result: [Individual Utilities Shift Continuously as Geometric Weights Shift](https://www.lesswrong.com/posts/gDBuetmcFWNoWSFvC/individual-utilities-shift-continuously-as-geometric-weights). Which is a nice property to have if you want your system's behavior to only change a little if you only change the weights a little, instead of [discontinuously thrashing](https://www.lesswrong.com/posts/gJGYDsyxj3rZDp86E/geometric-utilitarianism-and-why-it-matters#Why_Geometric_Rationality_) to a potentially very different behavior.

[^b4b6b2y006v]: When an individual is given \(0\) weight, increasing their utility doesn't increase the weighted average. But it doesn't decrease the weighted average either. 

[^fedhtutjn8b]: Assigning an agent 0 weight makes \(G\) insensitive to their welfare, but increasing \(G\) might still increase their welfare. Because we might have assigned weight to another agent whose values are somewhat aligned with theirs. Our social aggregate might not care that Alice likes clean air, but it might still tell us to clean up the air if Bob likes it and Bob is given positive weight.