Angstrom L2 captures priority-fee MEV inside the Uniswap v4 hook and pays it out immediately. This note explains how the hook splits the tax between fee recipients and how liquidity providers receive their share. The first section summarizes the on-chain flow; the remainder reproduces the full compensation-price derivation used by the contracts.
How the Tax Flows to LPs
Snapshot state : beforeSwap stores the pre-swap tick and liquidity so the hook knows exactly which ranges were crossed.
Compute base deltas : TickIteratorLib walks the crossed ticks to derive each range's token deltas.
Solve for a uniform price : CompensationPriceFinder chooses a compensation price p* so makers are paid as if the entire swap cleared at that level, using the formulas derived below.
Accrue rewards : PoolRewardsLib updates growth accumulators (rewardGrowthOutsideX128, globalGrowthX128) that mirror Uniswap v3/v4 fee accounting.
Pay on exit : When LPs remove liquidity, afterRemoveLiquidity settles their accumulated native-token rewards. Integrators can also query getPendingPositionRewards mid-position.
The hook shares the tax between the pool creator, protocol treasury, and LPs according to the fee configuration stored in the factory. LP payouts always stay in the rollup's native asset, matching the currency that sequencers prioritize.
Detailed Compensation Price Derivation
This section ports the formal derivation from the contracts repository. It defines the compensation price p ⋆ p_\star p ⋆ that equalizes maker payoffs when a swap crosses multiple ticks.
Variables & Definitions
L i > 0 L_i > 0 L i > 0 : virtual liquidity for range i i i (L i = x i y i L_i = \sqrt{x_i y_i} L i = x i y i where x i , y i x_i, y_i x i , y i are the virtual reserves for range i i i )
p i > 0 p_{i} > 0 p i > 0 is the price of the lower boundary of range i i i
p ⋆ > 0 p_\star > 0 p ⋆ > 0 : post-trade effective compensation price
B > 0 B > 0 B > 0 is the bid/liquidity compensation amount.
Given some liquidity L i L_i L i and a price p p p we can determine the virtual reserves in x x x & y y y at that price point with: x = L i ⋅ 1 p , y = L i ⋅ p x = L_i\cdot\frac{1}{\sqrt p}, y = L_i\cdot{\sqrt p} x = L i ⋅ p 1 , y = L i ⋅ p
To compute the net amount deltas required to cross a range i i i : Δ x i = L i ( 1 p i − 1 p i + 1 ) , Δ y i = L i ( p i + 1 − p i ) \Delta x_i =L_i(\frac{1}{\sqrt{p_i}}-\frac{1}{\sqrt{p_{i+1}}}),\ \Delta y_i = L_i(\sqrt{p_{i+1}}-\sqrt{p_i}) Δ x i = L i ( p i 1 − p i + 1 1 ) , Δ y i = L i ( p i + 1 − p i )
X ^ , Y ^ > 0 \hat X, \hat Y > 0 X ^ , Y ^ > 0 : aggregated swap amount of whole ranges where the final p ⋆ ∉ [ a i , b i ] p_\star \notin [a_i, b_i] p ⋆ ∈ / [ a i , b i ] is known to lie outside of (where a i = max { p i , p start } , b i = min { p i + 1 , p end } a_i = \max\{p_i, p_{\text{start}}\}, b_i = \min\{p_{i+1}, p_{\text{end}}\} a i = max { p i , p start } , b i = min { p i + 1 , p end } , implicitly a i ≤ b i a_i \le b_i a i ≤ b i ):
X ^ = ∑ i L i ( 1 a i − 1 b i ) , Y ^ = ∑ i L i ( b i − a i ) . \hat X =\sum_i L_i(\frac{1}{\sqrt{a_i}}-\frac{1}{\sqrt{b_i}}),\qquad \hat Y = \sum_i L_i(\sqrt{b_i}-\sqrt{a_i}). X ^ = ∑ i L i ( a i 1 − b i 1 ) , Y ^ = ∑ i L i ( b i − a i ) .
Compensation Price definition
Assuming unsigned total deltas X = ∑ i Δ x i , Y = ∑ i Δ y i X = \sum_i {\Delta x_i}, Y=\sum_i \Delta y_i X = ∑ i Δ x i , Y = ∑ i Δ y i the final compensation price p ⋆ p_\star p ⋆ is defined as:
Zero-for-One Swap: p ⋆ = Y X + B p_\star = \frac{Y}{X + B} p ⋆ = X + B Y such that each range i i i trades Δ x i ′ = Δ y i ⋅ ( min { p ⋆ , Δ y i Δ x i } ) − 1 \Delta x_i' = \Delta y_i \cdot (\min\{p_\star, \frac{\Delta y_i}{\Delta x_i}\})^{-1} Δ x i ′ = Δ y i ⋅ ( min { p ⋆ , Δ x i Δ y i } ) − 1
One-for-Zero Swap: p ⋆ = Y X − B p_\star = \frac{Y}{X- B} p ⋆ = X − B Y such that each range i i i trades Δ x i ′ = Δ y i ⋅ ( max { p ⋆ , Δ y i Δ x i } ) − 1 \Delta x_i' = \Delta y_i \cdot (\max\{p_\star, \frac{\Delta y_i}{\Delta x_i}\})^{-1} Δ x i ′ = Δ y i ⋅ ( max { p ⋆ , Δ x i Δ y i } ) − 1
Base Considered Swap Amount
Notice from the above definition that there will be a consecutive sub-set of ranges which will trade at (p ⋆ ≤ Δ y i Δ x i p_\star \le \frac{\Delta y_i}{\Delta x_i} p ⋆ ≤ Δ x i Δ y i for zero-for-one, p ⋆ ≥ Δ y i Δ x i p_\star \ge \frac{\Delta y_i}{\Delta x_i} p ⋆ ≥ Δ x i Δ y i for one-for-zero).
This range can be determined by walking from p s t a r t → p e n d p_{start} \rightarrow p_{end} p s t a r t → p e n d and keeping track of the total sum so far X ^ = ∑ i Δ x i , Y ^ = ∑ i Δ y i \hat X = \sum_i {\Delta x_i},\hat Y=\sum_i \Delta y_i X ^ = ∑ i Δ x i , Y ^ = ∑ i Δ y i . At each step checking p ~ i = Y ^ X ^ + B / p ~ i = Y ^ X ^ − B \tilde p_i = \frac{\hat Y}{\hat X + B}/\tilde p_i = \frac{\hat Y}{\hat X - B} p ~ i = X ^ + B Y ^ / p ~ i = X ^ − B Y ^ depending on the swap direction. If p ~ i \tilde p_i p ~ i is outside of the current range the current range will be part of the consecutive set.
If all ranges are depleted and p ~ e n d \tilde p_{end} p ~ e n d lies beyond p e n d p_{end} p e n d then we can take p ⋆ : = p ~ e n d p_\star := \tilde p_{end} p ⋆ := p ~ e n d .
Otherwise when a range is found such that p ~ i ∈ [ p i , p i + 1 ] \tilde p_i \in [p_i, p_{i+1}] p ~ i ∈ [ p i , p i + 1 ] we need to calculate the actual p ⋆ p_\star p ⋆ that satisfies our original formula.
Zero-for-One (price decreasing)
Setup
For a given tick i i i that is being swapped through, we have:
Δ x = L ( 1 p ⋆ − 1 p i + 1 ) , Δ y = L ⋅ ( p i + 1 − p ⋆ ) , B = Y ^ + Δ y p ⋆ − ( X ^ + Δ x ) . \Delta x = L\left(\frac{1}{\sqrt{p_\star}}-\frac{1}{\sqrt{p_{i+1}}}\right),\qquad
\Delta y = L\cdot(\sqrt{p_{i+1}}-\sqrt{p_\star}),\qquad
B = \frac{\hat Y+\Delta y}{p_\star} - (\hat X+\Delta x). Δ x = L ( p ⋆ 1 − p i + 1 1 ) , Δ y = L ⋅ ( p i + 1 − p ⋆ ) , B = p ⋆ Y ^ + Δ y − ( X ^ + Δ x ) .
Quadratic in p ⋆ \sqrt{p_\star} p ⋆
Clearing denominators and simplifying yields:
A ⋅ ( p ∗ ⋆ ) 2 + 2 L ⋅ p ∗ ⋆ − ( Y ^ + y ) = 0 , A : = B + X ^ − x A \cdot(\sqrt{p*\star})^2 + 2L\cdot\sqrt{p*\star} - (\hat Y+y) = 0,\qquad A := B + \hat X - x A ⋅ ( p ∗ ⋆ ) 2 + 2 L ⋅ p ∗ ⋆ − ( Y ^ + y ) = 0 , A := B + X ^ − x
Solutions:
p ⋆ = − L ± L 2 + A ( Y ^ + y ) A = − L ± Y ^ ( B + X ^ − x ) + y ( B + X ^ ) B + X ^ − x . \begin{aligned}
\sqrt{p_\star} &= \frac{-L \pm \sqrt{L^2 + A(\hat Y + y)}}{A} \\
&= \frac{-L \pm \sqrt{\hat Y (B + \hat X - x) + y (B + \hat X)}}{B + \hat X - x}.
\end{aligned} p ⋆ = A − L ± L 2 + A ( Y ^ + y ) = B + X ^ − x − L ± Y ^ ( B + X ^ − x ) + y ( B + X ^ ) .
(The two radicands are equal because L 2 = x y L^2=xy L 2 = x y .)
Existence & Uniqueness on ( 0 , u ] (0,u] ( 0 , u ] (where u = p i + 1 u=\sqrt{p_{i+1}} u = p i + 1 )
The quadratic gives us two solutions, we now want to prove the theorem that:
There exists one unique solution that lies in the range ( 0 , u ] (0, u] ( 0 , u ] and that solution is given by:
s + = − L + L 2 + A ( Y ^ + y ) A s_+ = \frac{-L + \sqrt{L^2 + A(\hat Y+y)}}{A} s + = A − L + L 2 + A ( Y ^ + y )
Let's take the above quadratic as a function ϕ ( s ) \phi(s) ϕ ( s ) s.t. ϕ ( p ⋆ ) = 0 \phi(\sqrt{p_\star}) = 0 ϕ ( p ⋆ ) = 0 :
ϕ ( s ) = A s 2 + 2 L s − ( Y ^ + y ) \phi(s) =A s^2 + 2Ls - (\hat Y+y) ϕ ( s ) = A s 2 + 2 L s − ( Y ^ + y )
Lemma 1: Monotonicity of ϕ ( s ) \phi(s) ϕ ( s ) over ( 0 , u ] (0,u] ( 0 , u ]
We prove that ϕ ( s ) \phi(s) ϕ ( s ) monotonically increases for s ∈ ( 0 , u ] s \in (0, u] s ∈ ( 0 , u ] by showing that ϕ ′ ( s ) ≥ 0 \phi'(s) \ge 0 ϕ ′ ( s ) ≥ 0 in that range:
ϕ ′ ( s ) = 2 A s + 2 L \phi'(s) = 2As + 2L ϕ ′ ( s ) = 2 A s + 2 L
ϕ ′ ( 0 ) ≥ 0 \phi'(0) \ge 0 ϕ ′ ( 0 ) ≥ 0 : ϕ ′ ( 0 ) = 2 A ( 0 ) + 2 L = 2 L ⇒ ϕ ′ ( 0 ) ≥ 0 \phi'(0) = 2A(0) + 2L = 2L \Rightarrow \phi'(0) \ge 0 ϕ ′ ( 0 ) = 2 A ( 0 ) + 2 L = 2 L ⇒ ϕ ′ ( 0 ) ≥ 0
ϕ ′ ( u ) ≥ 0 \phi'(u) \ge 0 ϕ ′ ( u ) ≥ 0 :
Expand ϕ ′ ( u ) \phi'(u) ϕ ′ ( u ) : 2 A u + 2 L ≥ 0 ⇔ 2 ( B + X ~ − x ) u ≥ − 2 L 2Au + 2L \ge 0 \Leftrightarrow 2 (B + \tilde X - x)u \ge -2L 2 A u + 2 L ≥ 0 ⇔ 2 ( B + X ~ − x ) u ≥ − 2 L
Prove tighter bound: B + X ~ − x ≥ − x ⇒ 2 ( − x ) u ≥ − 2 L ⇒ 2 A u ≥ − 2 L B + \tilde X - x \ge -x \Rightarrow 2(-x)u \ge -2L \Rightarrow 2Au \ge -2L B + X ~ − x ≥ − x ⇒ 2 ( − x ) u ≥ − 2 L ⇒ 2 A u ≥ − 2 L
Use u = y x u = \sqrt\frac{y}{x} u = x y : 2 ( − x ) y x ≥ − 2 x y ⇔ x y x ≤ x y ⇔ x 2 y x = x y \quad 2 (-x)\sqrt{\frac{y}{x}}\ge -2\sqrt{xy}\Leftrightarrow x\sqrt{\frac{y}{x}}\le\sqrt{xy}\Leftrightarrow\sqrt{x^2\frac{y}{x}}=\sqrt{xy} 2 ( − x ) x y ≥ − 2 x y ⇔ x x y ≤ x y ⇔ x 2 x y = x y
Lemma 2: Boundary signs ϕ ( 0 ) < 0 \phi(0) < 0 ϕ ( 0 ) < 0 and ϕ ( u ) ≥ 0 \phi(u) \ge 0 ϕ ( u ) ≥ 0
ϕ ( 0 ) < 0 \phi(0) \lt 0 ϕ ( 0 ) < 0 : − ( Y ~ + y ) < 0 - (\tilde Y + y) < 0 − ( Y ~ + y ) < 0
ϕ ( u ) ≥ 0 \phi(u) \ge 0 ϕ ( u ) ≥ 0 :
Expand ϕ ( u ) \phi(u) ϕ ( u ) : A u 2 + 2 L u − ( Y ~ + y ) ≥ 0 Au^2+2Lu-(\tilde Y + y) \ge 0 A u 2 + 2 Lu − ( Y ~ + y ) ≥ 0
Expand A A A and simplify: ( B + X ^ − x ) u 2 + 2 y − Y ~ − y ≥ 0 ⇔ ( B + X ~ ) u 2 ≥ Y ~ (B + \hat X - x)u^2+2y-\tilde Y - y \ge 0 \Leftrightarrow (B + \tilde X)u^2 \ge \tilde Y ( B + X ^ − x ) u 2 + 2 y − Y ~ − y ≥ 0 ⇔ ( B + X ~ ) u 2 ≥ Y ~
Reorganize & expand u 2 u^2 u 2 : p i + 1 ≥ Y ~ B + X ~ p_{i+1}\ge\frac{\tilde Y}{B + \tilde X} p i + 1 ≥ B + X ~ Y ~
Recognize that p ~ = Y ~ B + X ~ \tilde p = \frac{\tilde Y}{B + \tilde X} p ~ = B + X ~ Y ~ and that p i + 1 ≥ p ~ p_{i+1} \ge \tilde p p i + 1 ≥ p ~ is the precondition for beginning this calculation
Lemma 3: Unique Solution in ( 0 , u ] (0,u] ( 0 , u ]
Using Lemma 1 & 2 and the Intermediate value theorem we now know that there is exactly one s ∈ ( 0 , u ] s \in (0,u] s ∈ ( 0 , u ] s.t. ϕ ( s ) = 0 \phi(s) = 0 ϕ ( s ) = 0 and therefore only one solution to the quadratic in that range.
Lemma 4: s + s_+ s + is that solution
s + = − L + D A , D : = L 2 + A ( Y ^ + y ) s_+ = \frac{-L + \sqrt{D}}{A}, D:=L^2 + A(\hat Y+y) s + = A − L + D , D := L 2 + A ( Y ^ + y )
s − = − L − D A s_- = \frac{-L - \sqrt{D}}{A} s − = A − L − D
A > 0 A > 0 A > 0 : trivially s − < 0 s_- < 0 s − < 0 , leaving s + s_+ s + as the only positive solution.
A < 0 A < 0 A < 0 :
When A < 0 A < 0 A < 0 then D < L \sqrt D < L D < L . This leads to both s + s_+ s + and s − s_- s − being positive. However in this case we can show that:
s + < s − s_+ < s_- s + < s −
− L + D A < − L − D A \frac{-L + \sqrt{D}}{A} < \frac{-L - \sqrt{D}}{A} A − L + D < A − L − D
− L + D > − L − D -L + \sqrt{D} > -L - \sqrt{D} − L + D > − L − D
D > − D \sqrt{D} > - \sqrt{D} D > − D
All together
Together we've shown that there is always a positive solution for p ⋆ \sqrt {p_\star} p ⋆ that lies between 0 0 0 and p i + 1 \sqrt{p_{i+1}} p i + 1 and that it's calculated via the positive solution from the quadratic.
One-for-Zero (price increasing)
For a given tick i i i that is being swapped through, we have:
Δ x = L ( 1 p i − 1 p ⋆ ) , Δ y = L ⋅ ( p ⋆ − p i ) , B = ( X ^ + Δ x ) − Y ^ + Δ y p ⋆ . \Delta x = L\left(\frac{1}{\sqrt{p_i}}-\frac{1}{\sqrt{p_\star}}\right),\qquad\Delta y = L\cdot(\sqrt{p_\star}-\sqrt{p_i}),\qquad B = (\hat X+\Delta x) - \frac{\hat Y+\Delta y}{p_\star}. Δ x = L ( p i 1 − p ⋆ 1 ) , Δ y = L ⋅ ( p ⋆ − p i ) , B = ( X ^ + Δ x ) − p ⋆ Y ^ + Δ y .
Quadratic in p ⋆ \sqrt{p_\star} p ⋆
Clearing denominators, substituting A : = X ~ + x − B A := \tilde X + x - B A := X ~ + x − B and s : = p ⋆ s := \sqrt{p_\star} s := p ⋆ , simplifying yields:
A s 2 − 2 L s − ( Y ~ − y ) = 0 As^2 - 2Ls - (\tilde Y - y) = 0 A s 2 − 2 L s − ( Y ~ − y ) = 0
Solutions:
p ⋆ = L ± L 2 + A ( Y ^ − y ) A = L ± Y ^ ( x + X ^ − B ) − y ( X ^ − B ) x + X ^ − B . \begin{aligned}
\sqrt{p_\star} &= \frac{L \pm \sqrt{L^2 + A(\hat Y - y)}}{A} \\
&= \frac{L \pm \sqrt{\hat Y (x + \hat X - B) - y (\hat X - B)}}{x + \hat X - B}.
\end{aligned} p ⋆ = A L ± L 2 + A ( Y ^ − y ) = x + X ^ − B L ± Y ^ ( x + X ^ − B ) − y ( X ^ − B ) .
Lemma 1: Monotonicity in range [ l , + ∞ ) [l, +\infty) [ l , + ∞ ) (where l = p i l = \sqrt{p_i} l = p i )
ϕ ′ ( s ) = 2 A s − 2 L ϕ ′ ( s ) ≥ 0 ⇔ s ≥ L A \begin{aligned}
\phi'(s) &= 2As - 2L \\
\phi'(s) \ge 0 &\Leftrightarrow s \ge \frac{L}{A}
\end{aligned} ϕ ′ ( s ) ϕ ′ ( s ) ≥ 0 = 2 A s − 2 L ⇔ s ≥ A L
We'll call the point L A \frac L A A L at which ϕ ( s ) \phi(s) ϕ ( s ) becomes monotonically increasing s 0 s_0 s 0 it may or may not lie in the range [ l , + ∞ ) [l, +\infty) [ l , + ∞ )
Lemma 2: Negative Lower Range Bound ϕ ( s 0 ) ≤ 0 \phi(s_0) \le 0 ϕ ( s 0 ) ≤ 0
ϕ ( s 0 ) ≤ 0 A ( L A ) 2 − 2 L ( L A ) − ( Y ~ − y ) ≤ 0 − L 2 A − ( Y ~ − y ) ≤ 0 − L 2 A ≤ Y ~ − y − L 2 ≤ ( Y ~ − y ) A − L 2 ≤ Y ~ A − y ( X ~ − B ) − y x 0 ≤ Y ~ A − y ( X ~ − B ) y ( X ~ − B ) ≤ Y ~ A \begin{aligned}
\phi(s_0) &\le 0 \\
A\left(\frac{L}{A}\right)^2 - 2L\left(\frac{L}{A}\right) - (\tilde Y - y) &\le 0 \\
-\frac{L^2}{A} - (\tilde Y - y) &\le 0 \\
-\frac{L^2}{A} &\le \tilde Y - y \\
-L^2 &\le (\tilde Y - y) A \\
-L^2 &\le \tilde Y A - y (\tilde X - B) - yx \\
0 &\le \tilde Y A - y (\tilde X - B) \\
y (\tilde X - B) &\le \tilde Y A
\end{aligned} ϕ ( s 0 ) A ( A L ) 2 − 2 L ( A L ) − ( Y ~ − y ) − A L 2 − ( Y ~ − y ) − A L 2 − L 2 − L 2 0 y ( X ~ − B ) ≤ 0 ≤ 0 ≤ 0 ≤ Y ~ − y ≤ ( Y ~ − y ) A ≤ Y ~ A − y ( X ~ − B ) − y x ≤ Y ~ A − y ( X ~ − B ) ≤ Y ~ A
X ~ − B < 0 \tilde X - B < 0 X ~ − B < 0 :
Reorganize into fractions: y A ≥ Y ~ X ~ − B \frac y A \ge \frac {\tilde Y}{\tilde X - B} A y ≥ X ~ − B Y ~
Trivially true because y > 0 , A > 0 , Y ~ > 0 y > 0, A > 0, \tilde Y > 0 y > 0 , A > 0 , Y ~ > 0
X ~ − B > 0 \tilde X - B > 0 X ~ − B > 0
Reorganize into fractions: y x + ( X ~ − B ) ≤ Y ~ X ~ − B \frac y {x + (\tilde X - B)} \le \frac {\tilde Y}{\tilde X - B} x + ( X ~ − B ) y ≤ X ~ − B Y ~
Tighten inequality: y x ≤ Y ~ X ~ − B \frac y x \le \frac {\tilde Y}{\tilde X - B} x y ≤ X ~ − B Y ~
Trivially true as it's the pre-condition to the computation
Lemma 3: Unique solution in [ s 0 , + ∞ ) [s_0, +\infty) [ s 0 , + ∞ )
Using the above lemmas together with a intermediate value theorem we now know that there is a unique solution in this range.
Lemma 4: s + ∈ [ s 0 , + ∞ ) s_+ \in [s_0, +\infty) s + ∈ [ s 0 , + ∞ )
D : = L 2 + A ( Y ^ − y ) s + = L + D A s − = L − D A \begin{aligned}
D &:= L^2 + A(\hat Y - y) \\
s_+ &= \frac{L + \sqrt{D}}{A} \\
s_- &= \frac{L - \sqrt{D}}{A}
\end{aligned} D s + s − := L 2 + A ( Y ^ − y ) = A L + D = A L − D
When Y ^ − y ≥ 0 \hat Y-y \ge 0 Y ^ − y ≥ 0 :
A ( Y ~ − y ) ≥ 0 ⇒ D ≥ L 2 ⇒ D ≥ L A(\tilde Y - y) \ge 0 \Rightarrow D \ge L^2 \Rightarrow \sqrt D \ge L A ( Y ~ − y ) ≥ 0 ⇒ D ≥ L 2 ⇒ D ≥ L
Trivially: s − < 0 s_- < 0 s − < 0 leaving s + s_+ s + as the only positive solution.
When Y ^ − y < 0 \hat Y-y \lt 0 Y ^ − y < 0 :
D < L \sqrt D \lt L D < L following the above reasoning, meaning both s + s_+ s + and s − s_- s − are positive
However we can trivially see that s + > s − s_+ > s_- s + > s −
Because exactly one solution must lie in [ s 0 , + ∞ ) [s_0, +\infty) [ s 0 , + ∞ ) it must be s + s_+ s + because if it were s − s_- s − it would lead to a contradiction requiring s + > s − s_+ > s_- s + > s − but also s + ∉ [ s 0 , + ∞ ) s_+ \notin [s_0, +\infty) s + ∈ / [ s 0 , + ∞ ) .
Lemma 5: s + ≥ l s_+ \ge l s + ≥ l
L + D A ≥ l L + D ≥ l ( x + X ~ − B ) L + D ≥ L + l ( X ~ − B ) D ≥ l ( X ~ − B ) \begin{aligned}
\frac{L + \sqrt{D}}{A} &\ge l \\
L + \sqrt{D} &\ge l (x + \tilde X - B) \\
L + \sqrt{D} &\ge L + l (\tilde X - B) \\
\sqrt{D} &\ge l (\tilde X - B)
\end{aligned} A L + D L + D L + D D ≥ l ≥ l ( x + X ~ − B ) ≥ L + l ( X ~ − B ) ≥ l ( X ~ − B )
When X ~ − B < 0 \tilde X - B < 0 X ~ − B < 0 : Inequality true because left side is positive and left side negative.
When X ~ − B ≥ 0 \tilde X -B \ge 0 X ~ − B ≥ 0 :
D ≥ p i ( X ~ − B ) 2 L 2 + A ( Y ~ − y ) ≥ p i ( X ~ − B ) 2 L 2 + A Y ~ − y x − y ( X ~ − B ) ≥ p i ( X ~ − B ) 2 A Y ~ − y ( X ~ − B ) ≥ p i ( X ~ − B ) 2 A Y ~ ≥ p i ( X ~ − B ) 2 + y ( X ~ − B ) A Y ~ ≥ p i ( X ~ − B ) 2 + p i x ( X ~ − B ) A Y ~ ≥ p i ( X ~ − B ) ( ( X ~ − B ) + x ) Y ~ X ~ − B ≥ p i p ~ ≥ p i \begin{aligned}
D &\ge p_i (\tilde X - B)^2 \\
L^2 + A (\tilde Y - y) &\ge p_i (\tilde X - B)^2 \\
L^2 + A \tilde Y - yx - y(\tilde X - B) &\ge p_i (\tilde X - B)^2 \\
A \tilde Y - y(\tilde X - B) &\ge p_i (\tilde X - B)^2 \\
A \tilde Y &\ge p_i (\tilde X - B)^2 + y(\tilde X - B) \\
A \tilde Y &\ge p_i (\tilde X - B)^2 + p_i x(\tilde X - B) \\
A \tilde Y &\ge p_i (\tilde X - B)\big((\tilde X - B) + x\big) \\
\frac{\tilde Y}{\tilde X - B} &\ge p_i \\
\tilde p &\ge p_i
\end{aligned} D L 2 + A ( Y ~ − y ) L 2 + A Y ~ − y x − y ( X ~ − B ) A Y ~ − y ( X ~ − B ) A Y ~ A Y ~ A Y ~ X ~ − B Y ~ p ~ ≥ p i ( X ~ − B ) 2 ≥ p i ( X ~ − B ) 2 ≥ p i ( X ~ − B ) 2 ≥ p i ( X ~ − B ) 2 ≥ p i ( X ~ − B ) 2 + y ( X ~ − B ) ≥ p i ( X ~ − B ) 2 + p i x ( X ~ − B ) ≥ p i ( X ~ − B ) ( ( X ~ − B ) + x ) ≥ p i ≥ p i
This is the precondition for the calculation which makes our lemma s + ≥ l s_+ \ge l s + ≥ l true!
Final Proposition
Thanks to lemmas 3-5 we have now proven the required facts to know that s + s_+ s + gives us the unique p ⋆ \sqrt{p_\star} p ⋆ .