EffortResults.lean

Board Support, CEO (Mis)Reporting, and Scapegoating · December 2, 2026 verification

1import EffortControls23open Std Lean.Grind Scapegoating Disclosure EffortContract EffortSupport EffortBenchmarks EffortControls EffortBranches Posterior4namespace EffortResults5variable {R : Type} [Field R] [LE R] [LT R] [IsLinearOrder R] [LawfulOrderLT R] [OrderedRing R]67/-- One effort-cost cutoff for the original contracting problem at every support8and every interior control level under global complementarity. -/9theorem uniformChoices (E : Economy R) (complete : CompleteSupport R) (comp : E.complement)10    (a : R) (ha : 0<a ∧ a<1) :11    ∃ cutoff, 0<cutoff ∧ ∀ ψ, cutoff≤ψ → 4*(E.X-E.L+1)<ψ ∧12      ∃ e b : R → R → R, ∀ m, 0<m ∧ m<1 → Choices E a m ψ (e m) (b m) := by13  classical14  obtain ⟨d,dp,F⟩ := EffortSchedule.failureFloor E complete comp15  let Q := E.X-E.L16  have Qp : 0<Q := by have := E.cash; dsimp [Q]; grind17  let n := 1/(d*d*d)18  have sq := OrderedRing.mul_pos dp dp19  have cube := OrderedRing.mul_pos sq dp20  have nEq : n*(d*d*d)=1 := Field.div_mul_cancel (by grind)21  have np : 0<n := by apply (Field.IsOrdered.mul_lt_mul_iff_of_pos_right cube).mp; grind22  let cutoff := n+4*(Q+1)+123  refine ⟨cutoff,by dsimp [cutoff]; grind,?_⟩24  intro ψ size25  have big : 4*(Q+1)<ψ := by dsimp [cutoff] at size; grind26  have ψp : 0<ψ := by grind27  have field (m s : R) (hm : 0<m ∧ m<1) (hs : 0≤s) :28      ∃ x b, Optimal (reputation E a s) (a*E.P s) ((1-a)*E.P s) Q m ψ x b := by29    let D := 1-E.P s30    have dd : d<D := F s hs31    have dp' : 0<D := by grind32    have P := E.probabilities s hs33    have bigD := OrderedRing.mul_lt_mul_of_pos_right (show n<ψ by dsimp [cutoff] at size; grind) cube34    have d1 := OrderedRing.mul_lt_mul_of_pos_right dd dp35    have d2 := OrderedRing.mul_lt_mul_of_pos_left dd dp'36    have d3 := OrderedRing.mul_lt_mul_of_pos_right (show d*d<D*D by grind) dp37    have d4 := OrderedRing.mul_lt_mul_of_pos_left dd (OrderedRing.mul_pos dp' dp')38    have d5 := OrderedRing.mul_lt_mul_of_pos_left (show d*d*d<D*D*D by grind) ψp39    have d6 := OrderedRing.mul_lt_mul_of_pos_left (show D<1 by dsimp [D]; grind) (OrderedRing.mul_pos dp' dp')40    have d7 := OrderedRing.mul_lt_mul_of_pos_left (show D*D*D<D*D by grind) ψp41    let A := localData E comp s a ψ hs ha big42    have kp := A.mass43    have K1 : A.K<1 := by have := A.hpos; have := A.vpos; grind44    apply chooseAtSupport _ A.h A.v Q m ψ A.K D A.hpos A.vpos (by dsimp [A,localData,D]; grind)45      dp' Qp hm kp.1 K1 _ (by grind) (by grind) (by grind) complete46    intro x xn x147    have rep := (bayesEffort E a s x ha hs ⟨xn,x1⟩).2.2.248    dsimp [A,localData,EffortContract.failure] at rep ⊢; grind49  let e := fun m s => if h : (0<m ∧ m<1) ∧ 0≤s then Classical.choose (field m s h.1 h.2) else 050  let b := fun m s => if h : (0<m ∧ m<1) ∧ 0≤s then Classical.choose (Classical.choose_spec (field m s h.1 h.2)) else 051  refine ⟨big,e,b,?_⟩52  intro m hm s hs53  simpa only [e,b,dite_eq_left (And.intro hm hs)] using Classical.choose_spec (Classical.choose_spec (field m s hm hs))5455private abbrev At (c : R) (f : R → R) := Tends c f (f c)56private theorem constantAt (c k : R) : At c (fun _ => k) := slopeLimit (Data.constD k c)57private theorem affineAt {c : R} {f g : R → R} (a b k : R) (F : At c f) (G : At c g) :58    At c (fun x => a*f x+b*g x+k) := affineLimit a b k F G59private theorem scaleAt {c : R} {f : R → R} (a : R) (F : At c f) :60    At c (fun x => a*f x) := by simpa only [Semiring.zero_mul,Semiring.add_zero] using affineAt a 0 0 F F61private theorem subAt {c : R} {f g : R → R} (F : At c f) (G : At c g) : At c (fun x => f x-g x) := by62  have eq : (fun x => (1:R)*f x+(-1)*g x+0)=(fun x => f x-g x) := by funext x; grind63  rw [← eq]; exact affineAt 1 (-1) 0 F G64omit [IsLinearOrder R] [LawfulOrderLT R] [OrderedRing R] in65private theorem continuousAt {c : R} {f : R → R} (hs : 0≤c) (H : ContinuousSupport f) : At c f := by66  intro ε ep; obtain ⟨δ,dp,N⟩ := H c hs ε ep; exact ⟨δ,dp,fun x h l r _ => N x h l r⟩67private theorem extendAt {f : R → R} (F : ∀ c, 0≤c → At c f) : ContinuousSupport f := by68  intro c hc ε ep; obtain ⟨δ,dp,N⟩ := F c hc ε ep69  refine ⟨δ,dp,?_⟩; intro x hx l r; by_cases eq : x=c70  · rw [eq]; grind71  · exact N x hx l r eq72private theorem nearbyLess {c : R} {f g : R → R} (F : At c f) (G : At c g) (gap : f c<g c) :73    ∃ δ, 0<δ ∧ ∀ x, 0≤x → c-δ<x → x<c+δ → f x<g x := by74  obtain ⟨δ,dp,N⟩ := subAt F G (g c-f c) (by grind)75  refine ⟨δ,dp,?_⟩; intro x hx l r; by_cases eq : x=c76  · exact eq ▸ gap77  · have h := (N x hx l r eq).2; dsimp only at h; grind7879private def speed (E : Economy R) (a s : R) := (1-a)*E.P s80private def fracMass (E : Economy R) (a z s : R) := mass E s/(1-(a*E.P s+speed E a s*z))81private def price (E : Economy R) (a ψ m s : R) := m*(ψ/((1-m)*speed E a s))82private def ip (E : Economy R) (a ψ z s : R) := speed E a s*(E.X-E.L)-ψ*(a*E.P s)/speed E a s-2*ψ*z+83    speed E a s*fracMass E a z s/(1-(a*E.P s+speed E a s*z))84private def zp (E : Economy R) (a ψ z s : R) := fracMass E a z s/z-ψ/speed E a s8586private theorem priceLimits (E : Economy R) (comp : E.complement) (a ψ m z c : R)87    (ha : 0<a ∧ a<1) (hm : 0<m ∧ m<1) (hc : 0≤c) (Z : 0<z ∧ z<1) :88    At c (price E a ψ m) ∧ At c (ip E a ψ z) ∧ At c (zp E a ψ z) := by89  let v := speed E a90  let h := fun s => a*E.P s91  let f := fun s => 1-(h s+v s*z)92  have D := primitive E comp c hc93  have P := slopeLimit D.194  have H := scaleAt a P95  have V : At c v := scaleAt (1-a) P96  have vpos : 0<v c := OrderedRing.mul_pos (by grind) (E.probabilities c hc).197  have feq : (fun s => (-1)*h s+(-z)*v s+1)=f := by funext s; dsimp [f]; grind98  have F : At c f := feq ▸ affineAt (-1) (-z) 1 H V99  have fp : 0<f c := by100    have Z0 := (bayesEffort E a c z ha hc ⟨le_of_lt Z.1,le_of_lt Z.2⟩).1101    dsimp [f,v,h,speed,EffortContract.failure] at *; grind102  have R' : At c (fracMass E a z) := divLimit (slopeLimit D.2.1) F fp103  have rE := divLimit (mulLimit V R') F fp104  have base := subAt (mulLimit V (constantAt c (E.X-E.L))) (divLimit (scaleAt ψ H) V vpos)105  have mid := subAt base (constantAt c (2*ψ*z))106  have i : At c (ip E a ψ z) := by107    change At c (fun x => v x*(E.X-E.L)-ψ*(a*E.P x)/v x-2*ψ*z+v x*fracMass E a z x/f x)108    simpa only [Semiring.one_mul,Semiring.add_zero] using affineAt 1 1 0 mid rE109  exact ⟨scaleAt m (divLimit (constantAt c ψ) (scaleAt (1-m) V) (OrderedRing.mul_pos (by grind) vpos)),110    i,subAt (divLimit R' (constantAt c z) Z.1) (divLimit (constantAt c ψ) V vpos)⟩111112/-- The optimal effort lies on one side of any test effort precisely when113both implied prices are below the control price, or one is above it. -/114private theorem testPrices (E : Economy R) (complete : CompleteSupport R) (comp : E.complement)115    (a m ψ s x b z : R) (ha : 0<a ∧ a<1) (hm : 0<m ∧ m<1) (hs : 0≤s)116    (big : 4*(E.X-E.L+1)<ψ) (O : Optimal (reputation E a s) (a*E.P s) ((1-a)*E.P s) (E.X-E.L) m ψ x b)117    (Z : 0<z ∧ 4*z<1) :118    (x<z ↔ ip E a ψ z s<price E a ψ m s ∧ zp E a ψ z s<price E a ψ m s) ∧119    (z<x ↔ price E a ψ m s<ip E a ψ z s ∨ price E a ψ m s<zp E a ψ z s) := by120  let A := localData E comp s a ψ hs ha big121  let q := price E a ψ m s122  obtain ⟨X,_,zB,ze,iB,ie⟩ := contractFOC E comp a m ψ s x b hs ha hm big O123  have either : A.interiorPrice x=q ∨ A.zeroPrice x=q := by124    by_cases b0 : b=0125    · exact Or.inr (ze b0)126    · exact Or.inl (ie (by have := O.2.2.1; grind))127  change A.zeroPrice x≤q at zB; change A.interiorPrice x≤q at iB128  change (x<z ↔ A.interiorPrice z<q ∧ A.zeroPrice z<q) ∧ (z<x ↔ q<A.interiorPrice z ∨ q<A.zeroPrice z)129  by_cases l : x<z130  · have := A.pricesFall complete x z X Z l; grind131  · by_cases u : z<x132    · have := A.pricesFall complete z x Z X u; grind133    · have : x=z := by grind134      subst z; grind135136theorem choicesContinuous (E : Economy R) (complete : CompleteSupport R) (comp : E.complement)137    (a m ψ : R) (e b : R → R) (ha : 0<a ∧ a<1) (hm : 0<m ∧ m<1) (big : 4*(E.X-E.L+1)<ψ)138    (choices : Choices E a m ψ e b) : ContinuousSupport e ∧ ContinuousSupport b := by139  have ec : ContinuousSupport e := by140    intro c hc ε ep141    have O := choices c hc142    have X := (contractFOC E comp a m ψ c (e c) (b c) hc ha hm big O).1143    have cap : (1/4:R)*4=1 := Field.div_mul_cancel (by grind)144    obtain ⟨h,hp,hε,hl,hu,_⟩ := smallStep ε (e c) (1/4-e c) ε ep O.1 (by have := X.2; grind) ep145    let l := e c-h146    let u := e c+h147    have L : 0<l ∧ 4*l<1 := by dsimp [l]; have := X.2; grind148    have U : 0<u ∧ 4*u<1 := by dsimp [u]; grind149    have T (x : R) (hx : 0≤x) (z : R) (hz : 0<z ∧ 4*z<1) :=150      testPrices E complete comp a m ψ x (e x) (b x) z ha hm hx big (choices x hx) hz151    have up := ((T c hc u U).1).1 (show e c<u by dsimp [u]; grind)152    have lo := ((T c hc l L).2).1 (show l<e c by dsimp [l]; grind)153    obtain ⟨priceU,iu,zu⟩ := priceLimits E comp a ψ m u c ha hm hc ⟨U.1,by grind⟩154    obtain ⟨priceL,il,zl⟩ := priceLimits E comp a ψ m l c ha hm hc ⟨L.1,by grind⟩155    obtain ⟨du,up1,Up⟩ := nearbyLess iu priceU up.1156    obtain ⟨dv,up2,Uz⟩ := nearbyLess zu priceU up.2157    have lower : ∃ δ, 0<δ ∧ ∀ x, 0≤x → c-δ<x → x<c+δ → l<e x := by158      rcases lo with li|lz159      · obtain ⟨δ,hδ,N⟩ := nearbyLess priceL il li160        exact ⟨δ,hδ,fun x hx left right => ((T x hx l L).2).2 (Or.inl (N x hx left right))⟩161      · obtain ⟨δ,hδ,N⟩ := nearbyLess priceL zl lz162        exact ⟨δ,hδ,fun x hx left right => ((T x hx l L).2).2 (Or.inr (N x hx left right))⟩163    obtain ⟨dw,up3,Lo⟩ := lower164    obtain ⟨δ,δp,d1,d2,d3,_⟩ := smallStep du dv dw du up1 up2 up3 up1165    refine ⟨δ,δp,?_⟩166    intro x hx left right167    have lt := Lo x hx (by grind) (by grind)168    have gt := ((T x hx u U).1).2 ⟨Up x hx (by grind) (by grind),Uz x hx (by grind) (by grind)⟩169    dsimp [u,l] at gt lt; grind170  refine ⟨ec,?_⟩171  let v := speed E a172  let f := fun x => 1-(a*E.P x+v x*e x)173  let B := fun x => ψ*e x/((1-m)*v x)-mass E x/f x174  have Bcont : ContinuousSupport B := by175    apply extendAt176    intro c hc177    have D := primitive E comp c hc178    have P := slopeLimit D.1179    have V : At c v := scaleAt (1-a) P180    have eC := continuousAt hc ec181    have F := affineAt (-a) (-1) 1 P (mulLimit V eC)182    have feq : (fun x => (-a)*E.P x+(-1)*(v x*e x)+1)=f := by funext x; dsimp [f]; grind183    have fC : At c f := feq ▸ F184    have O := choices c hc185    have fp : 0<f c := by186      have h := (bayesEffort E a c (e c) ha hc ⟨le_of_lt O.1,le_of_lt O.2.1⟩).1187      dsimp [v,f,speed,EffortContract.failure] at *; grind188    have vp : 0<v c := OrderedRing.mul_pos (by grind) (E.probabilities c hc).1189    exact subAt (divLimit (scaleAt ψ eC) (scaleAt (1-m) V) (OrderedRing.mul_pos (by grind) vp))190      (divLimit (slopeLimit D.2.1) fC fp)191  have same (x : R) (hx : 0≤x) : b x=B x := by192    have O := choices x hx193    have eq := O.2.2.2.2.1194    have vp : 0<(1-m)*v x := OrderedRing.mul_pos (by grind) (OrderedRing.mul_pos (by grind) (E.probabilities x hx).1)195    have pp := Field.div_mul_cancel (x:=ψ*e x) (show (1-m)*v x≠0 by grind)196    have F := bayesEffort E a x (e x) ha hx ⟨le_of_lt O.1,le_of_lt O.2.1⟩197    have fEq : f x=EffortContract.failure E a x (e x) := by dsimp [f,v,speed,EffortContract.failure]; grind198    have fp : 0<f x := fEq ▸ F.1199    have K := Field.div_mul_cancel (x:=mass E x) (show f x≠0 by grind)200    have w := F.2.2.2201    rw [← fEq] at w202    have re : mass E x/f x=reputation E a x (e x) := by203      apply le_antisymm <;> apply (Field.IsOrdered.mul_le_mul_iff_of_pos_right fp).mp <;> grind204    dsimp [B]; rw [re]; change ψ*e x=(1-m)*v x*(b x+reputation E a x (e x)) at eq205    apply le_antisymm <;> apply (Field.IsOrdered.mul_le_mul_iff_of_pos_right vp).mp <;> grind206  intro c hc ε ep207  obtain ⟨δ,dp,N⟩ := Bcont c hc ε ep208  exact ⟨δ,dp,fun x hx l r => by rw [same c hc,same x hx]; exact N x hx l r⟩209210/-- Existence of a direct-production benchmark follows from policy211continuity, zero marginal support cost at zero, and the frictionless FOC. -/212theorem benchmarkExists (E : Economy R) (complete : CompleteSupport R) (comp : E.complement)213    (a m ψ fb : R) (e b : R → R) (ha : 0<a ∧ a<1) (hm : 0<m ∧ m<1)214    (big : 4*(E.X-E.L+1)<ψ) (choices : Choices E a m ψ e b)215    (smooth : ContinuousSupport E.dG ∧ ContinuousSupport E.dB ∧ ContinuousSupport E.dC)216    (opt : Maximizes E.W fb) (C : Concave E.W) :217    ∃ s, 0<s ∧ s<fb ∧ Benchmark E a m s (e s) (b s) := by218  let Q := E.X-E.L219  let z := fun x => a+(1-a)*e x220  let U := fun x => Q-(1-m)*b x221  let D := fun x => E.dC x-z x*dp E x*U x222  have qp : 0<Q := by have := E.cash; dsimp [Q]; grind223  obtain ⟨EC,BC⟩ := choicesContinuous E complete comp a m ψ e b ha hm big choices224  have cont : ContinuousSupport D := by225    apply extendAt226    intro c hc227    have G := continuousAt hc smooth.1228    have B := continuousAt hc smooth.2.1229    have P : At c (dp E) := by230      change At c (fun x => E.β*E.dG x+(1-E.β)*E.dB x)231      simpa only [Semiring.add_zero] using affineAt E.β (1-E.β) 0 G B232    have eC := continuousAt hc EC233    have bC := continuousAt hc BC234    have zEq : (fun x => (1-a)*e x+0*e x+a)=z := by funext x; dsimp [z]; grind235    have Z : At c z := zEq ▸ affineAt (1-a) 0 a eC eC236    have UC : At c U := subAt (constantAt c Q) (scaleAt (1-m) bC)237    exact subAt (continuousAt hc smooth.2.2) (mulLimit (mulLimit Z P) UC)238  have W (x : R) (hx : 0≤x) : HasSlopeAt E.W x (Q*dp E x-E.dC x) := by239    have D := Verification.slopeSub (linearSlope Q E.L (primitive E comp x hx).1) (E.slopes x hx).2.2240    have eq : (fun x => (Q*E.P x+E.L)-E.C x)=E.W := by funext s; dsimp [Q,Economy.W]; grind241    exact eq ▸ D242  have zer : (0:R)≤0 := le_refl _243  have p0 := (primitive E comp 0 zer).2.2.1244  have w0 := OrderedRing.mul_pos qp p0245  have fbpos := (rankAtContact zer (show Contact E.W 0 (Q*dp E 0-E.dC 0) from246    ⟨E.W,W 0 zer,rfl,fun _ _ => le_refl _⟩) (quasi C) opt).1 (by have := E.costZero; grind)247  have wf := Verification.slopeAtMaximum fbpos opt (W fb opt.1)248  have bounds (x : R) (hx : 0≤x) : 0<z x ∧ z x<1 ∧ 0<U x ∧ U x≤Q := by249    have O := choices x hx250    have l := OrderedRing.mul_pos (show 0<1-a by grind) O.1251    have h := OrderedRing.mul_lt_mul_of_pos_left O.2.1 (show 0<1-a by grind)252    have u := OrderedRing.mul_nonneg (show 0≤1-m by grind) O.2.2.1253    have m' := OrderedRing.mul_nonneg (le_of_lt hm.1) O.2.2.1254    have B : b x<Q := O.2.2.2.1255    dsimp [z,U]; grind256  have b0 := bounds 0 zer257  have left : D 0<0 := by258    have := OrderedRing.mul_pos (OrderedRing.mul_pos b0.1 p0) b0.2.2.1; have := E.costZero; dsimp [D]; grind259  have bf := bounds fb opt.1260  have pp := (primitive E comp fb opt.1).2.2.1261  have right : 0<D fb := by262    have lr := OrderedRing.mul_lt_mul_of_pos_right bf.2.1 (OrderedRing.mul_pos pp bf.2.2.1)263    have ub := OrderedRing.mul_le_mul_of_nonneg_left bf.2.2.2 (le_of_lt pp)264    dsimp [D]; grind265  obtain ⟨s,sp,sf,root⟩ := intermediateValue D 0 fb 0 zer fbpos left right cont complete266  exact ⟨s,sp,sf,le_of_lt sp,by dsimp [D,z,U,Q] at root; grind⟩267268/-- Proposition 3 under the manuscript's primitive technology, convexity and269attainment hypotheses. The effort/bonus policy and benchmark are constructed.270The rankings apply to any choice of a root of the benchmark equation. -/271theorem effortVersusScapegoating (E : Economy R) (complete : CompleteSupport R) (comp : E.complement)272    (smooth : ContinuousSupport E.dG ∧ ContinuousSupport E.dB ∧ ContinuousSupport E.dC)273    (a fb : R) (ha : 0<a ∧ a<1) (viable : 1-E.β≤a*E.P 0*(E.X-E.L))274    (fbOpt : Maximizes E.W fb) (fbConc : Concave E.W)275    (maintained : ∀ m ψ (e b : R → R), 0<m ∧ m<1 → 0<ψ → Choices E a m ψ e b →276      Concave (payoff E a m e b) ∧ ∃ s, Maximizes (payoff E a m e b) s) :277    ∃ cutoff, 0<cutoff ∧ ∀ ψ, cutoff≤ψ →278      ∃ (e b : R → R → R) (star : R → R),279      (∀ m, 0<m ∧ m<1 → Choices E a m ψ (e m) (b m) ∧ Maximizes (payoff E a m (e m) (b m)) (star m)) ∧280      (∀ m, 0<m ∧ m<1 → ∃ s, 0<s ∧ s<fb ∧ Benchmark E a m s (e m s) (b m s)) ∧281      (∀ benchmark : R → R, (∀ m, 0<m ∧ m<1 → Benchmark E a m (benchmark m) (e m (benchmark m)) (b m (benchmark m))) →282        ∃ l u, 0<l ∧ l≤u ∧ u<1 ∧ (∀ m, 0<m → m<l → benchmark m<star m) ∧283          (∀ m, u<m → m<1 → star m<benchmark m)) ∧284      (∀ m n, 0<m → m<n → n<1 → star n<star m) := by285  classical286  obtain ⟨cut,cp,U⟩ := uniformChoices E complete comp a ha287  refine ⟨cut,cp,?_⟩288  intro ψ size289  obtain ⟨big,e,b,opt⟩ := U ψ size290  have hp : 0<ψ := by grind291  have sup (m : R) (hm : 0<m ∧ m<1) := maintained m ψ (e m) (b m) hm hp (opt m hm)292  let star (m : R) := if hm : 0<m ∧ m<1 then Classical.choose (sup m hm).2 else 0293  have S (m : R) (hm : 0<m ∧ m<1) : Maximizes (payoff E a m (e m) (b m)) (star m) ∧ Concave (payoff E a m (e m) (b m)) := by294    exact ⟨by simpa only [star,dite_eq_left hm] using Classical.choose_spec (sup m hm).2,(sup m hm).1⟩295  refine ⟨e,b,star,fun m hm => ⟨opt m hm,(S m hm).1⟩,?_,?_,?_⟩296  · intro m hm; exact benchmarkExists E complete comp a m ψ fb (e m) (b m) ha hm big (opt m hm) smooth fbOpt fbConc297  · intro bench D298    exact benchmarkRankings E complete comp ⟨smooth.1,smooth.2.1⟩ a ψ fb ha big fbOpt fbConc e b star bench opt D S299  · exact supportFalls E complete comp a ψ ha big viable e b star opt S300end EffortResults