EffortRegimes.lean
Board Support, CEO (Mis)Reporting, and Scapegoating · December 2, 2026 verification
1import EffortResponse23open Std Lean.Grind Scapegoating Disclosure EffortContract4namespace EffortRegimes5variable {R : Type} [Field R] [LE R] [LT R] [IsLinearOrder R] [LawfulOrderLT R] [OrderedRing R]67/-- Signal probability, marginal productivity, and the two type posteriors at a fixed support. -/8structure Site (R : Type) [Field R] [LE R] [LT R] where9 h0 : R10 v : R11 high : R12 low : R → R13 K : R14 X : R15 L : R16 cash : 1<L ∧ L<X17 start : 0<h018 speed : 0<v19 cap : h0+v<120 bayes : ∀ e, 0≤e → e≤1 → 0<high-low e ∧ high-low e<1 ∧21 (1-(h0+v*e))*(high-low e)=K22 viable : K<h0*(X-L)2324namespace Site25variable (S : Site R)26def h (x : R) := S.h0+S.v*x27def r (x : R) := S.high-S.low x2829private theorem probability {x : R} (hx : 0≤x) (ux : x≤1) : 0<S.h x ∧ S.h x<1 := by30 have := OrderedRing.mul_nonneg (le_of_lt S.speed) hx31 have := OrderedRing.mul_le_mul_of_nonneg_left ux (le_of_lt S.speed)32 have := S.start; have := S.cap; dsimp [h]; grind3334/-- A truthful comparator includes the board's optimal action after each signal;35support cost is common, and L is included. -/36def boundsTruth (m ψ V : R) := ∀ x lo hi d0 dx, Implements S.r S.v m ψ x lo hi d0 dx →37 d0≤hi → dx≤lo → S.L+board S.h0 S.v (S.X-S.L) x lo hi≤V3839theorem implement (m ψ x b : R) (hm : 0<m ∧ m<1) (hp : 0<ψ)40 (x0 : 0≤x) (x1 : x≤1) (bn : 0≤b)41 (eqn : ψ*x=S.v*(1-m)*(b+S.r x)) :42 Implements S.r S.v m ψ x (m*(b+S.r x)) b 0 0 := by43 let w := (1-m)*(b+S.r x)44 have hh := S.probability x0 x145 have rp : 0<S.r x := (S.bayes x x0 x1).146 have wp := OrderedRing.mul_pos (show 0<1-m by grind) (show 0<b+S.r x by grind)47 have T := (targetContract (S.h x) m (S.r x) w b hh.1 hh.2 hm.1 hm.2 rp (le_of_lt wp)48 (Or.inr ⟨bn,rfl⟩)).149 have lowEq : b+S.r x-w=m*(b+S.r x) := by dsimp [w]; grind50 rw [lowEq] at T51 refine ⟨x0,x1,T,?_⟩52 intro t _ _53 by_cases eq : t=x54 · rw [eq]; grind55 · apply le_of_lt56 have H := Verification.quadraticChoice ψ x (S.v*(b+S.r x-m*(b+S.r x))) hp (by grind) t eq57 grind5859/-- From any negative effort wedge there is a larger truthful zero-bonus root.60This interval argument needs no cross-support monotonicity assumption. -/61private theorem largerRoot (complete : CompleteSupport R) (m ψ x : R)62 (hm : 0<m ∧ m<1) (big : 1<ψ) (x0 : 0≤x) (x1 : x≤1)63 (below : ψ*x<S.v*(1-m)*S.r x) :64 ∃ y, x<y ∧ y<1 ∧ ψ*y=S.v*(1-m)*S.r y := by65 let k := S.v*(1-m)66 let F := fun y => ψ*y*(1-S.h y)67 have kp : 0<k := OrderedRing.mul_pos S.speed (by grind)68 have kv := OrderedRing.mul_lt_mul_of_pos_left (show 1-m<1 by grind) S.speed69 have k1 : k<1 := by have := S.cap; have := S.start; dsimp [k]; grind70 have signs (t : R) (t0 : 0≤t) (t1 : t≤1) :71 F t-k*S.K=(ψ*t-k*S.r t)*(1-S.h t) := by72 have a := congrArg (fun u => k*u) (S.bayes t t0 t1).2.273 dsimp [F,r,h]; grind74 have h1 := S.probability (x:=1) (by grind) (by grind)75 have hx := S.probability x0 x176 have rp : S.r 1<1 := (S.bayes 1 (by grind) (by grind)).2.177 have z := OrderedRing.mul_lt_mul_of_pos_left rp kp78 have p := OrderedRing.mul_pos (show 0<ψ*1-k*S.r 1 by grind) (show 0<1-S.h 1 by grind)79 have n := OrderedRing.mul_pos (show 0<k*S.r x-ψ*x by change ψ*x<k*S.r x at below; grind) (show 0<1-S.h x by grind)80 have H : F x<k*S.K := by have := signs x x0 x1; grind81 have I : k*S.K<F 1 := by have := signs 1 (by grind) (by grind); grind82 have xlt : x<1 := by by_cases eq : x=1 <;> grind83 have C : ContinuousSupport F := by84 apply Posterior.continuousOfDerivatives85 intro t _86 let f := fun z : R => ψ*(1-S.h0)*z+(-ψ*S.v)*(z*z)+087 have eq : f=F := by funext u; dsimp [F,h,f]; grind88 rw [← eq]89 exact ⟨_,Posterior.affineSlope _ _ _ (Posterior.identitySlope t)90 (Posterior.mulSlope (Posterior.identitySlope t) (Posterior.identitySlope t))⟩91 obtain ⟨y,xy,y1,root⟩ := intermediateValue F x 1 (k*S.K) x0 xlt H I C complete92 have yf := S.probability (x:=y) (by grind) (by grind)93 have Y := signs y (by grind) (by grind)94 refine ⟨y,xy,y1,?_⟩95 apply le_antisymm <;> apply (Field.IsOrdered.mul_le_mul_iff_of_pos_right (show 0<1-S.h y by grind)).mp <;> grind9697private theorem lowEffort (complete : CompleteSupport R) (m ψ x V : R)98 (hm : 0<m ∧ m<1) (big : 1<ψ) (x0 : 0≤x) (x1 : x≤1)99 (below : ψ*x<S.v*(1-m)*S.r x) (bound : S.boundsTruth m ψ V) :100 S.h x*S.X+(1-m)*(1-S.h x)*S.L<V ∧ S.h x*S.X<V ∧101 S.L+(1-m)*S.h x*(S.X-S.L)<V ∧ S.L<V := by102 obtain ⟨y,xy,y1,root⟩ := S.largerRoot complete m ψ x hm big x0 x1 below103 have yn : 0≤y := by grind104 have I := S.implement m ψ y 0 hm (by grind) yn (by grind) (by grind) (by grind)105 have Vb := bound y _ _ _ _ I (by grind) I.2.2.1.1106 have K := congrArg (fun z => m*z) (S.bayes y yn (by grind)).2.2107 have paid : S.L+S.h y*(S.X-S.L)-m*S.K≤V := by108 dsimp [board,cost,r,h] at Vb K ⊢; grind109 have hx := S.probability x0 x1110 have hxy := OrderedRing.mul_lt_mul_of_pos_left xy S.speed111 have hvi := OrderedRing.mul_nonneg (OrderedRing.mul_nonneg (le_of_lt S.speed) x0)112 (show 0≤S.X-S.L by have := S.cash; grind)113 have b := S.bayes x x0 x1114 have g := poolingBelowBoundary (S.h x) (S.h y) m (S.r x) S.K S.X S.L hx.1 hx.2115 (by dsimp [h]; grind) hm.1 hm.2 b.1 (by have := S.cash; change S.high-S.low x<_; grind)116 S.cash.2 b.2.2.symm (by have := S.viable; dsimp [h]; grind)117 grind118119def bestEffort (ψ x up down : R) := ∀ y, 0≤y → y≤1 →120 2*S.v*(up-down)*y-ψ*y*y≤2*S.v*(up-down)*x-ψ*x*x121122/-- Bayes' posterior at the single unflagged history in each pooling regime. -/123def highPool (m x : R) := (S.h x*S.high+m*(1-S.h x)*S.low x)/(S.h x+m*(1-S.h x))124def lowPool (m x : R) := (m*S.h x*S.high+(1-S.h x)*S.low x)/(1-S.h x+m*S.h x)125126theorem highPooling (complete : CompleteSupport R) (m ψ x b d q V : R)127 (hm : 0<m ∧ m<1) (big : 1<ψ) (xb : 0≤x ∧ x≤1)128 (bn : 0≤b) (dn : 0≤d) (lot : 0≤q ∧ q≤1)129 (eff : S.bestEffort ψ x (b+S.highPool m x)130 (m*(b+S.highPool m x)+(1-m)*(d+S.low x))) (bound : S.boundsTruth m ψ V) :131 let p := S.h x132 let wages := (p+m*(1-p))*b+(1-m)*(1-p)*d133 q*(p*S.X+(1-m)*(1-p)*S.L)+(1-q)*S.L-wages<V := by134 let p := S.h x135 let w := (p+m*(1-p))*b+(1-m)*(1-p)*d136 have P : 0<p ∧ p<1 := S.probability xb.1 xb.2137 have k := OrderedRing.mul_pos S.speed (show 0<1-m by grind)138 have mF := OrderedRing.mul_pos hm.1 (show 0<1-p by grind)139 have wp : 0≤w := by140 have := OrderedRing.mul_nonneg (show 0≤p+m*(1-p) by grind) bn141 have := OrderedRing.mul_nonneg (OrderedRing.mul_nonneg (show 0≤1-m by grind) (show 0≤1-p by grind)) dn142 dsimp [w]; grind143 have rp : 0<S.r x := (S.bayes x xb.1 xb.2).1144 have alt0 := S.lowEffort complete m ψ 0 V hm big (by grind) (by grind)145 (by have := OrderedRing.mul_pos k (S.bayes 0 (by grind) (by grind)).1; dsimp [r]; grind) bound146 have liq : S.L-w<V := by grind147 have cont : p*S.X+(1-m)*(1-p)*S.L-w<V := by148 by_cases below : ψ*x<S.v*(1-m)*S.r x149 · have := (S.lowEffort complete m ψ x V hm big xb.1 xb.2 below bound).1150 change p*S.X+(1-m)*(1-p)*S.L<V at this; grind151 · let t := ψ*x/((1-m)*S.v)152 have tEq : t*((1-m)*S.v)=ψ*x := Field.div_mul_cancel (by grind)153 have non : 0≤t-S.r x := by apply (Field.IsOrdered.mul_le_mul_iff_of_pos_right k).mp; grind154 have I := S.implement m ψ x (t-S.r x) hm (by grind) xb.1 xb.2 non (by grind)155 have truth := bound x _ _ _ _ I non I.2.2.1.1156 have pos : 0<x := by have := OrderedRing.mul_pos k rp; by_cases eq : x=0 <;> grind157 have H := Verification.poolingHighFromHistories p m S.high (S.low x) b d S.v ψ x158 P.1 P.2 hm.1 hm.2 S.speed (by grind) pos xb.2 eff159 have more := highPoolingSameEffort p m (S.r x) t b d S.X S.L P.1 P.2 hm.1160 (by have := S.cash; grind) dn H161 change S.L+(p*(S.X-S.L)-((1-p)*(m*(t-S.r x+S.r x))+p*(t-S.r x)))≤V at truth162 dsimp only [w]; grind163 have Z := Verification.mixtureDominated (p*S.X+(1-m)*(1-p)*S.L-w) (S.L-w) V q cont liq lot.1 lot.2164 change q*(p*S.X+(1-m)*(1-p)*S.L)+(1-q)*S.L-w<V; grind165166theorem lowPooling (complete : CompleteSupport R) (m ψ x b d q V : R)167 (hm : 0<m ∧ m<1) (big : 1<ψ) (xb : 0≤x ∧ x≤1)168 (bn : 0≤b) (dn : 0≤d) (cap : d≤b) (lot : 0≤q ∧ q≤1)169 (eff : S.bestEffort ψ x (m*(b+S.lowPool m x)+(1-m)*(d+S.high)) (b+S.lowPool m x))170 (bound : S.boundsTruth m ψ V) :171 let p := S.h x172 q*(p*S.X)+(1-q)*(S.L+(1-m)*p*(S.X-S.L))-((1-p+m*p)*b+(1-m)*p*d)<V := by173 let p := S.h x174 have P : 0<p ∧ p<1 := S.probability xb.1 xb.2175 have rp := (S.bayes x xb.1 xb.2).1176 have below : ψ*x<S.v*(1-m)*S.r x := by177 by_cases pos : 0<x178 · exact Verification.poolingLowFromHistories p m S.high (S.low x) b d S.v ψ x179 P.1 P.2 hm.1 hm.2 (by grind) S.speed (by grind) pos xb.2 cap eff180 · have := OrderedRing.mul_pos (OrderedRing.mul_pos S.speed (show 0<1-m by grind)) rp181 have : x=0 := by grind182 dsimp [r]; grind183 have H := S.lowEffort complete m ψ x V hm big xb.1 xb.2 below bound184 have Z := Verification.mixtureDominated (p*S.X) (S.L+(1-m)*p*(S.X-S.L)) V q H.2.1 H.2.2.1 lot.1 lot.2185 have mP := OrderedRing.mul_nonneg (le_of_lt hm.1) (le_of_lt P.1)186 have := OrderedRing.mul_nonneg (show 0≤1-p+m*p by grind) bn187 have := OrderedRing.mul_nonneg (OrderedRing.mul_nonneg (show 0≤1-m by grind) (le_of_lt P.1)) dn188 change q*(p*S.X)+(1-q)*(S.L+(1-m)*p*(S.X-S.L))-((1-p+m*p)*b+(1-m)*p*d)<V; grind189190theorem beatsLiquidation (complete : CompleteSupport R) (m ψ V : R) (hm : 0<m ∧ m<1)191 (big : 1<ψ) (bound : S.boundsTruth m ψ V) : S.L<V := by192 have k := OrderedRing.mul_pos S.speed (show 0<1-m by grind)193 exact (S.lowEffort complete m ψ 0 V hm big (by grind) (by grind)194 (by have := OrderedRing.mul_pos k (S.bayes 0 (by grind) (by grind)).1; dsimp [r]; grind) bound).2.2.2195196end Site197198/-- Construct all fixed-support objects from the paper's production probabilities.199Viability at zero effort implies viability at every higher effort. -/200def fromEconomy (E : Economy R) (s a : R) (hs : 0≤s) (ha : 0<a ∧ a<1)201 (viable : 1-E.β≤a*E.P s*(E.X-E.L)) : Site R where202 h0 := a*E.P s203 v := (1-a)*E.P s204 high := E.H s205 low := fun x => lowRep E.β (E.G s) (E.P s) (a+(1-a)*x)206 K := E.H s-E.β207 X := E.X208 L := E.L209 cash := E.cash210 start := OrderedRing.mul_pos ha.1 (E.probabilities s hs).1211 speed := OrderedRing.mul_pos (by grind) (E.probabilities s hs).1212 cap := by have := E.probabilities s hs; grind213 viable := by have := E.probabilities s hs; grind214 bayes := by215 intro x x0 x1216 let z := a+(1-a)*x217 have := OrderedRing.mul_nonneg (show 0≤1-a by grind) x0218 have := OrderedRing.mul_le_mul_of_nonneg_left x1 (show 0≤1-a by grind)219 have tech := E.tech s hs220 have zp : 0<z := by dsimp [z]; grind221 have z1 : z≤1 := by dsimp [z]; grind222 have A := spreadBounds E.β (E.G s) (E.B s) z E.prior.1 E.prior.2 tech.1 tech.2.1 tech.2.2 zp z1223 have B := (bayesCancellation E.β (E.G s) (E.B s) z E.prior.1 E.prior.2 tech.1 tech.2.1 tech.2.2 zp z1).1224 change z*E.P s*E.H s+(1-z*E.P s)*lowRep E.β (E.G s) (E.P s) z=E.β at B225 refine ⟨A.1,A.2,?_⟩226 dsimp [z] at B; grind227228inductive Rule where | truth | high | low | invert229 deriving DecidableEq230231/-- Endogenous effort optimality and payoff under a pure reporting rule.232Corrected reports reveal the signal. q is the continuation probability after233an unflagged pooled report; under truth q and u are those after high and low. -/234def Outcome (S : Site R) (m ψ : R) (rule : Rule) (x lo hi d0 dx q u W : R) : Prop :=235 0≤x ∧ x≤1 ∧ 0≤lo ∧ 0≤hi ∧ 0≤d0 ∧ 0≤dx ∧ d0≤hi ∧ dx≤lo ∧236 0≤q ∧ q≤1 ∧ 0≤u ∧ u≤1 ∧237 match rule with238 | .truth => Implements S.r S.v m ψ x lo hi d0 dx ∧239 W=S.L+S.h x*q*(S.X-S.L)-(1-S.h x)*u*S.L-cost (S.h x) lo hi240 | .high => S.bestEffort ψ x (hi+S.highPool m x) (m*(hi+S.highPool m x)+(1-m)*(d0+S.low x)) ∧241 W=q*(S.h x*S.X+(1-m)*(1-S.h x)*S.L)+(1-q)*S.L-242 ((S.h x+m*(1-S.h x))*hi+(1-m)*(1-S.h x)*d0)243 | .low => S.bestEffort ψ x (m*(lo+S.lowPool m x)+(1-m)*(dx+S.high)) (lo+S.lowPool m x) ∧244 W=q*(S.h x*S.X)+(1-q)*(S.L+(1-m)*S.h x*(S.X-S.L))-((1-S.h x+m*S.h x)*lo+(1-m)*S.h x*dx)245 | .invert => hi<m*lo+(1-m)*dx+S.r x ∧ lo+S.r x<m*hi+(1-m)*d0246247/-- Lemma 3. V is the attained truthful value before support cost, and star248its unique net-payoff maximizing support, as maintained in the paper.249A candidate attaining at least that net value must have the stated support,250truthful reports and strictly signal-contingent continuation. -/251theorem globalOptimality (E : Economy R) (complete : CompleteSupport R) (a m ψ star : R)252 (ha : 0<a ∧ a<1) (hm : 0<m ∧ m<1) (big : 1<ψ)253 (viable : ∀ s, 0≤s → 1-E.β≤a*E.P s*(E.X-E.L)) (V : R → R)254 (value : ∀ s (hs : 0≤s), (fromEconomy E s a hs ha (viable s hs)).boundsTruth m ψ (V s) ∧255 ∃ e lo hi d0 dx, let S := fromEconomy E s a hs ha (viable s hs)256 Implements S.r S.v m ψ e lo hi d0 dx ∧ d0≤hi ∧ dx≤lo ∧257 E.L+board S.h0 S.v (E.X-E.L) e lo hi=V s)258 (peak : Maximizes (fun s => V s-E.C s) star)259 (unique : ∀ s, 0≤s → V s-E.C s=V star-E.C star → s=star)260 (zero : E.C 0=0) :261 E.L<V star-E.C star ∧262 (∀ s (hs : 0≤s) rule x lo hi d0 dx q u W,263 Outcome (fromEconomy E s a hs ha (viable s hs)) m ψ rule x lo hi d0 dx q u W →264 V star-E.C star≤W-E.C s → rule=.truth ∧ s=star ∧ q=1 ∧ u=0) ∧265 ∃ e lo hi d0 dx, Outcome (fromEconomy E star a peak.1 ha (viable star peak.1)) m ψ266 .truth e lo hi d0 dx 1 0 (V star) := by267 have zeroP := peak.2 0 (le_refl _)268 have zeroV := (fromEconomy E 0 a (le_refl _) ha (viable 0 (le_refl _))).beatsLiquidation269 complete m ψ (V 0) hm big (value 0 (le_refl _)).1270 change E.L<V 0 at zeroV271 constructor272 · change V 0-E.C 0≤V star-E.C star at zeroP; grind273 constructor274 · intro s hs rule x lo hi d0 dx q u W out win275 let S := fromEconomy E s a hs ha (viable s hs)276 have bound : S.boundsTruth m ψ (V s) := (value s hs).1277 have best := peak.2 s hs278 change V s-E.C s≤V star-E.C star at best279 have upper : V s≤W := by grind280 obtain ⟨xn,x1,ln,hn,dn,en,cap0,capX,qn,q1,un,u1,hyp⟩ := out281 cases rule with282 | high =>283 have Z := S.highPooling complete m ψ x hi d0 q (V s) hm big ⟨xn,x1⟩ hn dn ⟨qn,q1⟩ hyp.1 bound284 exact False.elim ((not_lt_of_ge upper) (hyp.2 ▸ Z))285 | low =>286 have Z := S.lowPooling complete m ψ x lo dx q (V s) hm big ⟨xn,x1⟩ ln en capX ⟨qn,q1⟩ hyp.1 bound287 exact False.elim ((not_lt_of_ge upper) (hyp.2 ▸ Z))288 | invert => exact False.elim (noInversion m (S.r x) lo hi d0 dx hm.2 cap0 capX hyp)289 | truth =>290 have Z := bound x lo hi d0 dx hyp.1 cap0 capX291 have eqn : W=S.L+S.h x*q*(S.X-S.L)-(1-S.h x)*u*S.L-cost (S.h x) lo hi := hyp.2292 have p := S.probability xn x1293 have A := OrderedRing.mul_pos p.1 (show 0<S.X-S.L by have := S.cash; grind)294 have B := OrderedRing.mul_pos (show 0<1-S.h x by grind) (show 0<S.L by have := S.cash; grind)295 have c := OrderedRing.mul_nonneg (le_of_lt A) (show 0≤1-q by grind)296 have d := OrderedRing.mul_nonneg (le_of_lt B) un297 change S.L+(S.h x*(S.X-S.L)-cost (S.h x) lo hi)≤V s at Z298 exact ⟨rfl,unique s hs (by grind),299 le_antisymm q1 ((Field.IsOrdered.mul_le_mul_iff_of_pos_left A).mp (by grind)),300 le_antisymm ((Field.IsOrdered.mul_le_mul_iff_of_pos_left B).mp (by grind)) un⟩301 · let S := fromEconomy E star a peak.1 ha (viable star peak.1)302 obtain ⟨x,lo,hi,d0,dx,I,c0,cX,eq⟩ := (value star peak.1).2303 have ic := I.2.2.1304 refine ⟨x,lo,hi,d0,dx,I.1,I.2.1,ic.1,ic.2.1,ic.2.2.1,ic.2.2.2.1,c0,cX,305 by grind,by grind,by grind,by grind,I,?_⟩306 change E.L+(S.h x*(E.X-E.L)-cost (S.h x) lo hi)=V star at eq307 change V star=E.L+S.h x*1*(E.X-E.L)-(1-S.h x)*0*E.L-cost (S.h x) lo hi308 grind309/-- Necessity in Lemma 3 without postulating any maximized truthful-value310function or any uniformly increasing bonus schedule. Only feasible truthful311deviations enter the board's optimality test. In particular, the chosen312support attains the optimum over all truthful contracts at all supports. -/313theorem everyBoardOptimum (E : Economy R) (complete : CompleteSupport R)314 (a m ψ : R) (ha : 0<a ∧ a<1) (hm : 0<m ∧ m<1) (big : 1<ψ) (zero : E.C 0=0)315 (viable : ∀ s, 0≤s → 1-E.β≤a*E.P s*(E.X-E.L))316 (s : R) (hs : 0≤s) (rule : Rule) (x lo hi d0 dx q u W : R)317 (out : Outcome (fromEconomy E s a hs ha (viable s hs)) m ψ rule x lo hi d0 dx q u W)318 (best : ∀ t (ht : 0≤t), (fromEconomy E t a ht ha (viable t ht)).boundsTruth m ψ (W-E.C s+E.C t)) :319 let S := fromEconomy E s a hs ha (viable s hs)320 rule=.truth ∧ q=1 ∧ u=0 ∧ E.L<W-E.C s ∧ Implements S.r S.v m ψ x lo hi d0 dx ∧321 ∀ t (ht : 0≤t) e l b c0 cX, let T := fromEconomy E t a ht ha (viable t ht)322 Implements T.r T.v m ψ e l b c0 cX → c0≤b → cX≤l →323 T.L+board T.h0 T.v (T.X-T.L) e l b-E.C t≤S.L+board S.h0 S.v (S.X-S.L) x lo hi-E.C s := by324 let S := fromEconomy E s a hs ha (viable s hs)325 have same : S.boundsTruth m ψ W := by326 have h := best s hs327 rwa [show W-E.C s+E.C s=W by grind] at h328 have zeroV := (fromEconomy E 0 a (le_refl _) ha (viable 0 (le_refl _))).beatsLiquidation329 complete m ψ _ hm big (best 0 (le_refl _))330 change E.L<W-E.C s+E.C 0 at zeroV331 obtain ⟨xn,x1,ln,hn,dn,en,c0,cX,qn,q1,un,u1,H⟩ := out332 cases rule with333 | high =>334 have z := S.highPooling complete m ψ x hi d0 q W hm big ⟨xn,x1⟩ hn dn ⟨qn,q1⟩ H.1 same335 exact False.elim (lt_irrefl (show W<W from H.2 ▸ z))336 | low =>337 have z := S.lowPooling complete m ψ x lo dx q W hm big ⟨xn,x1⟩ ln en cX ⟨qn,q1⟩ H.1 same338 exact False.elim (lt_irrefl (show W<W from H.2 ▸ z))339 | invert => exact False.elim (noInversion m (S.r x) lo hi d0 dx hm.2 c0 cX H)340 | truth =>341 have bound := same x lo hi d0 dx H.1 c0 cX342 have eqn : W=S.L+S.h x*q*(S.X-S.L)-(1-S.h x)*u*S.L-cost (S.h x) lo hi := H.2343 change S.L+(S.h x*(S.X-S.L)-cost (S.h x) lo hi)≤W at bound344 have p := S.probability xn x1345 have A := OrderedRing.mul_pos p.1 (show 0<S.X-S.L by have := S.cash; grind)346 have B := OrderedRing.mul_pos (show 0<1-S.h x by grind) (show 0<S.L by have := S.cash; grind)347 have c := OrderedRing.mul_nonneg (le_of_lt A) (show 0≤1-q by grind)348 have d := OrderedRing.mul_nonneg (le_of_lt B) un349 have qEq : q=1 := le_antisymm q1 ((Field.IsOrdered.mul_le_mul_iff_of_pos_left A).mp (by grind))350 have uEq : u=0 := le_antisymm ((Field.IsOrdered.mul_le_mul_iff_of_pos_left B).mp (by grind)) un351 refine ⟨rfl,qEq,uEq,by grind,H.1,?_⟩352 intro t ht e l b c0 cX T impl cap pay353 have h := best t ht e l b c0 cX impl cap pay354 change T.L+board T.h0 T.v (T.X-T.L) e l b-E.C t≤S.L+(S.h x*(S.X-S.L)-cost (S.h x) lo hi)-E.C s355 change T.L+board T.h0 T.v (T.X-T.L) e l b≤W-E.C s+E.C t at h356 rw [qEq,uEq] at eqn; grind357end EffortRegimes