Overconfident CEOs and Quiet Investment
Lean source for the November 25, 2026 manuscript.
CommonPrior.lean
Back to results1import Construction2import Distribution3noncomputable section4open Set Filter5open scoped Topology6namespace QuietInvestment78/-- The common-prior error schedule has a vertical tangent at its initial9point. In the economic quality coordinate only interior derivatives are used. -/10structure InteriorPath (p q b k t : ℝ) (e w : ℝ → ℝ) : Prop where11 marginal : e t=012 mono : StrictMonoOn e (Icc t 1)13 continuous : ContinuousOn e (Icc t 1)14 derivative : ∀ x ∈ Ioo t 1, HasDerivAt e (w x) x15 vel : ∀ x ∈ Ioo t 1, 0 < w x16 eqn : ∀ x ∈ Ioo t 1, (b*(p-q)*x+(1+4*k)*e x)*w x =17 D p q b/(2*k)*x-(p+b*(p-q))*e x1819private theorem best_interior {t x : ℝ} (ht : t ≤ 1) (hx : x ≤ 1)20 {u v : ℝ → ℝ} (cu : ContinuousOn u (Icc t 1))21 (hu : ∀ y ∈ Ioo t 1, HasDerivAt u ((x-y)*v y) y) (hv : ∀ y ∈ Ioo t 1, 0 ≤ v y) :22 ∀ y ∈ Icc t 1, u y ≤ u (max t x) := by23 let m := max t x24 have htm : t ≤ m := le_max_left _ _25 have hm1 : m ≤ 1 := max_le ht hx26 intro y hy27 rcases le_total y m with h|h28 · by_cases ht' : x ≤ t29 · rw [max_eq_left ht']; have : y=t := le_antisymm (by simpa [m,max_eq_left ht'] using h) hy.1; simp [this]30 · have hmx : m=x := max_eq_right (le_of_not_ge ht')31 have sub : Icc t m ⊆ Icc t 1 := Icc_subset_Icc_right hm132 have inside : interior (Icc t m) ⊆ Ioo t 1 := by rw [interior_Icc]; exact Ioo_subset_Ioo_right hm133 apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc t m) (cu.mono sub)34 (fun z hz => (hu z (inside hz)).hasDerivWithinAt) _ ⟨hy.1,h⟩ ⟨htm,le_rfl⟩ h35 intro z hz; exact mul_nonneg (sub_nonneg.mpr (hmx ▸ (interior_subset hz).2)) (hv _ (inside hz))36 · have sub : Icc m 1 ⊆ Icc t 1 := Icc_subset_Icc_left htm37 have inside : interior (Icc m 1) ⊆ Ioo t 1 := by rw [interior_Icc]; exact Ioo_subset_Ioo_left htm38 apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc m 1) (cu.mono sub)39 (fun z hz => (hu z (inside hz)).hasDerivWithinAt) _ ⟨le_rfl,hm1⟩ ⟨h,hy.2⟩ h40 intro z hz; exact mul_nonpos_of_nonpos_of_nonneg (sub_nonpos.mpr ((le_max_right _ _).trans (interior_subset hz).1)) (hv _ (inside hz))4142theorem forecast_interior_deriv {p q b k t : ℝ} {e w : ℝ → ℝ} (h : InteriorPath p q b k t e w)43 {x : ℝ} (hx : x ∈ Ioo t 1) :44 HasDerivAt (forecast p k e) (p+(1+2*k)*w x) x := by45 simpa [forecast] using (((hasDerivAt_id x).const_mul p).add ((h.derivative x hx).const_mul (1+2*k)))4647theorem value_interior_deriv {p q b k t : ℝ} {e w : ℝ → ℝ} (h : InteriorPath p q b k t e w)48 (hk : 0 < k) {x : ℝ} (hx : x ∈ Ioo t 1) :49 HasDerivAt (pathPrice p q b k t e) (2*k*e x*(p+(1+2*k)*w x)) x := by50 have hid := hasDerivAt_id x51 have dz := (hid.const_mul p).add ((h.derivative x hx).const_mul (2*k))52 have dv := (((hid.const_mul (p-b*(p-q))).mul dz).sub ((dz.pow 2).div_const 2)).sub_const (accurateValue p q b t)53 convert dv using 154 dsimp only [id_eq]; linear_combination -(price_derivative_identity hk (h.eqn x hx))5556theorem self_interior_deriv {p q b k t : ℝ} {e w : ℝ → ℝ} (h : InteriorPath p q b k t e w)57 (hk : 0 < k) {x : ℝ} (hx : x ∈ Ioo t 1) :58 HasDerivAt (selfGain p q b k t e) (2*k*p*e x) x := by59 have dl := (((forecast_interior_deriv h hx).sub ((hasDerivAt_id x).const_mul p)).pow 2).const_mul (lossWeight k)60 convert (value_interior_deriv h hk hx).sub dl using 161 dsimp [forecast,lossWeight]; field_simp [show 1+2*k ≠ 0 by linarith]; ring6263theorem interior_incentives {p q b k t : ℝ} {e w : ℝ → ℝ} (h : InteriorPath p q b k t e w)64 (hq : 0 < q) (hpq : q ≤ p) (hu : p < 2*q) (hb : 0 < b) (hb1 : b ≤ 1)65 (hk : 0 < k) (ht : t ∈ Ioo 0 1) : Incentives p q b k t e := by66 have hp := hq.trans_le hpq67 let F := forecast p k e68 let P := pathPrice p q b k t e69 let U := gain p q b k t e70 have ft : F t=p*t := by simp [F,forecast,h.marginal]71 have pt : P t=0 := by72 change pathPrice p q b k t e t=073 rw [← path_realizes_price hk]; change value _ _ _ _ (F t) - _ = 074 rw [ft,price_accurate hk,sub_self]75 have st : selfGain p q b k t e t=0 := by change P t-lossWeight k*(F t-p*t)^2=0; simp [pt,ft]76 have tmem : t ∈ Icc t 1 := ⟨le_rfl,ht.2.le⟩77 have sep : StrictMonoOn F (Icc t 1) := by78 intro x hx y hy hxy79 dsimp [F,forecast]80 linarith only [mul_lt_mul_of_pos_left hxy hp,mul_lt_mul_of_pos_left (h.mono hx hy hxy) (show 0 < 1+2*k by positivity)]81 have ec := h.continuous82 have fc : ContinuousOn F (Icc t 1) := by unfold F forecast; fun_prop83 have pc : ContinuousOn P (Icc t 1) := by unfold P pathPrice pathZ; fun_prop84 have sc : StrictMonoOn (selfGain p q b k t e) (Icc t 1) := by85 apply strictMonoOn_of_deriv_pos (convex_Icc _ _) (by unfold selfGain pathPrice pathZ forecast; fun_prop)86 intro x hx; rw [interior_Icc] at hx87 rw [(self_interior_deriv h hk hx).deriv]88 have hpos := h.marginal ▸ h.mono tmem (Ioo_subset_Icc_self hx) hx.189 positivity90 have pos (x : ℝ) (hx : x ∈ Ioc t 1) : 0 < U x := by91 change 0 < (if x<t then 0 else _)92 rw [if_neg (not_lt_of_ge hx.1.le),← st]93 exact sc tmem (Ioc_subset_Icc_self hx) hx.194 have nn (x : ℝ) (hx : x ∈ Icc (0:ℝ) 1) : 0 ≤ U x := by95 change 0 ≤ (if x<t then 0 else _)96 split_ifs with hlt97 · exact le_rfl98 · rw [← st]; exact sc.monotoneOn tmem ⟨le_of_not_gt hlt,hx.2⟩ (le_of_not_gt hlt)99 have onpath (x : ℝ) (hx : x ∈ Icc (0:ℝ) 1) (y : ℝ) (hy : y ∈ Icc t 1) :100 P y-lossWeight k*(F y-p*x)^2 ≤ U x := by101 have d (s : ℝ) (hs : s ∈ Ioo t 1) := imitation_derivative hk (x := x)102 ((forecast_interior_deriv h hs).hasDerivWithinAt (s := univ))103 ((value_interior_deriv h hk hs).hasDerivWithinAt (s := univ)) (rfl : forecast p k e s=p*s+(1+2*k)*e s)104 have hw : 0 < lossWeight k := div_pos hk (by linarith)105 have best := best_interior ht.2.le hx.2 (u := fun s => P s-lossWeight k*(F s-p*x)^2)106 (v := fun s => 2*lossWeight k*p*(p+(1+2*k)*w s)) (by fun_prop)107 (fun s hs => by convert hasDerivWithinAt_univ.mp (d s hs) using 1; ring)108 (fun s hs => by have := h.vel s hs; positivity) y hy109 dsimp only at best110 by_cases hs : x<t111 · rw [max_eq_left hs.le,pt,ft] at best112 change _ ≤ (if x<t then 0 else _); rw [if_pos hs]113 exact best.trans (by nlinarith [mul_nonneg hw.le (sq_nonneg (p*t-p*x))])114 · rw [max_eq_right (le_of_not_gt hs)] at best115 exact best.trans_eq (by simp [U,gain,hs,selfGain,F,P])116 refine ⟨sep,ft,nn,pos,onpath,?_⟩117 intro f hf hnot118 have fcont : ContinuousOn F (Icc t 1) := fc119 by_cases hlow : f<p*t120 · have hlt : f/p<t := (div_lt_iff₀ hp).mpr (by linarith)121 obtain ⟨hzero,hmin,hprice⟩ := d1_low hp hk (D_pos hq hpq hu hb1) hf hlow (U := U) nn122 (by simp [U,gain,hlt])123 exact ⟨f/p,⟨div_nonneg hf hp.le,hlt.le.trans ht.2.le⟩,by rw [hzero]; exact hmin,by rw [hzero]; exact hprice⟩124 · have high : F 1<f := by125 apply lt_of_not_ge; intro hh126 apply hnot127 exact intermediate_value_Icc ht.2.le fcont ⟨ft ▸ (le_of_not_gt hlow),hh⟩128 have htopp : p ≤ F 1 := by129 have := h.marginal ▸ h.mono.monotoneOn tmem (show 1 ∈ Icc t 1 from ⟨ht.2.le,le_rfl⟩) ht.2.le130 dsimp [F,forecast]; simp only [mul_one]; linarith [mul_nonneg (show 0 ≤ 1+2*k by positivity) this]131 obtain ⟨hmin,hprice⟩ := d1_high hp hk htopp high (b := b) (q := q)132 (by linarith [mul_nonneg hb.le (sub_nonneg.mpr hpq)]) (U := U) (Vtop := P 1)133 (anchor := accurateValue p q b t) (path_realizes_price hk e 1).symm134 (by simp [U,gain,selfGain,F,P,not_lt_of_ge ht.2.le])135 (fun x hx => onpath x hx 1 ⟨ht.2.le,le_rfl⟩)136 exact ⟨1,⟨zero_le_one,le_rfl⟩,fun x hx hne => hmin x hx (lt_of_le_of_ne hx.2 hne),hprice⟩137138139/-- Inverting a strictly increasing continuous time change on a compact140interval preserves continuity, including at a zero endpoint derivative. -/141private theorem inverse_continuous {f : ℝ → ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b))142 (hinj : InjOn f (Icc a b)) :143 ContinuousOn (Function.invFunOn f (Icc a b)) (f '' Icc a b) := by144 let equiv := Equiv.Set.imageOfInjOn f (Icc a b) hinj145 have c : Continuous equiv := hf.restrict.subtype_mk _146 have ci := continuous_subtype_val.comp c.continuous_symm_of_equiv_compact_to_t2147 rw [continuousOn_iff_continuous_restrict]148 apply ci.congr149 intro y; apply hinj (equiv.symm y).property (Function.invFunOn_mem y.property)150 exact (congrArg Subtype.val (equiv.apply_symm_apply y)).trans (Function.invFunOn_eq y.property).symm151152/-- Nonsingular reparametrization of (A16) at p=q. With s=x+j*e, the153equation for e(s) is regular; x'(s)>0 for s>t, and x(t)=t. -/154theorem common_error {A B V t : ℝ} (hA : 0 < A) (hB : 0 < B) (hV : 0 < V)155 (ht : t ∈ Ioo 0 1) :156 ∃ e w : ℝ → ℝ, e t=0 ∧ StrictMonoOn e (Icc t 1) ∧ ContinuousOn e (Icc t 1) ∧157 ∀ x ∈ Ioo t 1, 0 < w x ∧ HasDerivAt e (w x) x ∧ V*e x*w x=A*x-B*e x := by158 let j := min 1 (V/(2*(A+B)))159 have hj : 0 < j := lt_min zero_lt_one (div_pos hV (by positivity))160 have hj1 : j ≤ 1 := min_le_left _ _161 have hj2 : j*(2*(A+B)) ≤ V := (le_div_iff₀ (by positivity)).1 (min_le_right _ _)162 let Q := V-j*(B+A*j)163 have hQ : 0 < Q := by164 dsimp [Q]; nlinarith [mul_nonneg hj.le (mul_nonneg hA.le (sub_nonneg.mpr hj1)),165 mul_pos hj (add_pos hA hB)]166 let T := 1+(B+A*j)/B167 have hT : 1<T := lt_add_of_pos_right _ (div_pos (by positivity) hB)168 have htT : t<T := ht.2.trans hT169 let v := slope A (B+A*j) (j*A) Q170 obtain ⟨E,Et,hm,hE⟩ := schedule_on_interval hA (show 0 < B+A*j by positivity) (mul_pos hj hA) hQ ⟨ht.1,htT⟩171 let Y := fun s => s-j*E s172 let Y' := fun s => 1-j*v s (E s)173 have tm : t ∈ Icc t T := ⟨le_rfl,htT.le⟩174 have yt : Y t=t := by simp [Y,Et]175 have ce : ContinuousOn E (Icc t T) := fun s hs => (hE s hs).2.2.continuousWithinAt176 have cy : ContinuousOn Y (Icc t T) := by unfold Y; fun_prop177 have yy (s : ℝ) (hs : s ∈ Icc t T) :178 HasDerivWithinAt Y (Y' s) (Icc t T) s := by179 simpa [Y,Y',v] using (hasDerivWithinAt_id s (Icc t T)).sub ((hE s hs).2.2.const_mul j)180 have coef (s : ℝ) (hs : s ∈ Icc t T) : 0 < j*A*s+Q*E s := by181 have hs0 := ht.1.trans_le hs.1; have := (hE s hs).1; positivity182 have orig (s : ℝ) (hs : s ∈ Icc t T) :183 (j*A*s+Q*E s)*v s (E s)=A*s-(B+A*j)*E s := by184 dsimp [v,slope]; field_simp [(coef s hs).ne']185 have yPos (s : ℝ) (hs : s ∈ Ioc t T) : 0 < Y' s := by186 have ep : 0 < E s := Et ▸ hm tm (Ioc_subset_Icc_self hs) hs.1187 have eqn : (j*A*s+Q*E s)*Y' s=V*E s := by188 dsimp [Y']; have h := orig s (Ioc_subset_Icc_self hs)189 unfold Q at *; linear_combination -j*h190 exact (mul_pos_iff_of_pos_left (coef s (Ioc_subset_Icc_self hs))).mp (eqn ▸ mul_pos hV ep)191 have ym : StrictMonoOn Y (Icc t T) := strictMonoOn_of_deriv_pos (convex_Icc _ _) cy (by192 intro s hs; rw [interior_Icc] at hs193 rw [((yy s (Ioo_subset_Icc_self hs)).hasDerivAt (Icc_mem_nhds hs.1 hs.2)).deriv]194 exact yPos s (Ioo_subset_Ioc_self hs))195 have yT : 1 < Y T := by196 have hmem : T ∈ Icc t T := ⟨htT.le,le_rfl⟩197 have hv := (hE T hmem).2.1198 change 0 < (A*T-(B+A*j)*E T)/(j*A*T+Q*E T) at hv199 have hh := (div_pos_iff_of_pos_right (coef T hmem)).mp hv200 have heq : T*B=B+(B+A*j) := by dsimp [T]; field_simp201 dsimp [Y]202 apply lt_of_not_ge; intro hn203 nlinarith only [mul_pos hj hh,mul_nonneg (show 0 ≤ B+A*j by positivity) (sub_nonneg.mpr hn),heq,hB]204 let I := Function.invFunOn Y (Icc t T)205 have sub : Icc t 1 ⊆ Y '' Icc t T := by206 intro x hx; apply intermediate_value_Icc htT.le cy207 exact ⟨yt.trans_le hx.1,hx.2.trans yT.le⟩208 have cI : ContinuousOn I (Icc t 1) := (inverse_continuous cy ym.injOn).mono sub209 have inside (x : ℝ) (hx : x ∈ Icc t 1) : I x ∈ Icc t T := Function.invFunOn_mem (sub hx)210 have inv (x : ℝ) (hx : x ∈ Icc t 1) : Y (I x)=x := Function.invFunOn_eq (sub hx)211 have mi : StrictMonoOn I (Icc t 1) := by212 intro x hx y hy hxy; apply lt_of_not_ge; intro h213 have := ym.monotoneOn (inside y hy) (inside x hx) h214 linarith [inv x hx,inv y hy]215 have it : I t=t := by simpa only [yt] using ym.injOn.leftInvOn_invFunOn tm216 refine ⟨fun x => E (I x),fun x => v (I x) (E (I x))*(Y' (I x))⁻¹,217 by dsimp only; rw [it,Et], (hm.comp mi inside),ce.comp cI inside,?_⟩218 intro x hx219 have hx' := Ioo_subset_Icc_self hx220 have hlo : t<I x := it ▸ mi (show t ∈ Icc t 1 from ⟨le_rfl,ht.2.le⟩) hx' hx.1221 have hhi : I x<T := lt_of_le_of_ne (inside x hx').2 (by intro he; have := inv x hx'; rw [he] at this; linarith [hx.2])222 have hs : I x ∈ Icc t T := inside x hx'223 have hi := yPos (I x) ⟨hlo,hhi.le⟩224 have derivI : HasDerivAt I (Y' (I x))⁻¹ x := HasDerivAt.of_local_left_inverse225 ((cI x hx').continuousAt (Icc_mem_nhds hx.1 hx.2))226 ((yy _ hs).hasDerivAt (Icc_mem_nhds hlo hhi)) hi.ne'227 (by filter_upwards [Icc_mem_nhds hx.1 hx.2] with y hy using inv y hy)228 refine ⟨mul_pos (hE _ hs).2.1 (inv_pos.mpr hi),229 ((hE _ hs).2.2.hasDerivAt (Icc_mem_nhds hlo hhi)).comp x derivI,?_⟩230 have hh := orig _ hs231 have hxY := inv _ hx'232 change I x-j*E (I x)=x at hxY233 change V*E (I x)*(v (I x) (E (I x))*(Y' (I x))⁻¹)=A*x-B*E (I x)234 have eqright : A*x-B*E (I x) = A*(I x-j*E (I x))-B*E (I x) := by linarith only [congrArg (fun z : ℝ => A*z) hxY]235 rw [eqright]; field_simp [hi.ne']; dsimp [Y']; unfold Q at hh; linear_combination hh236237theorem lemma3_equilibrium {p b k t : ℝ} (hp : 0 < p) (hb : 0 < b) (hb1 : b ≤ 1)238 (hk : 0 < k) (ht : t ∈ Ioo 0 1) :239 ∃ e w, InteriorPath p p b k t e w ∧ Incentives p p b k t e := by240 obtain ⟨e,w,hm,mono,cont,he⟩ := common_error (A := p^2/(2*k)) (B := p) (V := 1+4*k)241 (by positivity) hp (by positivity) ht242 have path : InteriorPath p p b k t e w := by243 refine ⟨hm,mono,cont,fun x hx => (he x hx).2.1,fun x hx => (he x hx).1,?_⟩244 intro x hx; simpa [D,pow_two] using (he x hx).2.2245 exact ⟨e,w,path,interior_incentives path hp le_rfl (by linarith) hb hb1 hk ht⟩246247end QuietInvestment
Comparisons.lean
Back to results1import Construction2import Distribution3import Earnings4noncomputable section5open Set Filter MeasureTheory6open scoped Topology Interval7namespace QuietInvestment89private theorem relative_derivative {a K p q b k t : ℝ} {e w : ℝ → ℝ}10 (hs : Path p q b k t e w) (ht : 0 < t) (hcut : D p q b*t^2=C a K)11 (hk : 0 < k) (hb : 0 < b) (hpq : q < p) {L : ℝ} (hL : t*L ≤ 1) :12 ∀ y ∈ Icc 1 L, HasDerivWithinAt (fun s => e (t*s))13 (relSlope ((a+2)*K/k) ((p+b*(p-q))*t) (b*(p-q)*t) (1+4*k) y (e (t*y))) (Icc 1 L) y := by14 have map : MapsTo (fun s => t*s) (Icc 1 L) (Icc t 1) := by15 intro s hz; exact ⟨by simpa using mul_le_mul_of_nonneg_left hz.1 ht.le,16 (mul_le_mul_of_nonneg_left hz.2 ht.le).trans hL⟩17 intro y hy18 have h := (hs.derivative _ (map hy)).comp y ((hasDerivWithinAt_id y (Icc 1 L)).const_mul t) map19 have hden : b*(p-q)*t*y+(1+4*k)*e (t*y) ≠ 0 := by20 have he := (hs.positive _ (map hy)).121 have hy0 := zero_lt_one.trans_le hy.122 have hdiff := sub_pos.mpr hpq23 positivity24 convert h using 125 · dsimp only; rw [← rescale_slope hk.ne' hcut (hs.eqn _ (map hy)) hden]; ring2627/-- The fundamental finite-pair comparison, avoiding differentiation along28the p interval. -/29theorem cutoff_rises {p r q b c t u : ℝ}30 (hq : 0 < q) (hpq : q < p) (hpr : p < r) (hb : 0 < b) (hreg : N p q b < 0)31 (hc : 0 < c) (ht : 0 < t) (hu : 0 < u) (h1 : D p q b*t^2=c) (h2 : D r q b*u^2=c) : t < u := by32 have hb' : 1 < 2*b := by33 by_contra! h; unfold N at hreg34 nlinarith [mul_nonneg (sub_nonneg.mpr h) (hq.trans hpq).le,mul_pos hb hq]35 have hh := mul_neg_of_pos_of_neg (sub_pos.mpr hpr)36 (show 2*N p q b+(1-2*b)*(r-p) < 0 by37 linarith [mul_nonpos_of_nonpos_of_nonneg (sub_nonpos.mpr hb'.le) (sub_nonneg.mpr hpr.le)])38 have hD : D r q b < D p q b := by unfold D N at *; nlinarith only [hh]39 have hr : 0 < D r q b := (mul_pos_iff_of_pos_right (sq_pos_of_pos hu)).mp (h2 ▸ hc)40 by_contra! he41 have hsq : u^2 ≤ t^2 := by nlinarith [mul_nonneg (sub_nonneg.mpr he) (add_pos ht hu).le]42 linarith [mul_le_mul_of_nonneg_left hsq hr.le,mul_lt_mul_of_pos_right hD (sq_pos_of_pos ht)]4344/-- Average over actual issuing types, including the density normalization. -/45def issuerMean (a t : ℝ) (e : ℝ → ℝ) :=46 (∫ x in t..1, e x*(a*x^(a-1)))/(∫ x in t..1,a*x^(a-1))4748theorem mean_rescale {a t : ℝ} (ha : 0 < a) (ht : t ∈ Ioo 0 1) (e : ℝ → ℝ) :49 issuerMean a t e = weightedMean (fun y => y^(a-1)) (fun y => e (t*y)) (1/t) := by50 have ht0 := ht.151 have hT : 1 ≤ 1/t := (one_le_div ht0).mpr ht.2.le52 have sub (f : ℝ → ℝ) :53 (∫ x in t..1, f x*(a*x^(a-1))) =54 t*(a*t^(a-1))*(∫ y in (1:ℝ)..1/t, f (t*y)*y^(a-1)) := by55 have h := intervalIntegral.smul_integral_comp_mul_left (a := (1:ℝ)) (b := 1/t)56 (fun x => f x*(a*x^(a-1))) t57 simp only [mul_one,one_div,mul_inv_cancel₀ ht0.ne',smul_eq_mul] at h58 rw [← h, mul_assoc]59 congr 160 rw [← intervalIntegral.integral_const_mul, ← one_div]61 apply intervalIntegral.integral_congr62 intro y hy63 have hy' : y ∈ Icc 1 (1/t) := by rwa [uIcc_of_le hT] at hy64 dsimp only65 rw [Real.mul_rpow ht0.le (zero_le_one.trans hy'.1)]; ring66 unfold issuerMean weightedMean67 rw [sub e]68 have h := sub (fun _ => (1:ℝ)); simp only [one_mul] at h; rw [h]69 have hh : t*(a*t^(a-1)) ≠ 0 := by positivity70 rw [mul_div_mul_left _ _ hh]7172/-- Proposition 2 as a comparison of normalized integrals of the actual73forecast errors, on different intervals of issuing types. -/74theorem proposition2 {a K p r q b k t u : ℝ} {e E w W : ℝ → ℝ}75 (ha : 0 < a) (hK : 0 < K) (hq : 0 < q) (hpq : q < p) (hpr : p < r)76 (hb : 0 < b) (hk : 0 < k) (hreg : N p q b < 0) (ht : t ∈ Ioo 0 1) (hu : u ∈ Ioo 0 1)77 (hcut : D p q b*t^2=C a K) (hcut' : D r q b*u^2=C a K)78 (hs : Path p q b k t e w) (hS : Path r q b k u E W) :79 issuerMean a u E < issuerMean a t e := by80 have hc : 0 < C a K := by unfold C; positivity81 have htu := cutoff_rises hq hpq hpr hb hreg hc ht.1 hu.1 hcut hcut'82 have L₂ : 1 < 1/u := (one_lt_div hu.1).2 hu.283 have L₁ := div_lt_div_of_pos_left (show (0:ℝ)<1 by norm_num) ht.1 htu84 have mult (s : ℝ) (h : 0 < s) : s*(1/s)=1 := by field_simp85 have m₀ := relative_derivative hs ht.1 hcut hk hb hpq (mult t ht.1).le86 have m₂ := relative_derivative hS hu.1 hcut' hk hb (hpq.trans hpr) (mult u hu.1).le87 have sub : Icc 1 (1/u) ⊆ Icc 1 (1/t) := Icc_subset_Icc_right L₁.le88 have mapT {y : ℝ} (hy : y ∈ Icc 1 (1/t)) : t*y ∈ Icc t 1 :=89 ⟨by simpa using mul_le_mul_of_nonneg_left hy.1 ht.1.le,90 (mul_le_mul_of_nonneg_left hy.2 ht.1.le).trans (mult t ht.1).le⟩91 have mapU {y : ℝ} (hy : y ∈ Icc 1 (1/u)) : u*y ∈ Icc u 1 :=92 ⟨by simpa using mul_le_mul_of_nonneg_left hy.1 hu.1.le,93 (mul_le_mul_of_nonneg_left hy.2 hu.1.le).trans (mult u hu.1).le⟩94 have hdiff := sub_pos.mpr hpq95 have hbase := hq.trans hpq96 have pos := mul_pos hb hdiff97 have hU := mul_lt_mul_of_pos_left (sub_lt_sub_right hpr q) hb98 have hB : (p+b*(p-q))*t ≤ (r+b*(r-q))*u := by99 exact mul_le_mul (by linarith) htu.le ht.1.le (by have := hpq.trans hpr; nlinarith [mul_pos hb (sub_pos.mpr this)])100 have hu' := mul_lt_mul_of_pos_left htu pos101 have hU' : b*(p-q)*t < b*(r-q)*u := hu'.trans (mul_lt_mul_of_pos_right hU hu.1)102 have low := relative_schedule_le (H := (a+2)*K/k) (V := 1+4*k)103 hB (mul_pos pos ht.1) hU' (by positivity)104 (e₁ := fun y => e (t*y)) (e₂ := fun y => E (u*y))105 (by simp [hs.marginal,hS.marginal]) (fun y hy => (m₀ y (sub hy)).mono sub) m₂106 (fun y hy => (hs.positive _ (mapT (sub hy))).1) (by107 intro y hy108 have hy' := Ico_subset_Icc_self hy109 have hyy := mapU hy'110 have hvel := (hS.positive _ hyy).2111 have hy0 := zero_lt_one.trans_le hy.1112 have hrq := sub_pos.mpr (hpq.trans hpr)113 have he := (hS.positive _ hyy).1114 have hu0 := hu.1115 have hd : b*(r-q)*u*y+(1+4*k)*E (u*y) ≠ 0 := by positivity116 rw [← rescale_slope hk.ne' hcut' (hS.eqn _ hyy) hd]117 exact mul_pos hu.1 hvel)118 rw [mean_rescale ha hu,mean_rescale ha ht]119 exact selection_mean_lt L₂ L₁ power_weight.1 power_weight.2120 (fun y hy => (m₀ y hy).continuousWithinAt) (fun y hy => (m₂ y hy).continuousWithinAt)121 (fun x hx y hy hxy => hs.mono (mapT hx) (mapT hy) (mul_lt_mul_of_pos_left hxy ht.1)) low122123private theorem piecewise_cont {p q b k t : ℝ} {e w : ℝ → ℝ} (h : Path p q b k t e w) (ht : t ∈ Ioo 0 1) :124 ContinuousOn (Investment.actual p t (pathZ p k e)) (Icc 0 1) := by125 rw [← Icc_union_Icc_eq_Icc ht.1.le ht.2.le]126 apply ContinuousOn.union_isClosed isClosed_Icc isClosed_Icc127 · apply (show ContinuousOn (fun x : ℝ => p*x) (Icc 0 t) by fun_prop).congr128 intro x hx129 rcases eq_or_lt_of_le hx.2 with he|hl130 · simp [he,Investment.actual,pathZ,h.marginal]131 · simp [Investment.actual,hl]132 · have he : ContinuousOn e (Icc t 1) := fun x hx => (h.derivative x hx).continuousWithinAt133 apply (show ContinuousOn (pathZ p k e) (Icc t 1) by unfold pathZ; fun_prop).congr134 intro x hx; simp [Investment.actual,not_lt_of_ge hx.1,pathZ]135136/-- Proposition 3, including expectation under the power density. -/137theorem proposition3_mean {a c p r q b k t u : ℝ} {e E w W : ℝ → ℝ}138 (ha : 0 < a) (hq : 0 < q) (hpq : q < p) (hpr : p < r) (hb : 0 < b) (hb1 : b < 1)139 (hk : 0 < k) (hc : 0 < c) (hreg : N p q b < 0) (ht : t ∈ Ioo 0 1) (hu : u ∈ Ioo 0 1)140 (hcut : D p q b*t^2=c) (hcut' : D r q b*u^2=c)141 (hs : Path p q b k t e w) (hS : Path r q b k u E W) :142 let z := Investment.actual p t (pathZ p k e)143 let Z := Investment.actual r u (pathZ r k E)144 (∀ x ∈ Ioc (0:ℝ) 1, z x < Z x) ∧145 (∫ x in (0:ℝ)..1, z x*(a*x^(a-1))) < ∫ x in (0:ℝ)..1, Z x*(a*x^(a-1)) := by146 intro z Z147 have hpoint := Investment.proposition3 hq hpq hpr hb hb1 hk hc ht hu hreg hcut hcut'148 (Investment.active_of_schedule hk hs.marginal hs.derivative (fun x hx => ⟨(hs.positive x hx).1,(hs.positive x hx).2.le⟩) hs.eqn)149 (Investment.active_of_schedule hk hS.marginal hS.derivative (fun x hx => ⟨(hS.positive x hx).1,(hS.positive x hx).2.le⟩) hS.eqn)150 refine ⟨hpoint,?_⟩151 have integr := (intervalIntegral.intervalIntegrable_rpow' (a := 0) (b := 1) (show -1 < a-1 by linarith)).const_mul a152 have iz := integr.continuousOn_mul (by simpa [uIcc_of_le zero_le_one] using piecewise_cont hs ht)153 have iZ := integr.continuousOn_mul (by simpa [uIcc_of_le zero_le_one] using piecewise_cont hS hu)154 rw [← sub_pos,← intervalIntegral.integral_sub iZ iz]155 apply intervalIntegral.intervalIntegral_pos_of_pos_on (iZ.sub iz) _ zero_lt_one156 intro x hx157 exact sub_pos.mpr (mul_lt_mul_of_pos_right (hpoint x (Ioo_subset_Ioc_self hx)) (mul_pos ha (Real.rpow_pos_of_pos hx.1 _)))158end QuietInvestment
Construction.lean
Back to results1import Equilibrium2import Investment3noncomputable section4open Set Filter MeasureTheory5open scoped Topology Interval6namespace QuietInvestment7/-- One equilibrium schedule in equation (A16), in original quality units. -/8structure Path (p q b k t : ℝ) (e w : ℝ → ℝ) : Prop where9 marginal : e t = 010 mono : StrictMonoOn e (Icc t 1)11 positive : ∀ x ∈ Icc t 1, 0 ≤ e x ∧ 0 < w x12 derivative : ∀ x ∈ Icc t 1, HasDerivWithinAt e (w x) (Icc t 1) x13 eqn : ∀ x ∈ Icc t 1, (b*(p-q)*x+(1+4*k)*e x)*w x =14 D p q b/(2*k)*x-(p+b*(p-q))*e x1516theorem path_exists {p q b k t : ℝ} (hq : 0 < q) (hpq : q < p) (hu : p < 2*q)17 (hb : 0 < b) (hb1 : b ≤ 1) (hk : 0 < k) (ht : t ∈ Ioo 0 1) :18 ∃ e w, Path p q b k t e w := by19 have hp := hq.trans hpq20 have hdiff := sub_pos.mpr hpq21 have hd := D_pos hq hpq.le hu hb122 let wfield := slope (D p q b/(2*k)) (p+b*(p-q)) (b*(p-q)) (1+4*k)23 obtain ⟨e,he,hm,hs⟩ := schedule_exists (div_pos hd (by positivity : 0 < 2*k))24 (show 0 < p+b*(p-q) by positivity) (mul_pos hb hdiff) (show 0 < 1+4*k by positivity) ht25 refine ⟨e,fun x => wfield x (e x),he,hm,fun x hx => ⟨(hs x hx).1,(hs x hx).2.1⟩,26 fun x hx => (hs x hx).2.2,?_⟩27 intro x hx; dsimp [wfield,slope]28 have hx0 := ht.1.trans_le hx.129 have he0 := (hs x hx).130 have hz : b*(p-q)*x+(1+4*k)*e x ≠ 0 := by positivity31 field_simp; ring3233def pathZ (p k : ℝ) (e : ℝ → ℝ) (x : ℝ) := p*x+2*k*e x34def pathPrice (p q b k t : ℝ) (e : ℝ → ℝ) (x : ℝ) :=35 (p-b*(p-q))*x*pathZ p k e x-(pathZ p k e x)^2/2-accurateValue p q b t36def selfGain (p q b k t : ℝ) (e : ℝ → ℝ) (x : ℝ) :=37 pathPrice p q b k t e x-lossWeight k*(forecast p k e x-p*x)^238def gain (p q b k t : ℝ) (e : ℝ → ℝ) (x : ℝ) :=39 if x < t then 0 else selfGain p q b k t e x4041theorem path_realizes_price {p q b k t : ℝ} (hk : 0 < k) (e : ℝ → ℝ) (x : ℝ) :42 value (p-b*(p-q)) p k x (forecast p k e x) - accurateValue p q b t =43 pathPrice p q b k t e x := by44 unfold value investment forecast pathPrice pathZ45 field_simp [show 1+2*k ≠ 0 by linarith]; ring4647theorem forecast_deriv {p q b k t : ℝ} {e w : ℝ → ℝ} (h : Path p q b k t e w)48 {x : ℝ} (hx : x ∈ Icc t 1) :49 HasDerivWithinAt (forecast p k e) (p+(1+2*k)*w x) (Icc t 1) x := by50 simpa [forecast] using (((hasDerivWithinAt_id x (Icc t 1)).const_mul p).add ((h.derivative x hx).const_mul (1+2*k)))5152theorem value_deriv {p q b k t : ℝ} {e w : ℝ → ℝ} (h : Path p q b k t e w)53 (hk : 0 < k) {x : ℝ} (hx : x ∈ Icc t 1) :54 HasDerivWithinAt (pathPrice p q b k t e) (2*k*e x*(p+(1+2*k)*w x)) (Icc t 1) x := by55 have hid := hasDerivWithinAt_id x (Icc t 1)56 have dz := (hid.const_mul p).add ((h.derivative x hx).const_mul (2*k))57 have dv := (((hid.const_mul (p-b*(p-q))).mul dz).sub ((dz.pow 2).div_const 2)).sub_const (accurateValue p q b t)58 convert dv using 159 dsimp only [id_eq]; linear_combination -(price_derivative_identity hk (h.eqn x hx))6061theorem self_deriv {p q b k t : ℝ} {e w : ℝ → ℝ} (h : Path p q b k t e w)62 (hk : 0 < k) {x : ℝ} (hx : x ∈ Icc t 1) :63 HasDerivWithinAt (selfGain p q b k t e) (2*k*p*e x) (Icc t 1) x := by64 have dl := (((forecast_deriv h hx).sub ((hasDerivWithinAt_id x (Icc t 1)).const_mul p)).pow 2).const_mul (lossWeight k)65 convert (value_deriv h hk hx).sub dl using 166 dsimp [forecast,lossWeight]; field_simp [show 1+2*k ≠ 0 by linarith]; ring6768/-- Sequential choices and beliefs for the constructed schedule. The D169condition uses the indifference-price comparison in (A6). The gross firm value70is measured relative to that of the marginal issuer; it equals the CEO's net71price gain because the marginal type is indifferent. -/72structure Incentives (p q b k t : ℝ) (e : ℝ → ℝ) : Prop where73 separation : StrictMonoOn (forecast p k e) (Icc t 1)74 marginal : forecast p k e t=p*t75 participation : ∀ x ∈ Icc (0:ℝ) 1, 0 ≤ gain p q b k t e x76 strictParticipation : ∀ x ∈ Ioc t 1, 0 < gain p q b k t e x77 onPath : ∀ x ∈ Icc (0:ℝ) 1, ∀ y ∈ Icc t 1,78 pathPrice p q b k t e y-lossWeight k*(forecast p k e y-p*x)^2 ≤ gain p q b k t e x79 offPath : ∀ f : ℝ, 0 ≤ f → f ∉ forecast p k e '' Icc t 1 →80 ∃ y ∈ Icc (0:ℝ) 1, (∀ x ∈ Icc (0:ℝ) 1, x ≠ y →81 required (lossWeight k) p (gain p q b k t e) y f < required (lossWeight k) p (gain p q b k t e) x f) ∧82 value (p-b*(p-q)) p k y f-accurateValue p q b t < required (lossWeight k) p (gain p q b k t e) y f8384theorem path_incentives {p q b k t : ℝ} {e w : ℝ → ℝ} (h : Path p q b k t e w)85 (hq : 0 < q) (hpq : q < p) (hu : p < 2*q) (hb : 0 < b) (hb1 : b ≤ 1)86 (hk : 0 < k) (ht : t ∈ Ioo 0 1) : Incentives p q b k t e := by87 have hp := hq.trans hpq88 let F := forecast p k e89 let P := pathPrice p q b k t e90 let U := gain p q b k t e91 have ft : F t=p*t := by simp [F,forecast,h.marginal]92 have pt : P t=0 := by93 change pathPrice p q b k t e t=094 rw [← path_realizes_price hk]; change value _ _ _ _ (F t) - _ = 095 rw [ft,price_accurate hk,sub_self]96 have st : selfGain p q b k t e t=0 := by change P t-lossWeight k*(F t-p*t)^2=0; simp [pt,ft]97 have tmem : t ∈ Icc t 1 := ⟨le_rfl,ht.2.le⟩98 have sep : StrictMonoOn F (Icc t 1) := by99 intro x hx y hy hxy100 dsimp [F,forecast]101 linarith only [mul_lt_mul_of_pos_left hxy hp,mul_lt_mul_of_pos_left (h.mono hx hy hxy) (show 0 < 1+2*k by positivity)]102 have sc : StrictMonoOn (selfGain p q b k t e) (Icc t 1) := by103 apply strictMonoOn_of_deriv_pos (convex_Icc _ _) (fun x hx => (self_deriv h hk hx).continuousWithinAt)104 intro x hx; rw [interior_Icc] at hx105 rw [((self_deriv h hk (Ioo_subset_Icc_self hx)).hasDerivAt (Icc_mem_nhds hx.1 hx.2)).deriv]106 have hpos := h.marginal ▸ h.mono tmem (Ioo_subset_Icc_self hx) hx.1107 positivity108 have pos (x : ℝ) (hx : x ∈ Ioc t 1) : 0 < U x := by109 change 0 < (if x<t then 0 else _)110 rw [if_neg (not_lt_of_ge hx.1.le),← st]111 exact sc tmem (Ioc_subset_Icc_self hx) hx.1112 have nn (x : ℝ) (hx : x ∈ Icc (0:ℝ) 1) : 0 ≤ U x := by113 change 0 ≤ (if x<t then 0 else _)114 split_ifs with hlt115 · exact le_rfl116 · rw [← st]; exact sc.monotoneOn tmem ⟨le_of_not_gt hlt,hx.2⟩ (le_of_not_gt hlt)117 have onpath (x : ℝ) (hx : x ∈ Icc (0:ℝ) 1) (y : ℝ) (hy : y ∈ Icc t 1) :118 P y-lossWeight k*(F y-p*x)^2 ≤ U x := by119 have d (s : ℝ) (hs : s ∈ Icc t 1) := imitation_derivative hk (x := x)120 (forecast_deriv h hs) (value_deriv h hk hs) (rfl : forecast p k e s=p*s+(1+2*k)*e s)121 have hw : 0 < lossWeight k := div_pos hk (by linarith)122 have best := best_imitation ht.2.le hx.2 (u := fun s => P s-lossWeight k*(F s-p*x)^2)123 (v := fun s => 2*lossWeight k*p*(p+(1+2*k)*w s))124 (fun s hs => by convert d s hs using 1; ring)125 (fun s hs => by have := (h.positive s hs).2; positivity) y hy126 dsimp only at best127 by_cases hs : x<t128 · rw [max_eq_left hs.le,pt,ft] at best129 change _ ≤ (if x<t then 0 else _); rw [if_pos hs]130 exact best.trans (by nlinarith [mul_nonneg hw.le (sq_nonneg (p*t-p*x))])131 · rw [max_eq_right (le_of_not_gt hs)] at best132 exact best.trans_eq (by simp [U,gain,hs,selfGain,F,P])133 refine ⟨sep,ft,nn,pos,onpath,?_⟩134 intro f hf hnot135 have fcont : ContinuousOn F (Icc t 1) := fun x hx => (forecast_deriv h hx).continuousWithinAt136 by_cases hlow : f<p*t137 · have hlt : f/p<t := (div_lt_iff₀ hp).mpr (by linarith)138 obtain ⟨hzero,hmin,hprice⟩ := d1_low hp hk (D_pos hq hpq.le hu hb1) hf hlow (U := U) nn139 (by simp [U,gain,hlt])140 exact ⟨f/p,⟨div_nonneg hf hp.le,hlt.le.trans ht.2.le⟩,by rw [hzero]; exact hmin,by rw [hzero]; exact hprice⟩141 · have high : F 1<f := by142 apply lt_of_not_ge; intro hh143 apply hnot144 exact intermediate_value_Icc ht.2.le fcont ⟨ft ▸ (le_of_not_gt hlow),hh⟩145 have htopp : p ≤ F 1 := by146 have := (h.positive 1 ⟨ht.2.le,le_rfl⟩).1147 dsimp [F,forecast]; simp only [mul_one]; linarith [mul_nonneg (show 0 ≤ 1+2*k by positivity) this]148 obtain ⟨hmin,hprice⟩ := d1_high hp hk htopp high (b := b) (q := q)149 (by linarith [mul_nonneg hb.le (sub_nonneg.mpr hpq.le)]) (U := U) (Vtop := P 1)150 (anchor := accurateValue p q b t) (path_realizes_price hk e 1).symm151 (by simp [U,gain,selfGain,F,P,not_lt_of_ge ht.2.le])152 (fun x hx => onpath x hx 1 ⟨ht.2.le,le_rfl⟩)153 exact ⟨1,⟨zero_le_one,le_rfl⟩,fun x hx hne => hmin x hx (lt_of_le_of_ne hx.2 hne),hprice⟩154155/-- Lemma 2: unique scalar cutoff, increasing schedule on the full issuing156interval, on-path optimality and D1 off-path pricing. -/157theorem lemma2 {a K p q b k : ℝ} (ha : 0 < a) (hK : 0 < K) (hcost : K < D p q b/(2*(a+2)))158 (hq : 0 < q) (hpq : q < p) (hu : p < 2*q) (hb : 0 < b) (hb1 : b < 1) (hk : 0 < k) :159 let t := cutoff (C a K) (D p q b)160 t ∈ Ioo 0 1 ∧ (∀ u : ℝ, 0 ≤ u → (D p q b*u^2=C a K ↔ u=t)) ∧161 ∃ e w, Path p q b k t e w ∧ Incentives p q b k t e := by162 have hc : 0 < C a K := by unfold C; positivity163 have hd : C a K < D p q b := by164 unfold C; linarith [(lt_div_iff₀ (show 0 < 2*(a+2) by positivity)).mp hcost]165 obtain ⟨ht,huniq⟩ := cutoff_unique hc hd166 obtain ⟨e,w,he⟩ := path_exists hq hpq hu hb hb1.le hk ht167 exact ⟨ht,huniq,e,w,he,path_incentives he hq hpq hu hb hb1.le hk ht⟩168169end QuietInvestment
Distribution.lean
Back to results1import QuietInvestment2import Mathlib.Analysis.Calculus.Deriv.Inverse3import Mathlib.Analysis.Convex.Deriv4import Mathlib.Analysis.SpecialFunctions.Log.Deriv5import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts6import Mathlib.Tactic.Positivity7import Mathlib.Tactic.FieldSimp8import Mathlib.Tactic.Linarith9import Mathlib.Tactic.Ring1011noncomputable section12open Set Filter MeasureTheory13open scoped Interval Topology14namespace QuietInvestment.Distribution1516def gap (G : ℝ → ℝ) (t : ℝ) := 2*(∫ x in (0:ℝ)..t, x*G x)/G t1718/-- (B3) from the CDF and its density. The density can diverge at zero. -/19theorem gap_moment {G g : ℝ → ℝ} (cG : Continuous G) {t : ℝ} (ht : 0 < t)20 (hG : 0 < G t) (hg : IntervalIntegrable g volume 0 t)21 (dG : ∀ x ∈ Ioo 0 t, HasDerivAt G (g x) x) :22 t^2 - (∫ x in (0:ℝ)..t, x^2*g x)/G t = gap G t := by23 have he := intervalIntegral.integral_mul_deriv_eq_deriv_mul_of_hasDeriv_right24 (u := fun x : ℝ => x^2) (u' := fun x => 2*x) (by fun_prop) cG.continuousOn25 (by intro x _; simpa using ((hasDerivAt_id x).pow 2).hasDerivWithinAt)26 (fun x hx => (dG x (by simpa [min_eq_left ht.le,max_eq_right ht.le] using hx)).hasDerivWithinAt)27 (Continuous.intervalIntegrable (by fun_prop) _ _) hg28 simp only [zero_pow (by decide : 2 ≠ 0), zero_mul,sub_zero] at he29 rw [he]; unfold gap30 have eqi : (∫ x in (0:ℝ)..t, 2*x*G x) = 2*(∫ x in (0:ℝ)..t, x*G x) := by31 rw [← intervalIntegral.integral_const_mul]; congr 1; ext; ring32 rw [eqi]; field_simp3334/-- (B4). Positivity of the derivative is derived from concavity of log G.35G is a continuous CDF; its density g integrates up to the interior cutoff. -/36theorem gap_deriv_pos {G g : ℝ → ℝ} (cG : Continuous G)37 (hG : ∀ x ∈ Ioo (0:ℝ) 1, 0 < G x)38 (dG : ∀ x ∈ Ioo (0:ℝ) 1, HasDerivAt G (g x) x)39 (hlc : ConcaveOn ℝ (Ioo (0:ℝ) 1) (fun x => Real.log (G x)))40 {t : ℝ} (ht : t ∈ Ioo 0 1) (hg : IntervalIntegrable g volume 0 t) :41 0 < deriv (gap G) t := by42 have htG := hG t ht43 have dlog (x : ℝ) (hx : x ∈ Ioo (0:ℝ) 1) := (dG x hx).log (hG x hx).ne'44 have anti := hlc.antitoneOn_deriv (fun x hx => (dlog x hx).differentiableAt)45 have cF : Continuous (fun x : ℝ => x*G x) := continuous_id.mul cG46 have dh := (((cF.integral_hasStrictDerivAt 0 t).hasDerivAt.const_mul 2).div (dG t ht) htG.ne').deriv47 change 0 < deriv (fun s => 2*(∫ x in (0:ℝ)..s, x*G x)/G s) t48 rw [dh]49 have Gpos : 0 < ∫ x in (0:ℝ)..t,G x := by50 apply intervalIntegral.integral_pos ht.1 cG.continuousOn51 · intro x hx; exact (hG x ⟨hx.1,hx.2.trans_lt ht.2⟩).le52 · exact ⟨t,⟨ht.1.le,le_rfl⟩,htG⟩53 have ibp := intervalIntegral.integral_mul_deriv_eq_deriv_mul_of_hasDeriv_right54 (u := fun x : ℝ => x) (u' := fun _ => (1:ℝ)) continuous_id.continuousOn cG.continuousOn55 (fun x _ => (hasDerivAt_id x).hasDerivWithinAt)56 (fun x hx => (dG x ⟨by simpa [min_eq_left ht.1.le] using hx.1,57 lt_trans (by simpa [max_eq_right ht.1.le] using hx.2) ht.2⟩).hasDerivWithinAt)58 (intervalIntegrable_const) hg59 simp only [zero_mul,sub_zero,one_mul] at ibp60 have fi : IntervalIntegrable (fun x => g t/G t*(x*G x)) volume 0 t :=61 (continuous_const.mul cF).intervalIntegrable _ _62 have gi : IntervalIntegrable (fun x => x*g x) volume 0 t := hg.continuousOn_mul continuous_id.continuousOn63 have bound := intervalIntegral.integral_mono_on_of_le_Ioo ht.1.le fi gi (by64 intro x hx65 have hx' : x ∈ Ioo (0:ℝ) 1 := ⟨hx.1,hx.2.trans ht.2⟩66 have hh := anti hx' ht hx.2.le67 rw [(dlog x hx').deriv,(dlog t ht).deriv] at hh68 have hz := (le_div_iff₀ (hG x hx')).mp hh69 calc70 g t/G t*(x*G x) = x*(g t/G t*G x) := by ring71 _ ≤ x*g x := mul_le_mul_of_nonneg_left hz hx.1.le)72 rw [intervalIntegral.integral_const_mul,ibp] at bound73 have fin := mul_le_mul_of_nonneg_right bound htG.le74 field_simp [htG.ne'] at fin75 apply div_pos _ (sq_pos_of_pos htG)76 nlinarith [mul_pos Gpos htG]7778/-- Existence and uniqueness for the scalar threshold in (B2). -/79theorem threshold_unique {G : ℝ → ℝ} {K d : ℝ} (hd : 0 < d) (hK : 0 < K)80 (hc : 4*K < d*gap G 1) (hcont : ContinuousOn (gap G) (Icc 0 1))81 (hder : ∀ x ∈ Ioo 0 1, 0 < deriv (gap G) x) :82 ∃! t : ℝ, t ∈ Ioo 0 1 ∧ d*gap G t = 4*K := by83 have hm : StrictMonoOn (gap G) (Icc 0 1) :=84 strictMonoOn_of_deriv_pos (convex_Icc _ _) hcont (by simpa using hder)85 have h0 : d*gap G 0 < 4*K := by simp [gap]; linarith86 obtain ⟨t,ht,he⟩ := intermediate_value_Icc (f := fun x => d*gap G x) zero_le_one87 (continuousOn_const.mul hcont) (show 4*K ∈ Icc _ _ from ⟨h0.le,hc.le⟩)88 refine ⟨t,⟨⟨lt_of_le_of_ne ht.1 (by rintro rfl; exact h0.ne he),89 lt_of_le_of_ne ht.2 (by rintro rfl; exact hc.ne' he)⟩,he⟩,?_⟩90 intro u hu91 exact hm.injOn (Ioo_subset_Icc_self hu.1) ht (mul_left_cancel₀ hd.ne' (hu.2.trans he.symm))9293/-- Continuous extension of (B3) at zero, even when the density diverges there. -/94theorem gap_cont {G : ℝ → ℝ} (hG : Continuous G) (hmono : MonotoneOn G (Icc (0:ℝ) 1))95 (h0 : G 0=0) (hpos : ∀ x ∈ Ioc (0:ℝ) 1, 0 < G x) :96 ContinuousOn (gap G) (Icc 0 1) := by97 intro t ht98 have hc : Continuous (fun x : ℝ => x*G x) := continuous_id.mul hG99 rcases eq_or_lt_of_le ht.1 with he|he100 · subst t101 have bound (x : ℝ) (hx : x ∈ Icc (0:ℝ) 1) : 0 ≤ gap G x ∧ gap G x ≤ 2*x^2 := by102 rcases eq_or_lt_of_le hx.1 with h|h103 · subst x; simp [gap]104 have hGx := hpos _ ⟨h,hx.2⟩105 have sub : Icc 0 x ⊆ Icc (0:ℝ) 1 := Icc_subset_Icc_right hx.2106 have nn := intervalIntegral.integral_nonneg (f := fun y => y*G y) (μ := volume) h.le107 (fun y hy => mul_nonneg hy.1 (h0 ▸ hmono (show 0 ∈ Icc (0:ℝ) 1 by simp) (sub hy) hy.1))108 have le := intervalIntegral.integral_mono_on (μ := volume) h.le (hc.intervalIntegrable _ _)109 (f := fun y => y*G y) (g := fun _ => x*G x) intervalIntegrable_const110 (fun y hy => mul_le_mul hy.2 (hmono (sub hy) hx hy.2)111 (h0 ▸ hmono (show 0 ∈ Icc (0:ℝ) 1 by simp) (sub hy) hy.1) h.le)112 simp only [intervalIntegral.integral_const,sub_zero,smul_eq_mul] at le113 unfold gap114 exact ⟨div_nonneg (by positivity) hGx.le,(div_le_iff₀ hGx).2 (by nlinarith only [le])⟩115 change Tendsto _ _ (𝓝 (gap G 0))116 simp only [gap,intervalIntegral.integral_same,mul_zero,zero_div]117 apply tendsto_of_tendsto_of_tendsto_of_le_of_le' (g := fun x : ℝ => 0) (h := fun x : ℝ => 2*x^2)118 tendsto_const_nhds119 · have hh := (show ContinuousAt (fun x : ℝ => 2*x^2) 0 by fun_prop).tendsto.mono_left (nhdsWithin_le_nhds (s := Icc (0:ℝ) 1))120 simpa using hh121 · filter_upwards [self_mem_nhdsWithin] with x hx using (bound x hx).1122 · filter_upwards [self_mem_nhdsWithin] with x hx using (bound x hx).2123 · exact (continuousAt_const.mul (hc.integral_hasStrictDerivAt 0 t).hasDerivAt.continuousAt).div124 hG.continuousAt (hpos t ⟨he,ht.2⟩).ne' |>.continuousWithinAt125126/-- Inverse of a strictly increasing gap on the unit interval, differentiated127at an interior point. The inverse is defined by its unique preimage. -/128theorem inverse_gap {f : ℝ → ℝ} (hm : StrictMonoOn f (Icc (0:ℝ) 1))129 (hf : ContinuousOn f (Icc 0 1)) {t v : ℝ} (ht : t ∈ Ioo 0 1)130 (hd : HasDerivAt f v t) (hv : 0 < v) :131 HasDerivAt (Function.invFunOn f (Icc 0 1)) v⁻¹ (f t) := by132 let s := Icc (0:ℝ) 1133 let inv := Function.invFunOn f s134 have ht' := Ioo_subset_Icc_self ht135 have it : inv (f t) = t := hm.injOn.leftInvOn_invFunOn ht'136 have hL := hm (show (0:ℝ) ∈ s by simp [s]) ht' ht.1137 have hR := hm ht' (show (1:ℝ) ∈ s by simp [s]) ht.2138 have pre : ∀ᶠ y in 𝓝 (f t), inv y ∈ s ∧ f (inv y)=y := by139 filter_upwards [Ioo_mem_nhds hL hR] with y hy140 have hmem := intermediate_value_Icc zero_le_one hf (Ioo_subset_Icc_self hy)141 exact ⟨Function.invFunOn_mem hmem,Function.invFunOn_eq hmem⟩142 have ic : ContinuousAt inv (f t) := by143 change Tendsto _ _ (𝓝 (inv (f t))); rw [it,tendsto_order]144 constructor145 · intro l hl146 obtain ⟨u,hlu,hut⟩ := exists_between (max_lt hl ht.1)147 have um : u ∈ s := ⟨(le_max_right _ _).trans hlu.le,hut.le.trans ht.2.le⟩148 filter_upwards [pre,lt_mem_nhds (hm um ht' hut)] with y hy hh149 have hu : u < inv y := by apply lt_of_not_ge; intro h; linarith [hm.monotoneOn hy.1 um h,hy.2]150 exact ((le_max_left _ _).trans_lt hlu).trans hu151 · intro r hr152 obtain ⟨u,htu,hur⟩ := exists_between (lt_min hr ht.2)153 have um : u ∈ s := ⟨ht.1.le.trans htu.le,hur.le.trans (min_le_right _ _)⟩154 filter_upwards [pre,gt_mem_nhds (hm ht' um htu)] with y hy hh155 have hu : inv y < u := by apply lt_of_not_ge; intro h; linarith [hm.monotoneOn um hy.1 h,hy.2]156 exact hu.trans (hur.trans_le (min_le_left _ _))157 apply HasDerivAt.of_local_left_inverse ic (it.symm ▸ hd) hv.ne'158 exact pre.mono fun _ h => h.2159160/-- General-distribution issuance derivative, using the threshold function161defined by inverse gap. B4 supplies the positive gap derivative. -/162theorem proposition5_deriv {p q b K t : ℝ} {G : ℝ → ℝ} {g v : ℝ}163 (_hK : 0 < K) (hD : 0 < QuietInvestment.D p q b) (_gt : 0 < g) (vt : 0 < v)164 (ht : t ∈ Ioo 0 1) (eqn : QuietInvestment.D p q b * gap G t = 4*K)165 (hm : StrictMonoOn (gap G) (Icc 0 1)) (hcont : ContinuousOn (gap G) (Icc 0 1))166 (hgap : HasDerivAt (gap G) v t) (hg : HasDerivAt G g t) :167 let issuance := fun x => 1-G (Function.invFunOn (gap G) (Icc 0 1) (4*K/QuietInvestment.D x q b))168 HasDerivAt issuance (8*K*g*QuietInvestment.N p q b/(v*(QuietInvestment.D p q b)^2)) p := by169 dsimp only170 have he : 4*K/QuietInvestment.D p q b = gap G t := (div_eq_iff hD.ne').2 (by linarith)171 have hinv := inverse_gap hm hcont ht hgap vt172 rw [← he] at hinv173 have hval : Function.invFunOn (gap G) (Icc 0 1) (4*K/QuietInvestment.D p q b)=t := by174 rw [he]; exact hm.injOn.leftInvOn_invFunOn (Ioo_subset_Icc_self ht)175 have d := ((hasDerivAt_const p (4*K)).div (QuietInvestment.D_deriv_p p q b) hD.ne')176 have h := ((hval.symm ▸ hg).comp p (hinv.comp p d)).const_sub 1177 convert h using 1; field_simp [vt.ne',hD.ne']; ring178179end QuietInvestment.Distribution
Earnings.lean
Back to results1import Mathlib.Analysis.Calculus.Deriv.MeanValue2import Mathlib.Analysis.SpecialFunctions.Pow.Real3import Mathlib.Analysis.SpecialFunctions.Sqrt4import Mathlib.Analysis.Calculus.Deriv.Slope5import Mathlib.Analysis.Calculus.Deriv.Inv6import Mathlib.Tactic.FunProp7import Mathlib.Tactic.Linarith8import Mathlib.Tactic.FieldSimp9import Mathlib.Tactic.Positivity10import Mathlib.Tactic.Ring11noncomputable section12open Set Filter13open scoped Topology14namespace QuietInvestment.Earnings1516def d (k p : ℝ) := 2*k*p*(1-p)17def v (p q : ℝ) := 2*q*p-p^218def R (k p x : ℝ) := 1+d k p*x19def M (a K p q s : ℝ) := a*v p q*s+4*(a+2)*K20/-- Twice the net gain in (33) times (a+2)R². x is squared quality;21s is the squared threshold. -/22def H (a K k p q s x : ℝ) :=23 (a+2)*x*(v p q*R k p x-p^2*(d k p)^2*x^2) - M a K p q s*(R k p x)^22425/-- Checks the polynomial against price (32), loss and variance cost (33). -/26theorem cleared_gain (a K k p q t θ : ℝ) (ha : a+2 ≠ 0) (hr : R k p (θ^2) ≠ 0) :27 let z := p*θ/R k p (θ^2)28 H a K k p q (t^2) (θ^2) = 2*(a+2)*(R k p (θ^2))^2*29 (q*z*θ-z^2/2 - (q*p-p^2/2)*a*t^2/(a+2) - 2*K -30 (p*θ-z)^2/2-k*p*(1-p)*z^2*θ^2) := by31 dsimp only; unfold H M32 field_simp [ha,hr]; unfold v R d; ring3334private def dx (a K k p q s x y : ℝ) :=35 (a+2)*(v p q + v p q*d k p*(x+y)-p^2*(d k p)^2*(x^2+x*y+y^2)) -36 M a K p q s*d k p*(2+d k p*(x+y))37private def diag (a K k p q x y : ℝ) :=38 dx a K k p q y x y - a*v p q*(R k p x)^23940private theorem diff_x (a K k p q s x y : ℝ) :41 H a K k p q s y-H a K k p q s x = (y-x)*dx a K k p q s x y := by42 unfold H dx R; ring4344private theorem diff_diag (a K k p q x y : ℝ) :45 H a K k p q y y-H a K k p q x x = (y-x)*diag a K k p q x y := by46 unfold H diag dx M R; ring4748private def dp (a K k p r q s : ℝ) :=49 let dv := 2*q-r-p50 let dd := 2*k*(1-r-p)51 (a+2)*s*(dv*R k r s+v p q*dd*s-((r+p)*(d k r)^2+52 p^2*dd*(d k r+d k p))*s^2) - a*dv*s*(R k r s)^2 -53 M a K p q s*dd*s*(R k r s+R k p s)5455private theorem diff_p (a K k p r q s : ℝ) :56 H a K k r q s s - H a K k p q s s = (r-p)*dp a K k p r q s := by57 unfold H dp R M v d; ring5859private theorem regular {a K k : ℝ} (ha : 0 < a) :60 ∀ᶠ b : ℝ × ℝ in 𝓝 (1,1), ∀ w ∈ (Icc (0:ℝ) 1 ×ˢ (Icc (0:ℝ) 1 ×ˢ Icc (0:ℝ) 1)),61 0 < dx a K k b.1 b.2 w.1 w.2.1 w.2.2 ∧ 0 < diag a K k b.1 b.2 w.2.1 w.2.2 := by62 apply (isCompact_Icc.prod (isCompact_Icc.prod isCompact_Icc)).eventually_forall_of_forall_eventually63 intro w _64 apply Filter.Eventually.and65 · apply ContinuousAt.eventually_lt (f := fun _ => 0) continuousAt_const66 (g := fun z : (ℝ × ℝ) × (ℝ × ℝ × ℝ) => dx a K k z.1.1 z.1.2 z.2.1 z.2.2.1 z.2.2.2)67 · unfold dx M v d; fun_prop68 · dsimp [dx,M,R,v,d]; nlinarith69 · apply ContinuousAt.eventually_lt (f := fun _ => 0) continuousAt_const70 (g := fun z : (ℝ × ℝ) × (ℝ × ℝ × ℝ) => diag a K k z.1.1 z.1.2 z.2.2.1 z.2.2.2)71 · unfold diag dx M R v d; fun_prop72 · dsimp [diag,dx,M,R,v,d]; ring_nf; norm_num7374private theorem at_certainty (a K k s x : ℝ) :75 H a K k 1 1 s x = (a+2)*x-a*s-4*(a+2)*K := by unfold H R M v d; ring7677/-- Proposition 4. For all sufficiently close beliefs, the squared cutoff is78unique in [0,1], with the correct issuance incentives at every squared quality.79At fixed q it strictly falls with p. This proves the neighborhood statement by80finite differences and compactness, including uniformity across all qualities. -/81theorem proposition4 {a K k : ℝ} (ha : 0 < a) (hK : 0 < K)82 (hcost : K < 1/(2*(a+2))) (hk : 0 < k) :83 ∃ ε > (0:ℝ),84 (∀ p q : ℝ, |p-1| < ε → |q-1| < ε →85 ∃ s ∈ Ioo (0:ℝ) 1, H a K k p q s s = 0 ∧86 (∀ r ∈ Icc (0:ℝ) 1, H a K k p q r r = 0 → r = s) ∧87 (∀ x ∈ Icc (0:ℝ) 1, (H a K k p q s x < 0 ↔ x < s) ∧88 (0 < H a K k p q s x ↔ s < x))) ∧89 (∀ p r q s u : ℝ, |p-1| < ε → |r-1| < ε → |q-1| < ε → p < r →90 s ∈ Icc 0 1 → u ∈ Icc 0 1 →91 H a K k p q s s = 0 → H a K k r q u u = 0 → u < s) := by92 let c := 2*(a+2)*K93 have hc : 0 < c := by dsimp [c]; positivity94 have hc1 : c < 1 := by have h := (lt_div_iff₀ (show 0 < 2*(a+2) by positivity)).mp hcost; dsimp [c]; linarith95 have hpcont : Continuous (fun z : (ℝ × ℝ) × ℝ × ℝ => dp a K k z.1.1 z.1.2 z.2.1 z.2.2) := by96 unfold dp M R d v; fun_prop97 have hpbase : 0 < dp a K k 1 1 1 c := by98 have hh : dp a K k 1 1 1 c = 2*k*(a+2)*c^2 := by unfold dp M R v d c; ring99 rw [hh]; positivity100 have hpN := hpcont.continuousAt (x := ((1,1),(1,c))).eventually (lt_mem_nhds hpbase)101 obtain ⟨δ,hδ,hδbounds⟩ := Metric.eventually_nhds_iff.mp hpN102 let η := min (min c (1-c)) δ / 2103 have hmin : 0 < min (min c (1-c)) δ := lt_min (lt_min hc (sub_pos.mpr hc1)) hδ104 have hη : 0 < η := half_pos hmin105 have hηc : η < c := (half_lt_self hmin).trans_le ((min_le_left _ _).trans (min_le_left _ _))106 have hη1 : η < 1-c := (half_lt_self hmin).trans_le ((min_le_left _ _).trans (min_le_right _ _))107 have hηδ : η < δ := (half_lt_self hmin).trans_le (min_le_right _ _)108 let l := c-η109 let h := c+η110 have hlh : l < h := by dsimp [l,h]; linarith111 have hl0 : 0 < l := sub_pos.mpr hηc112 have hh1 : h < 1 := by dsimp [h]; linarith113 have nearH (s : ℝ) : Continuous (fun z : ℝ × ℝ => H a K k z.1 z.2 s s) := by114 unfold H M R d v; fun_prop115 have hlo : H a K k 1 1 l l < 0 := by rw [at_certainty]; dsimp [l,c]; nlinarith116 have hhi : 0 < H a K k 1 1 h h := by rw [at_certainty]; dsimp [h,c]; nlinarith117 have near := ((regular (K := K) (k := k) ha).and ((nearH l).continuousAt (x := (1,1)) |>.eventually (gt_mem_nhds hlo))).and118 ((nearH h).continuousAt (x := (1,1)) |>.eventually (lt_mem_nhds hhi))119 obtain ⟨τ,hτ,hτbounds⟩ := Metric.eventually_nhds_iff.mp near120 let ε := min τ δ121 refine ⟨ε,lt_min hτ hδ,?_⟩122 have data (p q : ℝ) (hp : |p-1| < ε) (hq : |q-1| < ε) :=123 @hτbounds (p,q) (by124 simp only [Prod.dist_eq,Real.dist_eq,max_lt_iff]125 exact ⟨hp.trans_le (min_le_left _ _), hq.trans_le (min_le_left _ _)⟩)126 have mono (p q : ℝ) (hp : |p-1| < ε) (hq : |q-1| < ε) :127 StrictMonoOn (fun s => H a K k p q s s) (Icc 0 1) := by128 intro x hx y hy hxy129 have hD := ((data p q hp hq).1.1 (x,(x,y)) ⟨hx,hx,hy⟩).2130 linarith only [diff_diag a K k p q x y,mul_pos (sub_pos.mpr hxy) hD]131 have root (p q : ℝ) (hp : |p-1| < ε) (hq : |q-1| < ε) :132 ∃ s ∈ Ioo l h, H a K k p q s s = 0 := by133 obtain ⟨s,hs,he⟩ := intermediate_value_Icc (f := fun s => H a K k p q s s) hlh.le134 (by unfold H M R d v; fun_prop) (show (0:ℝ) ∈ Icc _ _ from ⟨(data p q hp hq).1.2.le,(data p q hp hq).2.le⟩)135 exact ⟨s,⟨lt_of_le_of_ne hs.1 (by rintro rfl; exact (data p q hp hq).1.2.ne he),136 lt_of_le_of_ne hs.2 (by rintro rfl; exact (data p q hp hq).2.ne' he)⟩,he⟩137 constructor138 · intro p q hp hq139 obtain ⟨s,hs,he⟩ := root p q hp hq140 have hs' : s ∈ Icc (0:ℝ) 1 := ⟨(hl0.trans hs.1).le,(hs.2.trans hh1).le⟩141 refine ⟨s,⟨hl0.trans hs.1,hs.2.trans hh1⟩,he,fun r hr hzero =>142 (mono p q hp hq).injOn hr hs' (hzero.trans he.symm),?_⟩143 intro x hx144 have hD := ((data p q hp hq).1.1 (s,(s,x)) ⟨hs',hs',hx⟩).1145 have eqn := diff_x a K k p q s s x146 rw [he, sub_zero] at eqn147 rw [eqn]148 constructor <;> constructor <;> intro z149 · by_contra! hn; exact (not_lt_of_ge (mul_nonneg (sub_nonneg.mpr hn) hD.le)) z150 · exact mul_neg_of_neg_of_pos (sub_neg.mpr z) hD151 · by_contra! hn; exact (not_lt_of_ge (mul_nonpos_of_nonpos_of_nonneg (sub_nonpos.mpr hn) hD.le)) z152 · exact mul_pos (sub_pos.mpr z) hD153 · intro p r q s u hp hr hq hpr hs hu hps hru154 obtain ⟨s',hs',he'⟩ := root p q hp hq155 have heq := (mono p q hp hq).injOn hs ⟨(hl0.trans hs'.1).le,(hs'.2.trans hh1).le⟩ (hps.trans he'.symm)156 have hsc : |s-c| < δ := by157 rw [heq,abs_lt]; dsimp [l,h] at hs'; constructor <;> linarith [hs'.1,hs'.2]158 have hdif : 0 < dp a K k p r q s := @hδbounds ((p,r),(q,s)) (by159 simp only [Prod.dist_eq,Real.dist_eq,max_lt_iff]160 exact ⟨⟨hp.trans_le (min_le_right _ _),hr.trans_le (min_le_right _ _)⟩,161 ⟨hq.trans_le (min_le_right _ _),hsc⟩⟩)162 have hv : 0 < H a K k r q s s := by linarith only [diff_p a K k p r q s,hps,mul_pos (sub_pos.mpr hpr) hdif]163 by_contra! hsu164 exact (not_lt_of_ge ((mono r q hr hq).monotoneOn hs hu hsu)) (hru.symm ▸ hv)165def meanY (p θ z : ℝ) := p*z*θ-z^2/2166def earningsUtility (p k θ f z : ℝ) :=167 meanY p θ z-k*((f-meanY p θ z)^2+p*(1-p)*z^2*θ^2)168169/-- (29): expected squared error from the two earnings realizations. -/170theorem earnings_error (p θ f z : ℝ) :171 p*(f-(z*θ-z^2/2))^2+(1-p)*(f-(-z^2/2))^2 =172 (f-meanY p θ z)^2+p*(1-p)*z^2*θ^2 := by unfold meanY; ring173174/-- (30): unique optimum for the prescribed earnings forecast, from a sum of squares. -/175theorem earnings_choice {p k θ : ℝ} (hk : 0 < k) (hr : 0 < R k p (θ^2)) (z : ℝ) :176 let z₀ := p*θ/R k p (θ^2)177 let f := meanY p θ z₀178 earningsUtility p k θ f z ≤ earningsUtility p k θ f z₀ ∧179 (earningsUtility p k θ f z = earningsUtility p k θ f z₀ ↔ z=z₀) := by180 intro z₀ f181 have he : earningsUtility p k θ f z₀-earningsUtility p k θ f z =182 R k p (θ^2)/2*(z-z₀)^2+k*(f-meanY p θ z)^2 := by183 have zz : R k p (θ^2)*z₀=p*θ := by dsimp [z₀]; field_simp184 have zero : f-meanY p θ z₀=0 := sub_self _185 unfold earningsUtility; rw [zero]186 unfold R d at zz ⊢; unfold meanY; linear_combination (z-z₀)*zz187 constructor188 · linarith [mul_nonneg (half_pos hr).le (sq_nonneg (z-z₀)),mul_nonneg hk.le (sq_nonneg (f-meanY p θ z))]189 · constructor190 · intro hh; by_contra hn191 linarith [mul_pos (half_pos hr) (sq_pos_of_ne_zero (sub_ne_zero.mpr hn)),mul_nonneg hk.le (sq_nonneg (f-meanY p θ z))]192 · rintro rfl; rfl193194/-- (31): strict forecast ordering for positive types. -/195theorem forecast_earnings_deriv (p k θ : ℝ) (hr : R k p (θ^2) ≠ 0) :196 HasDerivAt (fun x => meanY p x (p*x/R k p (x^2)))197 (p^2*θ*(1+3*d k p*θ^2)/(R k p (θ^2))^3) θ := by198 have hi := hasDerivAt_id θ199 have hR := ((hi.pow 2).const_mul (d k p)).const_add 1200 have hz := (hi.const_mul p).div hR hr201 convert (((hz.const_mul p).mul hi).sub ((hz.pow 2).div_const 2)) using 1202 dsimp only [id_eq]; unfold R at *; field_simp [hr]; ring203204/-- With feasible beliefs, equation (31) gives a strictly separating earnings forecast. -/205theorem earnings_forecast_order {p k : ℝ} (hp : 0<p) (h1 : p<1) (hk : 0<k) :206 StrictMonoOn (fun x => meanY p x (p*x/R k p (x^2))) (Icc 0 1) := by207 have hd : 0<d k p := by unfold d; exact mul_pos (mul_pos (by positivity) hp) (sub_pos.mpr h1)208 have hr (x : ℝ) : 0<R k p (x^2) := by unfold R; positivity209 apply strictMonoOn_of_deriv_pos (convex_Icc _ _) (fun x _ =>210 (forecast_earnings_deriv p k x (hr x).ne').continuousAt.continuousWithinAt)211 intro x hx212 rw [interior_Icc] at hx213 rw [(forecast_earnings_deriv p k x (hr x).ne').deriv]214 have hx0 := hx.1215 exact div_pos (mul_pos (mul_pos (sq_pos_of_pos hp) hx0) (by positivity)) (pow_pos (hr x) _)216217/-- (A30), derived from the actual unique indifference root using secants.218Only local indifference and interiority are required of a chosen root function;219Proposition 4 proves existence and uniqueness of precisely such roots. -/220theorem cutoff_deriv_at_certainty {a k K : ℝ} (ha : 0 < a) (_hk : 0 < k) (hK : 0 < K)221 (s : ℝ → ℝ) (hroot : ∀ᶠ p in 𝓝 (1:ℝ), s p ∈ Icc 0 1 ∧ H a K k p 1 (s p) (s p)=0) :222 HasDerivAt (fun p => Real.sqrt (s p))223 (-(k*(a+2)/2)*(Real.sqrt (s 1))^3) 1 := by224 let c := 2*(a+2)*K225 have hc : 0 < c := by dsimp [c]; positivity226 have hbase := hroot.self_of_nhds.2227 rw [at_certainty] at hbase228 have h1 : s 1=c := by dsimp [c]; linarith229 have hzero : H a K k 1 1 c c=0 := by rw [at_certainty]; dsimp [c]; ring230 have hd : Tendsto (fun p => diag a K k p 1 c (s p)) (𝓝 1) (𝓝 2) := by231 apply Metric.tendsto_nhds.mpr232 intro ε hε233 have he : ∀ᶠ p : ℝ in 𝓝 1, ∀ u ∈ Icc (0:ℝ) 1, dist (diag a K k p 1 c u) 2 < ε := by234 apply isCompact_Icc.eventually_forall_of_forall_eventually235 intro u _236 have hcon : Continuous (fun z : ℝ × ℝ => diag a K k z.1 1 c z.2) := by unfold diag dx M R v d; fun_prop237 have hdiag : diag a K k 1 1 c u=2 := by unfold diag dx M R v d; ring238 have hnear := (hcon.continuousAt (x := (1,u))).eventually (Metric.ball_mem_nhds _ hε)239 simpa only [Metric.mem_ball,hdiag] using hnear240 filter_upwards [he,hroot] with p h hp using h (s p) hp.1241 have hdp : Continuous (fun p => dp a K k 1 p 1 c) := by unfold dp M R v d; fun_prop242 have dp0 : dp a K k 1 1 1 c=2*k*(a+2)*c^2 := by unfold dp M R v d c; ring243 have hratio := (hdp.continuousAt (x := 1)).tendsto.neg.div hd (by norm_num : (2:ℝ) ≠ 0)244 have hs : HasDerivAt s (-(k*(a+2)*c^2)) 1 := by245 rw [hasDerivAt_iff_tendsto_slope]246 have hh : -(k*(a+2)*c^2) = -(dp a K k 1 1 1 c)/2 := by rw [dp0]; ring247 rw [hh]248 apply (hratio.mono_left nhdsWithin_le_nhds).congr'249 have hdnon := hd.eventually (eventually_ne_nhds (by norm_num : (2:ℝ)≠0))250 filter_upwards [nhdsWithin_le_nhds hroot,nhdsWithin_le_nhds hdnon,self_mem_nhdsWithin] with p hp hdn hne251 have hp1 : p≠1 := hne252 rw [slope_def_field,h1]253 have eq1 := diff_p a K k 1 p 1 c254 have eq2 := diff_diag a K k p 1 c (s p)255 rw [hp.2] at eq2; rw [hzero] at eq1256 field_simp [hdn,sub_ne_zero.mpr hp1]; nlinarith only [eq1,eq2]257 convert hs.sqrt (h1 ▸ hc.ne') using 1258 rw [h1]; have hh := Real.sq_sqrt hc.le; have ht := Real.sqrt_pos.2 hc259 field_simp [ht.ne']; nlinarith only [congrArg (fun x : ℝ => k*(a+2)*x^2) hh]260end QuietInvestment.Earnings
Equilibrium.lean
Back to results1import QuietInvestment2import Schedules3import Selection4noncomputable section5open Set Filter6open scoped Topology7namespace QuietInvestment89def investment (p k x f : ℝ) := (p*x+2*k*f)/(1+2*k)10def lossWeight (k : ℝ) := k/(1+2*k)11def value (m p k x f : ℝ) :=12 m*x*investment p k x f - (investment p k x f)^2/213def accurateValue (p q b x : ℝ) := D p q b*x^2/214def forecast (p k : ℝ) (e : ℝ → ℝ) (x : ℝ) := p*x+(1+2*k)*e x1516theorem optimal_investment {k : ℝ} (hk : 0 < k) (p x f z : ℝ) :17 let U := fun y : ℝ => p*x*y-y^2/2-k*(f-y)^218 U (investment p k x f)-U z = (1+2*k)/2*(z-investment p k x f)^2 := by19 unfold investment; dsimp only20 field_simp [show 1+2*k ≠ 0 by linarith]; ring2122theorem optimized_payoff {k : ℝ} (hk : 0 < k) (p x f : ℝ) :23 let z := investment p k x f24 p*x*z-z^2/2-k*(f-z)^2 = (p*x)^2/2-lossWeight k*(f-p*x)^2 := by25 unfold investment lossWeight; dsimp only; field_simp [show 1+2*k ≠ 0 by linarith]; ring2627theorem price_accurate {k : ℝ} (hk : 0 < k) (p q b x : ℝ) :28 value (p-b*(p-q)) p k x (p*x) = accurateValue p q b x := by29 unfold value accurateValue investment D30 field_simp [show 1+2*k ≠ 0 by linarith]; ring3132theorem anchor_indifference {a K p q b t : ℝ} (ha : 0 < a) (h : D p q b*t^2 = C a K) :33 accurateValue p q b t - K -34 (D p q b/2*(a*t^2/(a+2))) = K := by35 unfold accurateValue C at *36 field_simp [show a+2 ≠ 0 by linarith]37 nlinarith only [h]3839/-- Lemma 1(i): strictly ordered separating forecasts from the two incentive constraints. -/40theorem forecast_ordering {w a b f g va vb : ℝ} (hw : 0 < w) (hab : a < b)41 (hsep : f ≠ g) (hlo : vb-w*(g-a)^2 ≤ va-w*(f-a)^2)42 (hhi : va-w*(f-b)^2 ≤ vb-w*(g-b)^2) : f < g := by43 by_contra! h44 have := mul_pos (mul_pos hw (sub_pos.mpr hab)) (sub_pos.mpr (lt_of_le_of_ne h hsep.symm))45 nlinarith4647/-- Payment required to attract a type under a deviation. U is the type's48equilibrium payoff net of silence, prices are measured relative to the49marginal forecast's gross price. -/50def required (w p : ℝ) (U : ℝ → ℝ) (x f : ℝ) := U x + w*(f-p*x)^25152/-- The smallest on-path forecast and its imitators, (A21). -/53theorem marginal_imitation {k p x t : ℝ} (hk : 0 < k) (hp : 0 < p) (hx : x < t) :54 -lossWeight k*(p*t-p*x)^2 < 0 := by55 have hw : 0 < lossWeight k := div_pos hk (by linarith)56 exact mul_neg_of_neg_of_pos (neg_neg_of_pos hw)57 (sq_pos_of_pos (sub_pos.mpr (mul_lt_mul_of_pos_left hx hp)))5859/-- D1 for forecasts below the schedule. The unique lowest required price60belongs to f/p; the actual price offered to that type is strictly lower. -/61theorem d1_low {p q b k t f : ℝ} {U : ℝ → ℝ} (hp : 0 < p) (hk : 0 < k)62 (hd : 0 < D p q b) (hf : 0 ≤ f) (hft : f < p*t)63 (hU : ∀ x ∈ Icc (0:ℝ) 1, 0 ≤ U x) (hsil : U (f/p) = 0) :64 required (lossWeight k) p U (f/p) f = 0 ∧65 (∀ x ∈ Icc (0:ℝ) 1, x ≠ f/p → 0 < required (lossWeight k) p U x f) ∧66 value (p-b*(p-q)) p k (f/p) f - accurateValue p q b t < 0 := by67 have he : p*(f/p) = f := by field_simp68 refine ⟨by simp [required,hsil,he],?_,?_⟩69 · intro x hx hne70 have huv : f-p*x ≠ 0 := by intro h; apply hne; apply (eq_div_iff hp.ne').2; linarith71 exact add_pos_of_nonneg_of_pos (hU x hx) (mul_pos (div_pos hk (by linarith)) (sq_pos_of_ne_zero huv))72 · have hprice := price_accurate hk p q b (f/p)73 rw [he] at hprice; rw [hprice]; unfold accurateValue74 have ht : f/p < t := (div_lt_iff₀ hp).mpr (by linarith)75 have hh := sq_lt_sq' (by linarith [div_nonneg hf hp.le] : -(t) < f/p) ht76 linarith [mul_lt_mul_of_pos_left hh hd]7778/-- D1 for forecasts above the schedule. On-path IC with the top forecast79suffices to compare every type's indifference price with type one's. -/80theorem d1_high {p k b q F f Vtop anchor : ℝ} {U : ℝ → ℝ}81 (hp : 0 < p) (hk : 0 < k) (hF : p ≤ F) (hf : F < f) (hm : p-b*(p-q) ≤ p)82 (hv : Vtop = value (p-b*(p-q)) p k 1 F-anchor)83 (hU1 : U 1 = Vtop-lossWeight k*(F-p)^2)84 (hIC : ∀ x ∈ Icc (0:ℝ) 1, Vtop-lossWeight k*(F-p*x)^2 ≤ U x) :85 (∀ x ∈ Icc (0:ℝ) 1, x < 1 →86 required (lossWeight k) p U 1 f < required (lossWeight k) p U x f) ∧87 value (p-b*(p-q)) p k 1 f-anchor < required (lossWeight k) p U 1 f := by88 have hw : 0 < lossWeight k := div_pos hk (by linarith)89 constructor90 · intro x hx h91 unfold required; rw [hU1]; simp only [mul_one]92 nlinarith only [hIC x hx,mul_pos (mul_pos (mul_pos hw hp) (sub_pos.mpr h)) (sub_pos.mpr hf)]93 · have hd : 0 < 1+2*k := by linarith94 have hz : p ≤ investment p k 1 F := by unfold investment; rw [le_div_iff₀ hd]; nlinarith [mul_nonneg hk.le (sub_nonneg.mpr hF)]95 have hz' : investment p k 1 F < investment p k 1 f := by96 unfold investment; apply div_lt_div_of_pos_right _ hd; nlinarith [mul_pos hk (sub_pos.mpr hf)]97 have hv' : value (p-b*(p-q)) p k 1 f < value (p-b*(p-q)) p k 1 F := by98 unfold value; simp only [mul_one]99 nlinarith only [mul_pos (sub_pos.mpr hz') (show 0 < investment p k 1 f + investment p k 1 F - 2*(p-b*(p-q)) by linarith)]100 unfold required; rw [hU1,hv]; simp only [mul_one]101 nlinarith only [hv',mul_pos (mul_pos hw (sub_pos.mpr hf)) (show 0 < f+F-2*p by linarith)]102103/-- Along an (A16) schedule, the price derivative equals 2*k*e*F' (A15). -/104theorem price_derivative_identity {p q b k x e v : ℝ} (hk : 0 < k)105 (he : (b*(p-q)*x+(1+4*k)*e)*v =106 D p q b/(2*k)*x-(p+b*(p-q))*e) :107 (p-b*(p-q))*(p*x+2*k*e) + ((p-b*(p-q))*x-(p*x+2*k*e))*(p+2*k*v) =108 2*k*e*(p+(1+2*k)*v) := by109 unfold D at he; field_simp [hk.ne'] at he110 linear_combination -he111112/-- (A20): after substitution of the envelope price derivative, the imitation113payoff is single-peaked at the true type. -/114theorem imitation_derivative {p k : ℝ} (hk : 0 < k) {F V : ℝ → ℝ} {s : Set ℝ}115 {x y e v : ℝ} (hF : HasDerivWithinAt F v s y)116 (hV : HasDerivWithinAt V (2*k*e*v) s y) (hy : F y = p*y+(1+2*k)*e) :117 HasDerivWithinAt (fun t => V t-lossWeight k*(F t-p*x)^2)118 (2*lossWeight k*p*(x-y)*v) s y := by119 convert hV.sub ((((hF.sub_const (p*x)).pow 2).const_mul (lossWeight k))) using 1120 rw [hy]; unfold lossWeight; field_simp [show 1+2*k ≠ 0 by linarith]; ring121122/-- Global on-path optimization from the single-crossing derivative (A20).123The same result includes nonissuers whose best possible imitation is t. -/124theorem best_imitation {t x : ℝ} (ht : t ≤ 1) (hx : x ≤ 1)125 {u v : ℝ → ℝ} (hu : ∀ y ∈ Icc t 1, HasDerivWithinAt u ((x-y)*v y) (Icc t 1) y)126 (hv : ∀ y ∈ Icc t 1, 0 ≤ v y) :127 ∀ y ∈ Icc t 1, u y ≤ u (max t x) := by128 let m := max t x129 have htm : t ≤ m := le_max_left _ _130 have hm1 : m ≤ 1 := max_le ht hx131 intro y hy132 rcases le_total y m with h | h133 · by_cases ht' : x ≤ t134 · rw [max_eq_left ht']; have : y=t := le_antisymm (by simpa [m,max_eq_left ht'] using h) hy.1; simp [this]135 · have hmx : m=x := max_eq_right (le_of_not_ge ht')136 have sub : Icc t m ⊆ Icc t 1 := Icc_subset_Icc_right hm1137 apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc t m)138 (fun z hz => ((hu z (sub hz)).mono sub).continuousWithinAt)139 (fun z hz => (hu z (sub (interior_subset hz))).mono (interior_subset.trans sub)) _ ⟨hy.1,h⟩ ⟨htm,le_rfl⟩ h140 intro z hz; exact mul_nonneg (sub_nonneg.mpr (hmx ▸ (interior_subset hz).2)) (hv _ (sub (interior_subset hz)))141 · have sub : Icc m 1 ⊆ Icc t 1 := Icc_subset_Icc_left htm142 apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc m 1)143 (fun z hz => ((hu z (sub hz)).mono sub).continuousWithinAt)144 (fun z hz => (hu z (sub (interior_subset hz))).mono (interior_subset.trans sub)) _ ⟨le_rfl,hm1⟩ ⟨h,hy.2⟩ h145 intro z hz; exact mul_nonpos_of_nonpos_of_nonneg (sub_nonpos.mpr ((le_max_right _ _).trans (interior_subset hz).1)) (hv _ (sub (interior_subset hz)))146147/-- Corollary 1, including initially silent types crossing the cutoff:148additional investment at the new p is nonnegative and nondecreasing in type. -/149theorem corollary1 {p q r k : ℝ} {extra : ℝ → ℝ} (hp : q < p) (hr : p < r)150 (hk : 0 < k) (hn : ∀ x ∈ Icc (0:ℝ) 1, 0 ≤ extra x) (hm : MonotoneOn extra (Icc 0 1)) :151 let gain := fun x => (r*x+2*k*extra x-q*x) - (p*x-q*x)152 (∀ x ∈ Ioc (0:ℝ) 1, 0 < p*x-q*x ∧ 0 < gain x) ∧ StrictMonoOn gain (Icc 0 1) := by153 dsimp only154 constructor155 · intro x hx156 constructor157 · nlinarith [mul_pos (sub_pos.mpr hp) hx.1]158 · nlinarith [mul_pos (sub_pos.mpr hr) hx.1,mul_nonneg hk.le (hn x (Ioc_subset_Icc_self hx))]159 · intro x hx y hy hxy160 dsimp only161 nlinarith [mul_pos (sub_pos.mpr hr) (sub_pos.mpr hxy),mul_nonneg hk.le (sub_nonneg.mpr (hm hx hy hxy.le))]162end QuietInvestment
Investment.lean
Back to results1import QuietInvestment2import Schedules3import Mathlib.Analysis.Calculus.Deriv.Slope4import Mathlib.Analysis.SpecialFunctions.Integrals5noncomputable section6open Set Filter MeasureTheory7open scoped Topology Interval8namespace QuietInvestment.Investment9open QuietInvestment10def den (p q b k x z : ℝ) := (1+4*k)*(z-p*x)+2*k*b*(p-q)*x11def num (p q b k x z : ℝ) := ((1+2*k)*p-2*k*b*(p-q))*z-p^2*x1213/-- The investment schedule on the issuing interval, in (A26) form. -/14structure Active (p q b k t : ℝ) (z v : ℝ → ℝ) : Prop where15 boundary : z t = p*t16 lower : ∀ x ∈ Icc t 1, p*x ≤ z x17 vel : ∀ x ∈ Icc t 1, p ≤ v x18 der : ∀ x ∈ Icc t 1, HasDerivWithinAt z (v x) (Icc t 1) x19 eqn : ∀ x ∈ Icc t 1, den p q b k x (z x)*v x = num p q b k x (z x)2021/-- Direct transformation from (A16) to (A26); derives the Active interface. -/22theorem active_of_schedule {p q b k t : ℝ} {e w : ℝ → ℝ} (hk : 0 < k) (hb : e t=0)23 (de : ∀ x ∈ Icc t 1, HasDerivWithinAt e (w x) (Icc t 1) x)24 (he : ∀ x ∈ Icc t 1, 0 ≤ e x ∧ 0 ≤ w x)25 (eqn : ∀ x ∈ Icc t 1, (b*(p-q)*x+(1+4*k)*e x)*w x =26 D p q b/(2*k)*x-(p+b*(p-q))*e x) :27 Active p q b k t (fun x => p*x+2*k*e x) (fun x => p+2*k*w x) := by28 constructor29 · simp [hb]30 · intro x hx; exact le_add_of_nonneg_right (by have := (he x hx).1; positivity)31 · intro x hx; exact le_add_of_nonneg_right (by have := (he x hx).2; positivity)32 · intro x hx33 simpa using (((hasDerivWithinAt_id x (Icc t 1)).const_mul p).add ((de x hx).const_mul (2*k)))34 · intro x hx; have h := eqn x hx35 unfold D at h; field_simp [hk.ne'] at h36 unfold den num; linear_combination 2*k*h3738/-- One-sided first-contact comparison, also strict at the right endpoint. -/39theorem strict_comparison {a b : ℝ} {f g df dg : ℝ → ℝ}40 (ha : f a ≤ g a) (hf : ∀ x ∈ Icc a b, HasDerivWithinAt f (df x) (Icc a b) x)41 (hg : ∀ x ∈ Icc a b, HasDerivWithinAt g (dg x) (Icc a b) x)42 (hit : ∀ x ∈ Icc a b, f x=g x → df x < dg x) :43 ∀ x ∈ Ioc a b, f x < g x := by44 have weak : ∀ x ∈ Icc a b, f x ≤ g x := image_le_of_deriv_right_lt_deriv_boundary'45 (fun x hx => (hf x hx).continuousWithinAt)46 (fun x hx => (hf x (Ico_subset_Icc_self hx)).mono_of_mem_nhdsWithin (Icc_mem_nhdsGE_of_mem hx))47 ha (fun x hx => (hg x hx).continuousWithinAt)48 (fun x hx => (hg x (Ico_subset_Icc_self hx)).mono_of_mem_nhdsWithin (Icc_mem_nhdsGE_of_mem hx))49 (fun x hx => hit x (Ico_subset_Icc_self hx))50 intro x hx51 refine lt_of_le_of_ne (weak x (Ioc_subset_Icc_self hx)) ?_52 intro he53 have hs := ((hg x (Ioc_subset_Icc_self hx)).sub (hf x (Ioc_subset_Icc_self hx))).mono_of_mem_nhdsWithin54 (Icc_mem_nhdsLT_of_mem hx)55 have hlim := (hasDerivWithinAt_iff_tendsto_slope' (show x ∉ Iio x by simp)).mp hs56 have hz : dg x - df x ≤ 0 := le_of_tendsto hlim (by57 filter_upwards [Icc_mem_nhdsLT_of_mem hx, self_mem_nhdsWithin] with y hy hyx58 rw [slope_def_field]; simp only [Pi.sub_apply,he,sub_self,sub_zero]59 exact div_nonpos_of_nonneg_of_nonpos (sub_nonneg.mpr (weak y hy)) (sub_nonpos.mpr (le_of_lt hyx)))60 linarith [hit x (Ioc_subset_Icc_self hx) he]6162private theorem residual {p r q b k x z v : ℝ} (hp : 0 < p) (hpr : p ≤ r)63 (hk : 0 < k) (hb : b < 1) (hx : 0 < x) (hz : r*x ≤ z) (hv : p ≤ v)64 (he : den p q b k x z*v = num p q b k x z) :65 ∃ T > (0:ℝ), num r q b k x z-den r q b k x z*v = (r-p)*T := by66 let T := (1+2*k*(1-b))*z-(p+r)*x+(1+2*k*(2-b))*x*v67 have h1 : 0 < 1+2*k*(1-b) := by nlinarith [mul_pos hk (sub_pos.mpr hb)]68 have h2 : 0 < 1+2*k*(2-b) := by nlinarith [mul_pos hk (show 0 < 2-b by linarith)]69 have hT : 0 < T := by70 dsimp [T]71 have hbase : 0 < 2*k*((1-b)*r+(2-b)*p)*x := by72 have hr := hp.trans_le hpr73 have hb' := sub_pos.mpr hb74 have hb'' : 0 < 2-b := by linarith75 positivity76 nlinarith only [mul_le_mul_of_nonneg_left hz h1.le,mul_le_mul_of_nonneg_left hv (mul_pos h2 hx).le,hbase]77 refine ⟨T,hT,?_⟩78 unfold T num den at *; linear_combination -he7980private def marker (b q x z : ℝ) := (1-2*b)*z^2+2*b*q*x*z81private theorem marker_id (p b q x : ℝ) : marker b q x (p*x) = D p q b*x^2 := by82 unfold marker D; ring8384/-- The old investment schedule stays above the *cutoff equation* in marker85space. This avoids differentiating an ODE solution with respect to a parameter. -/86private theorem marker_above {p q b k c t : ℝ} {z v : ℝ → ℝ}87 (hq : 0 < q) (hpq : q < p) (hb : 0 < b) (hb1 : b < 1) (hk : 0 < k)88 (hc : 0 < c) (ht : 0 < t) (hreg : N p q b < 0) (hcut : D p q b*t^2=c)89 (hs : Active p q b k t z v) :90 ∀ x ∈ Ioc t 1, c < marker b q x (z x) := by91 let V := fun x => 2*((1-2*b)*z x+b*q*x)*v x+2*b*q*z x92 have dg (x : ℝ) (hx : x ∈ Icc t 1) :93 HasDerivWithinAt (fun y => marker b q y (z y)) (V x) (Icc t 1) x := by94 convert (((hs.der x hx).pow 2).const_mul (1-2*b)).add95 ((((hasDerivWithinAt_id x (Icc t 1)).const_mul (2*b*q))).mul (hs.der x hx)) using 196 dsimp [V]; ring97 apply strict_comparison (f := fun _ => c) (df := fun _ => 0) (dg := V)98 (by rw [hs.boundary,marker_id,hcut])99 (fun x _ => (hasDerivAt_const x c).hasDerivWithinAt) dg100 intro x hx hhit101 have hx0 := ht.trans_le hx.1102 let r := z x/x103 have hrx : r*x=z x := by dsimp [r]; field_simp104 have hr : p ≤ r := (le_div_iff₀ hx0).mpr (hs.lower x hx)105 have hrq : 0 < r-q := sub_pos.mpr (hpq.trans_le hr)106 have hrp : 0 < r := (hq.trans hpq).trans_le hr107 have hmr : D r q b*x^2 = c := by rw [← marker_id,hrx]; exact hhit.symm108 have hDr : 0 < D r q b := (mul_pos_iff_of_pos_right (sq_pos_of_pos hx0)).mp (hmr ▸ hc)109 have hbeta : 1 < 2*b := by110 by_contra! h; unfold N at hreg111 nlinarith [mul_nonneg (sub_nonneg.mpr h) (hq.trans hpq).le,mul_pos hb hq]112 have hNr : N r q b < 0 := by unfold N at *; nlinarith [mul_nonneg (sub_pos.mpr hbeta).le (sub_nonneg.mpr hr)]113 obtain ⟨T,hT,he⟩ := residual (hq.trans hpq) hr hk hb1 hx0 hrx.le (hs.vel x hx) (hs.eqn x hx)114 let vr := r + D r q b/(b*(r-q))115 have hvr : den r q b k x (z x)*vr = num r q b k x (z x) := by116 rw [← hrx]; unfold den num vr D; field_simp [hb.ne',hrq.ne']; ring117 have hd : 0 < den r q b k x (z x) := by rw [← hrx]; unfold den; rw [sub_self,mul_zero,zero_add]; positivity118 have hle : v x ≤ vr := by119 apply le_of_not_gt; intro hz120 linarith only [mul_lt_mul_of_pos_left hz hd,hvr,he,mul_nonneg (sub_nonneg.mpr hr) hT.le]121 have key : N r q b*vr + b*q*r = D r q b*r*(1-b)/(b*(r-q)) := by122 unfold N vr D; field_simp [hb.ne',hrq.ne']; ring123 have pos : 0 < N r q b*vr + b*q*r := by rw [key]; exact div_pos (mul_pos (mul_pos hDr hrp) (sub_pos.mpr hb1)) (mul_pos hb hrq)124 have ord := mul_le_mul_of_nonpos_left hle hNr.le125 have pos' : 0 < 2*x*(N r q b*v x + b*q*r) := mul_pos (by positivity) (by linarith)126 dsimp [V]; rw [← hrx]; unfold N at pos'; nlinarith only [pos']127128/-- Piecewise investment rule. -/129def actual (p t : ℝ) (z : ℝ → ℝ) (x : ℝ) := if x < t then p*x else z x130131/-- Proposition 3 at every positive quality, for any two admissible132equilibrium schedules. A weighted integral then gives the expected result. -/133theorem proposition3 {p r q b k c t u : ℝ} {z Z v V : ℝ → ℝ}134 (hq : 0 < q) (hpq : q < p) (hpr : p < r) (hb : 0 < b) (hb1 : b < 1)135 (hk : 0 < k) (hc : 0 < c) (ht : t ∈ Ioo 0 1) (hu : u ∈ Ioo 0 1)136 (hreg : N p q b < 0) (ht1 : D p q b*t^2=c) (hu1 : D r q b*u^2=c)137 (hs : Active p q b k t z v) (hS : Active r q b k u Z V) :138 ∀ x ∈ Ioc (0:ℝ) 1, actual p t z x < actual r u Z x := by139 have hbeta : 1 < 2*b := by140 by_contra! h; unfold N at hreg141 nlinarith [mul_nonneg (sub_nonneg.mpr h) (hq.trans hpq).le,mul_pos hb hq]142 have Danti {P R : ℝ} (hP : p ≤ P) (hR : P < R) : D R q b < D P q b := by143 have hN : N p q b + (1-2*b)*(P-p) + (1-2*b)*(R-p) + N p q b < 0 := by144 have := mul_nonpos_of_nonpos_of_nonneg (sub_nonpos.mpr hbeta.le) (sub_nonneg.mpr hP)145 have := mul_nonpos_of_nonpos_of_nonneg (sub_nonpos.mpr hbeta.le) (sub_nonneg.mpr (hP.trans hR.le)); linarith146 have := mul_neg_of_pos_of_neg (sub_pos.mpr hR) hN147 unfold D N at *; nlinarith only [this]148 have hDr : 0 < D r q b := (mul_pos_iff_of_pos_right (sq_pos_of_pos hu.1)).mp (hu1 ▸ hc)149 have htu : t < u := by150 by_contra! h151 have hh := mul_lt_mul_of_pos_right (Danti (le_refl p) hpr) (sq_pos_of_pos ht.1)152 have h2 : u^2 ≤ t^2 := by nlinarith [mul_nonneg (sub_nonneg.mpr h) (add_pos hu.1 ht.1).le]153 linarith [mul_le_mul_of_nonneg_left h2 hDr.le]154 have before (x : ℝ) (hx : x ∈ Icc t u) : z x < r*x := by155 rcases eq_or_lt_of_le hx.1 with he | htx156 · rw [← he,hs.boundary]; exact mul_lt_mul_of_pos_right hpr ht.1157 have hx0 := ht.1.trans htx158 have hmark := marker_above hq hpq hb hb1 hk hc ht.1 hreg ht1 hs x ⟨htx,hx.2.trans hu.2.le⟩159 by_contra! hz160 let R := z x/x161 have hR : r ≤ R := (le_div_iff₀ hx0).2 hz162 have hRx : R*x=z x := by dsimp [R]; field_simp163 have hD : D R q b ≤ D r q b := by164 rcases eq_or_lt_of_le hR with h|h165 · rw [h]166 · exact (Danti hpr.le h).le167 rw [← hRx,marker_id] at hmark168 have hsq : x^2 ≤ u^2 := by nlinarith [mul_nonneg (sub_nonneg.mpr hx.2) (add_pos hu.1 hx0).le]169 linarith [mul_le_mul_of_nonneg_right hD (sq_nonneg x),mul_le_mul_of_nonneg_left hsq hDr.le]170 have huOrd := before u ⟨htu.le,le_rfl⟩171 have after : ∀ x ∈ Ioc u 1, z x < Z x := by172 have sub : Icc u 1 ⊆ Icc t 1 := Icc_subset_Icc_left htu.le173 apply strict_comparison (a := u) (b := 1) (df := v) (dg := V)174 (hS.boundary ▸ huOrd.le) (fun x hx => (hs.der x (sub hx)).mono sub) hS.der175 intro x hx hhit176 have hx0 := hu.1.trans_le hx.1177 obtain ⟨T,hT,he⟩ := residual (hq.trans hpq) hpr.le hk hb1 hx0 (hhit ▸ hS.lower x hx) (hs.vel x (sub hx)) (hs.eqn x (sub hx))178 rw [hhit] at he179 have hd : 0 < den r q b k x (Z x) := by180 unfold den181 have h := sub_nonneg.mpr (hS.lower x hx)182 have hh := sub_pos.mpr (hpq.trans hpr)183 positivity184 apply lt_of_not_ge; intro h185 linarith only [mul_le_mul_of_nonneg_left h hd.le,hS.eqn x hx,he,mul_pos (sub_pos.mpr hpr) hT]186 intro x hx187 unfold actual188 split_ifs with ht' hu' hu'189 · exact mul_lt_mul_of_pos_right hpr hx.1190 · exact False.elim (hu' (ht'.trans htu))191 · exact before x ⟨le_of_not_gt ht',hu'.le⟩192 · rcases eq_or_lt_of_le (le_of_not_gt hu') with he | h193 · rw [← he,hS.boundary]; exact huOrd194 · exact after x ⟨h,hx.2⟩195196end QuietInvestment.Investment
Manuscript.lean
Back to results1import Comparisons2import Necessity3import CommonPrior4noncomputable section5open Set Filter MeasureTheory6open scoped Topology Interval7namespace QuietInvestment89/-- Corollary 1. The extra investment induced by new issuance is zero up to10the new cutoff and increases thereafter. This covers an initially silent CEO11who switches to issuance when p rises. -/12theorem corollary1_model {p q r b k u : ℝ} {e w : ℝ → ℝ} (hpq : q < p)13 (hpr : p < r) (hk : 0 < k) (_hu : u ∈ Ioo 0 1) (hs : Path r q b k u e w) :14 let extra := fun x => if x<u then 0 else e x15 let Δ := fun x => r*x+2*k*extra x-q*x-(p*x-q*x)16 (∀ x ∈ Ioc (0:ℝ) 1, p*x-q*x=(p-q)*x ∧ 0 < p*x-q*x ∧ 0 < Δ x) ∧17 StrictMonoOn Δ (Icc 0 1) := by18 intro extra Δ19 have hn (x : ℝ) (hx : x ∈ Icc (0:ℝ) 1) : 0 ≤ extra x := by20 dsimp [extra]; split_ifs with h21 · exact le_rfl22 · exact (hs.positive _ ⟨le_of_not_gt h,hx.2⟩).123 have hm : MonotoneOn extra (Icc (0:ℝ) 1) := by24 intro x hx y hy hxy; dsimp [extra]; split_ifs with xl yl yl25 · exact le_rfl26 · exact (hs.positive _ ⟨le_of_not_gt yl,hy.2⟩).127 · exact False.elim (xl (hxy.trans_lt yl))28 · exact hs.mono.monotoneOn ⟨le_of_not_gt xl,hx.2⟩ ⟨le_of_not_gt yl,hy.2⟩ hxy29 have h := corollary1 hpq hpr hk hn hm30 exact ⟨fun x hx => ⟨by ring,h.1 x hx⟩,h.2⟩3132/-- (A26) at the moving issuance boundary implies the positive partial33in (A27), including its exact dependence on investor sophistication. -/34theorem investment_boundary_partial {p q b k t : ℝ} (hp : 0 < p) (hpq : q < p)35 (hb : 0 < b) (hb1 : b < 1) (hk : 0 < k) (ht : 0 < t) (hd : 0 < D p q b) :36 let v := Investment.num p q b k t (p*t) / Investment.den p q b k t (p*t)37 let tp := -t*N p q b/D p q b38 t+(p-v)*tp=t*p*(1-b)/(b*(p-q)) ∧ 0 < t*p*(1-b)/(b*(p-q)) := by39 dsimp only40 have hdiff := sub_pos.mpr hpq41 have hv : Investment.den p q b k t (p*t)=2*k*b*(p-q)*t := by unfold Investment.den; ring42 constructor43 · rw [hv]; unfold Investment.num; field_simp [ht.ne',hb.ne',hdiff.ne',hk.ne',hd.ne']44 unfold D N; ring45 · exact div_pos (mul_pos (mul_pos ht hp) (sub_pos.mpr hb1)) (mul_pos hb hdiff)4647/-- (A28) at a proposed first zero of the parameter derivative. -/48theorem investment_variation_bound {p b k x z v : ℝ}49 (hp : 0 < p) (hb : b < 1) (hk : 0 < k) (hx : 0 < x) (hz : p*x ≤ z) (hv : p < v) :50 0 < 2*k*(3-2*b)*p*x ∧ 2*k*(3-2*b)*p*x <51 (1+2*k*(1-b))*z-2*p*x+(1+2*k*(2-b))*x*v := by52 have h1 : 0 < 1+2*k*(1-b) := by nlinarith [mul_pos hk (sub_pos.mpr hb)]53 have h2 : 0 < 1+2*k*(2-b) := by nlinarith [mul_pos hk (show 0 < 2-b by linarith)]54 constructor55 · have h3 : 0 < 3-2*b := by linarith56 positivity57 · nlinarith only [mul_le_mul_of_nonneg_left hz h1.le,mul_lt_mul_of_pos_left hv (mul_pos h2 hx)]5859/-- Proposition 5 under the paper's CDF/density assumptions. Interior60differentiability and interval integrability allow unbounded endpoint densities.61The measure's conditional second moment is its normalized density integral. -/62theorem proposition5 {G g : ℝ → ℝ} {p q b k K : ℝ}63 (cG : Continuous G) (G0 : G 0=0) (G1 : G 1=1) (mono : MonotoneOn G (Icc (0:ℝ) 1))64 (posG : ∀ x ∈ Ioo (0:ℝ) 1, 0 < G x) (posg : ∀ x ∈ Ioo (0:ℝ) 1, 0 < g x)65 (dG : ∀ x ∈ Ioo (0:ℝ) 1, HasDerivAt G (g x) x)66 (hg : ∀ t ∈ Ioc (0:ℝ) 1, IntervalIntegrable g volume 0 t)67 (lc : ConcaveOn ℝ (Ioo (0:ℝ) 1) (fun x => Real.log (G x)))68 (hq : 0 < q) (hpq : q < p) (hu : p < 2*q) (hb : 0 < b) (hb1 : b < 1)69 (hk : 0 < k) (hK : 0 < K) (cost : K < D p q b/4*(1-(∫ x in (0:ℝ)..1,x^2*g x))) :70 ∃ t ∈ Ioo (0:ℝ) 1,71 (∀ x ∈ Ioo (0:ℝ) 1,72 (D p q b*(x^2-(∫ y in (0:ℝ)..x,y^2*g y)/G x)=4*K ↔ x=t)) ∧73 (∃ e w, Path p q b k t e w ∧ Incentives p q b k t e) ∧74 (let probG := fun r => 1-G (Function.invFunOn (Distribution.gap G) (Icc 0 1) (4*K/D r q b))75 let v := deriv probG p76 (v<0 ↔ p/(2*p-q)<b) ∧ (v=0 ↔ b=p/(2*p-q)) ∧ (0<v ↔ b<p/(2*p-q))) := by77 have hd := D_pos hq hpq.le hu hb1.le78 have pg (x : ℝ) (hx : x ∈ Ioc (0:ℝ) 1) : 0 < G x := by79 rcases eq_or_lt_of_le hx.2 with he|he80 · rw [he,G1]; norm_num81 · exact posG _ ⟨hx.1,he⟩82 have cg := Distribution.gap_cont cG mono G0 pg83 have gd (x : ℝ) (hx : x ∈ Ioo (0:ℝ) 1) := Distribution.gap_deriv_pos cG posG dG lc hx (hg _ (Ioo_subset_Ioc_self hx))84 have mom (x : ℝ) (hx : x ∈ Ioc (0:ℝ) 1) := Distribution.gap_moment cG hx.1 (pg x hx) (hg x hx)85 (fun y hy => dG y ⟨hy.1,hy.2.trans_le hx.2⟩)86 have top := mom 1 ⟨zero_lt_one,le_rfl⟩87 simp only [G1,one_pow,div_one] at top88 obtain ⟨t,ht,huniq⟩ := Distribution.threshold_unique hd hK (by rw [← top]; linarith) cg gd89 obtain ⟨e,w,he⟩ := path_exists hq hpq hu hb hb1.le hk ht.190 refine ⟨t,ht.1,?_,⟨e,w,he,path_incentives he hq hpq hu hb hb1.le hk ht.1⟩,?_⟩91 · intro x hx; rw [mom _ (Ioo_subset_Ioc_self hx)]92 exact ⟨fun h => huniq _ ⟨hx,h⟩,fun h => h ▸ ht.2⟩93 · dsimp only94 have vpos := gd _ ht.195 have dif := differentiableAt_of_deriv_ne_zero vpos.ne'96 have hder := Distribution.proposition5_deriv hK hd (posg _ ht.1) vpos ht.1 ht.297 (strictMonoOn_of_deriv_pos (convex_Icc _ _) cg (by simpa using gd)) cg dif.hasDerivAt (dG _ ht.1)98 rw [hder.deriv]99 let coef := 8*K*g t/(deriv (Distribution.gap G) t*(D p q b)^2)100 have coeff : 0 < coef := by have := posg _ ht.1; dsimp [coef]; positivity101 have eq : 8*K*g t*N p q b/(deriv (Distribution.gap G) t*(D p q b)^2)=coef*N p q b := by dsimp [coef]; ring102 have hn : coef*N p q b<0 ↔ N p q b<0 := by103 constructor104 · intro h; by_contra! hn; exact (not_lt_of_ge (mul_nonneg coeff.le hn)) h105 · exact mul_neg_of_pos_of_neg coeff106 have hpos : 0 < 2*p-q := by linarith107 rw [eq,hn,mul_pos_iff_of_pos_left coeff]108 simp only [mul_eq_zero,coeff.ne',false_or,N,div_lt_iff₀ hpos,eq_div_iff hpos.ne',lt_div_iff₀ hpos]109 constructor110 · constructor <;> intro h <;> linarith111 · constructor <;> constructor <;> intro h <;> linarith112113/-- Appendix C: marginal indifference uniquely determines (C1) among114positive threshold candidates, and the gain changes sign there. -/115theorem variable_threshold_unique {a K d u : ℝ} (ha : 0 < a) (hd : 0 < d) (hu : 0 < u) :116 variableGain a K d u u=0 ↔ u=C a K/d := by117 unfold variableGain C118 have ha' : 0 < a+2 := by linarith119 rw [eq_div_iff hd.ne']120 constructor121 · intro h; field_simp [ha'.ne'] at h122 apply mul_left_cancel₀ hu.ne'; nlinarith only [h]123 · intro h; field_simp [ha'.ne']; nlinarith only [congrArg (fun w : ℝ => u*w) h]124/-- Normalized conditional second moment computed using the actual power density. -/125theorem second_moment_density {a t : ℝ} (ha : 0 < a) (ht : 0 < t) :126 (∫ x in (0:ℝ)..t,x^2*(a*x^(a-1)))/(∫ x in (0:ℝ)..t,a*x^(a-1)) = a*t^2/(a+2) := by127 have den : (∫ x in (0:ℝ)..t,a*x^(a-1))=t^a := by128 rw [intervalIntegral.integral_const_mul,integral_rpow (Or.inl (show -1 < a-1 by linarith))]129 rw [sub_add_cancel,Real.zero_rpow ha.ne',sub_zero]; field_simp130 have num : (∫ x in (0:ℝ)..t,x^2*(a*x^(a-1)))=∫ x in (0:ℝ)..t,a*x^(a+1) := by131 apply intervalIntegral.integral_congr132 intro x hx133 have hx' := (uIcc_of_le ht.le ▸ hx).1134 rcases eq_or_lt_of_le hx' with he|he135 · subst x; simp [Real.zero_rpow (show a+1≠0 by linarith)]136 · change x^2*(a*x^(a-1))=a*x^(a+1)137 rw [Real.rpow_sub_one he.ne',Real.rpow_add he,Real.rpow_one]; field_simp; ring138 rw [den,num,power_second_moment ha ht]139140/-- The scalar equilibrium cost bound in Appendix C and the sign of its141comparative static use precisely the same coefficient as Proposition 1. -/142theorem proposition6 {a K p q b : ℝ} (ha : 0 < a) (hK : 0 < K)143 (cost : K<D p q b/(2*(a+2))) (hq : 0 < q) (hpq : q < p)144 (hu : p<2*q) (hb : b ≤ 1) :145 let t := C a K/D p q b146 t ∈ Ioo 0 1 ∧ (∀ s : ℝ, 0<s → (variableGain a K (D p q b) s s=0 ↔ s=t)) ∧147 (∀ x ∈ Icc (0:ℝ) 1, (variableGain a K (D p q b) t x < 0 ↔ x<t) ∧148 (variableGain a K (D p q b) t x=0 ↔ x=t) ∧ (0<variableGain a K (D p q b) t x ↔ t<x)) ∧149 (deriv (fun r => issue a (C a K/D r q b)) p < 0 ↔ p/(2*p-q)<b) := by150 have hc : 0 < C a K := by unfold C; positivity151 have cd : C a K < D p q b := by unfold C; linarith [(lt_div_iff₀ (show 0<2*(a+2) by positivity)).1 cost]152 have hd := D_pos hq hpq.le hu hb153 exact ⟨⟨div_pos hc hd,(div_lt_one hd).2 cd⟩,fun s hs => variable_threshold_unique ha hd hs,154 fun x hx => (proposition6_choice ha hK cd hx.1).2,proposition6_deriv ha hc hq hpq hu hb⟩155156theorem earnings_issuance_comparison {a s u : ℝ} (ha : 0<a) (hu : 0<u) (hus : u<s) :157 issue a (Real.sqrt s) < issue a (Real.sqrt u) := by158 unfold issue159 exact sub_lt_sub_left (Real.rpow_lt_rpow (Real.sqrt_nonneg _) (Real.sqrt_lt_sqrt hu.le hus) ha) 1160161/-- Proposition 4 in the economic belief domain, with the issuance probability.162The root s is squared project quality. Its signs encode the optimal decision163at each type, with indifference assigned to issuance. -/164theorem proposition4_issuance {a K k : ℝ} (ha : 0<a) (hK : 0<K)165 (cost : K<1/(2*(a+2))) (hk : 0<k) :166 ∃ δ > (0:ℝ), ∀ q ∈ Ioo (1-δ) 1,167 (∀ p ∈ Ioo q 1, ∃ s ∈ Ioo (0:ℝ) 1, Earnings.H a K k p q s s=0 ∧168 (∀ u ∈ Icc (0:ℝ) 1, Earnings.H a K k p q u u=0 → u=s) ∧169 (∀ x ∈ Icc (0:ℝ) 1, (Earnings.H a K k p q s x < 0 ↔ x<s) ∧170 (0<Earnings.H a K k p q s x ↔ s<x))) ∧171 (∀ p ∈ Ioo q 1, ∀ r ∈ Ioo p 1, ∀ s ∈ Ioo (0:ℝ) 1, ∀ u ∈ Ioo (0:ℝ) 1,172 Earnings.H a K k p q s s=0 → Earnings.H a K k r q u u=0 →173 issue a (Real.sqrt s) < issue a (Real.sqrt u)) := by174 obtain ⟨δ,hδ,roots,pairs⟩ := Earnings.proposition4 ha hK cost hk175 refine ⟨δ,hδ,?_⟩176 intro q hq177 have near (x : ℝ) (lo : 1-δ<x) (hi : x<1) : |x-1|<δ := by178 rw [abs_of_neg (sub_neg.mpr hi)]; linarith179 have nq := near q hq.1 hq.2180 constructor181 · intro p hp; exact roots p q (near p (hq.1.trans hp.1) hp.2) nq182 · intro p hp r hr s hs u hu hps hru183 have np := near p (hq.1.trans hp.1) hp.2184 have nr := near r ((hq.1.trans hp.1).trans hr.1) hr.2185 exact earnings_issuance_comparison ha hu.1186 (pairs p r q s u np nr nq hr.1 (Ioo_subset_Icc_self hs) (Ioo_subset_Icc_self hu) hps hru)187188/-- Corollary 2 is also consistent with the moving beta cutoff in Proposition 1. -/189theorem sophistication_cutoff_deriv {p q : ℝ} (hq : 0<q) (hpq : q<p) :190 HasDerivAt (fun r : ℝ => r/(2*r-q)) (-q/(2*p-q)^2) p ∧ -q/(2*p-q)^2<0 := by191 have he : 0 < 2*p-q := by linarith192 constructor193 · convert (hasDerivAt_id p).div (((hasDerivAt_id p).const_mul 2).sub_const q) he.ne' using 1194 dsimp only [id_eq]; ring195 · exact div_neg_of_neg_of_pos (neg_neg_of_pos hq) (sq_pos_of_pos he)196end QuietInvestment
Necessity.lean
Back to results1import Construction2noncomputable section3open Set Filter4open scoped Topology5namespace QuietInvestment6/-- Arbitrary separating threshold equilibrium, expressed in deviations from7the payoff of silence. S is the gross price required to cover both issuance8costs. D1 is needed only where the indifference-price minimizer is unique. -/9structure Separating (m p k S t : ℝ) (F U : ℝ → ℝ) : Prop where10 nonnegative : ∀ x ∈ Icc t 1, 0 ≤ F x11 distinct : InjOn F (Icc t 1)12 silent : ∀ x ∈ Ico 0 t, U x=013 participating : ∀ x ∈ Icc t 1, 0 ≤ U x14 realized : ∀ x ∈ Icc t 1, U x = value m p k x (F x)-S-lossWeight k*(F x-p*x)^215 imitation : ∀ x ∈ Icc (0:ℝ) 1, ∀ y ∈ Icc t 1,16 value m p k y (F y)-S-lossWeight k*(F y-p*x)^2 ≤ U x17 d1 : ∀ f, 0 ≤ f → f ∉ F '' Icc t 1 → ∀ y ∈ Icc (0:ℝ) 1,18 (∀ x ∈ Icc (0:ℝ) 1, x ≠ y → required (lossWeight k) p U y f < required (lossWeight k) p U x f) →19 value m p k y f-S ≤ required (lossWeight k) p U y f2021theorem ordering_of_equilibrium {m p k S t : ℝ} {F U : ℝ → ℝ} (h : Separating m p k S t F U)22 (hp : 0 < p) (hk : 0 < k) (ht : t ∈ Ioo 0 1) : StrictMonoOn F (Icc t 1) := by23 have sub : Icc t 1 ⊆ Icc (0:ℝ) 1 := Icc_subset_Icc_left ht.1.le24 intro x hx y hy hxy25 apply forecast_ordering (a := p*x) (b := p*y) (w := lossWeight k) (va := value m p k x (F x)-S)26 (vb := value m p k y (F y)-S) (div_pos hk (by linarith)) (mul_lt_mul_of_pos_left hxy hp)27 (fun he => hxy.ne (h.distinct hx hy he))28 · rw [← h.realized x hx]; exact h.imitation x (sub hx) y hy29 · rw [← h.realized y hy]; exact h.imitation y (sub hy) x hx3031/-- Lemma 1(ii), including the marginal indifference argument. -/32theorem marginal_of_equilibrium {m p k S t : ℝ} {F U : ℝ → ℝ}33 (h : Separating m p k S t F U) (hp : 0 < p) (hk : 0 < k) (hm : m ≤ p)34 (ht : t ∈ Ioo 0 1) : U t=0 ∧ F t=p*t := by35 have ht' : t ∈ Icc t 1 := ⟨le_rfl,ht.2.le⟩36 have t01 := Ioo_subset_Icc_self ht37 have hw : 0 < lossWeight k := div_pos hk (by linarith)38 have hval := h.realized t ht'39 have hzero : U t = 0 := by40 apply le_antisymm _ (h.participating t ht')41 rw [hval]42 have hc : Continuous (fun x => value m p k t (F t)-S-lossWeight k*(F t-p*x)^2) := by fun_prop43 apply le_of_tendsto (hc.continuousAt.tendsto.mono_left (nhdsWithin_le_nhds (s := Iio t)))44 filter_upwards [Ioo_mem_nhdsLT ht.1] with x hx45 exact (h.imitation x ⟨hx.1.le,hx.2.le.trans ht.2.le⟩ t ht').trans_eq (h.silent x ⟨hx.1.le,hx.2⟩)46 refine ⟨hzero,?_⟩47 have hlow : p*t ≤ F t := by48 apply le_of_not_gt; intro hbad49 have hy : F t/p ∈ Ico (0:ℝ) t := ⟨div_nonneg (h.nonnegative t ht') hp.le,(div_lt_iff₀ hp).2 (by linarith)⟩50 have H := h.imitation (F t/p) ⟨hy.1,hy.2.le.trans ht.2.le⟩ t ht'51 rw [h.silent _ hy, mul_div_cancel₀ _ hp.ne',sub_self,zero_pow (by decide : 2≠0),mul_zero,sub_zero] at H52 nlinarith only [H,hval,hzero,mul_pos hw (sq_pos_of_ne_zero (sub_ne_zero.mpr hbad.ne))]53 apply le_antisymm _ hlow54 apply le_of_not_gt; intro hhigh55 let f := (F t+p*t)/256 have hflo : p*t<f := by dsimp [f]; linarith57 have hfhi : f<F t := by dsimp [f]; linarith58 have hf0 := (mul_pos hp ht.1).trans hflo59 have hsep := ordering_of_equilibrium h hp hk ht60 have hout : f ∉ F '' Icc t 1 := by61 rintro ⟨x,hx,he⟩; linarith [hsep.monotoneOn ht' hx hx.1]62 have minimize (x : ℝ) (hx : x ∈ Icc (0:ℝ) 1) (hn : x ≠ t) :63 required (lossWeight k) p U t f < required (lossWeight k) p U x f := by64 unfold required; rw [hzero,zero_add]65 rcases lt_or_gt_of_ne hn with hl|hl66 · rw [h.silent _ ⟨hx.1,hl⟩,zero_add]; apply mul_lt_mul_of_pos_left _ hw67 exact sq_lt_sq' (by linarith [mul_lt_mul_of_pos_left hl hp]) (by linarith [mul_lt_mul_of_pos_left hl hp])68 · have hh := h.imitation x hx t ht'69 nlinarith only [hh,hval,hzero,mul_pos (mul_pos (mul_pos hw hp) (sub_pos.mpr hl)) (sub_pos.mpr hfhi)]70 have forbid := h.d1 f hf0.le hout t t01 minimize71 have hd : 0 < 1+2*k := by linarith72 have zL : p*t < investment p k t f := by73 unfold investment; rw [lt_div_iff₀ hd]; nlinarith [mul_pos hk (sub_pos.mpr hflo)]74 have zH : investment p k t f < investment p k t (F t) := by75 unfold investment; apply div_lt_div_of_pos_right _ hd; nlinarith [mul_pos hk (sub_pos.mpr hfhi)]76 have inc : value m p k t (F t) < value m p k t f := by77 unfold value78 have hm' := mul_le_mul_of_nonneg_right hm ht.1.le79 nlinarith only [mul_pos (sub_pos.mpr zH) (show 0 < investment p k t f+investment p k t (F t)-2*m*t by linarith)]80 unfold required at forbid; rw [hzero,zero_add] at forbid81 nlinarith only [inc,forbid,hzero,hval,mul_pos (mul_pos hw (sub_pos.mpr hfhi))82 (show 0 < F t+f-2*p*t by linarith)]8384/-- Cross-type IC expressed as the gain relative to an issuer's own payoff.85This is the finite-difference envelope inequality; no differentiability of86an arbitrary equilibrium is assumed. -/87def Envelope (w p t : ℝ) (F U : ℝ → ℝ) : Prop :=88 ∀ x ∈ Icc t 1, ∀ y ∈ Icc t 1, U x + w*p*(y-x)*(2*F x-p*(y+x)) ≤ U y8990theorem envelope_of_equilibrium {m p k S t : ℝ} {F U : ℝ → ℝ} (h : Separating m p k S t F U)91 (ht : 0 ≤ t) : Envelope (lossWeight k) p t F U := by92 intro x hx y hy93 have hi := h.imitation y ⟨ht.trans hy.1,hy.2⟩ x hx94 rw [h.realized x hx]; nlinarith only [hi]9596private theorem envelope_cont {w p t : ℝ} {F U : ℝ → ℝ} (h : Envelope w p t F U)97 (hp : 0 < p) (hw : 0 < w) (ht : t ∈ Ioo 0 1) (hm : MonotoneOn F (Icc t 1))98 (hn : ∀ x ∈ Icc t 1, 0 ≤ F x) : ContinuousOn U (Icc t 1) := by99 let L := w*p*(2*F 1+2*p)100 have htop := hn 1 ⟨ht.2.le,le_rfl⟩101 have hL : 0 ≤ L := by dsimp [L]; positivity102 apply LipschitzOnWith.continuousOn (K := ⟨L,hL⟩)103 apply LipschitzOnWith.of_dist_le_mul104 intro x hx y hy105 simp only [Real.dist_eq,NNReal.coe_mk]106 have bound (s : ℝ) (hs : s ∈ Icc t 1) : |2*F s-p*(x+y)| ≤ 2*F 1+2*p := by107 rw [abs_le]; constructor <;> nlinarith [hn s hs, hm hs (show 1 ∈ Icc t 1 from ⟨ht.2.le,le_rfl⟩) hs.2,108 mul_nonneg hp.le (add_nonneg (ht.1.le.trans hx.1) (ht.1.le.trans hy.1)),109 mul_nonneg hp.le (sub_nonneg.mpr hx.2),mul_nonneg hp.le (sub_nonneg.mpr hy.2)]110 have bnd (s : ℝ) (hs : s ∈ Icc t 1) :111 |w*p*(x-y)*(2*F s-p*(x+y))| ≤ L*|x-y| := by112 rw [abs_mul,abs_mul,abs_of_nonneg (mul_pos hw hp).le]113 dsimp [L]; calc114 _ ≤ w*p*|x-y| *(2*F 1+2*p) := mul_le_mul_of_nonneg_left (bound s hs) (by positivity)115 _ = _ := by ring116 have hlo := h y hy x hx117 have hhi := h x hx y hy118 rw [abs_le]119 constructor120 · linarith [neg_abs_le (w*p*(x-y)*(2*F y-p*(x+y))),bnd y hy]121 · nlinarith only [hhi,le_abs_self (w*p*(x-y)*(2*F x-p*(x+y))),bnd x hx]122123private theorem envelope_right {w p t a b x : ℝ} {F U : ℝ → ℝ} (h : Envelope w p t F U)124 (hsub : Icc a b ⊆ Icc t 1) (hx : x ∈ Ico a b) (hc : ContinuousOn F (Icc a b)) :125 HasDerivWithinAt U (2*w*p*(F x-p*x)) (Ici x) x := by126 apply HasDerivWithinAt.Ici_of_Ioi127 apply (hasDerivWithinAt_iff_tendsto_slope' (show x ∉ Ioi x by simp)).2128 have hmem : Icc a b ∈ 𝓝[>] x := Icc_mem_nhdsGT_of_mem hx129 have cF : Tendsto F (𝓝[>] x) (𝓝 (F x)) :=130 (hc x (Ico_subset_Icc_self hx)).mono_left (nhdsWithin_le_of_mem hmem)131 have ci : Tendsto (fun y : ℝ => y) (𝓝[>] x) (𝓝 x) := nhdsWithin_le_nhds132 have h₁ := tendsto_const_nhds (x := w*p) (f := 𝓝[>] x) |>.mul133 (tendsto_const_nhds (x := 2*F x) |>.sub (tendsto_const_nhds (x := p) |>.mul (ci.add_const x)))134 have h₂ := tendsto_const_nhds (x := w*p) (f := 𝓝[>] x) |>.mul135 ((cF.const_mul 2).sub (tendsto_const_nhds (x := p) |>.mul (ci.add_const x)))136 have hh : w*p*(2*F x-p*(x+x))=2*w*p*(F x-p*x) := by ring137 rw [← hh]138 apply tendsto_of_tendsto_of_tendsto_of_le_of_le' h₁ h₂139 · filter_upwards [hmem,self_mem_nhdsWithin] with y hy hyx140 rw [slope_def_field,le_div_iff₀ (sub_pos.mpr hyx)]141 nlinarith only [h x (hsub (Ico_subset_Icc_self hx)) y (hsub hy)]142 · filter_upwards [hmem,self_mem_nhdsWithin] with y hy hyx143 rw [slope_def_field,div_le_iff₀ (sub_pos.mpr hyx)]144 nlinarith only [h y (hsub hy) x (hsub (Ico_subset_Icc_self hx))]145146private def vertex (p q b k : ℝ) := p-b*(p-q)*(1+2*k)/(1+4*k)147private def curvature (k : ℝ) := k*(1+4*k)/(1+2*k)^2148private def own (m p k S x f : ℝ) := value m p k x f-S-lossWeight k*(f-p*x)^2149150/-- Completing the square in the *forecast*, with market inference fixed. -/151private theorem own_square {k : ℝ} (hk : 0 < k) (p q b S x f : ℝ) :152 own (p-b*(p-q)) p k S x f =153 own (p-b*(p-q)) p k S x (vertex p q b k*x) -154 curvature k*(f-vertex p q b k*x)^2 := by155 unfold own value vertex curvature investment lossWeight156 field_simp [show 1+2*k ≠ 0 by linarith,show 1+4*k ≠ 0 by linarith]; ring157158/-- On any interval on which both forecasts are above the payoff parabola's159vertex, common initial payoffs imply identical forecasts throughout. The160squared payoff difference has nonpositive right derivative by IC. -/161private theorem local_identification {p q b k S t a d : ℝ} {F G U V : ℝ → ℝ}162 (hp : 0 < p) (hk : 0 < k) (_hab : a ≤ d) (sub : Icc a d ⊆ Icc t 1)163 (eu : Envelope (lossWeight k) p t F U) (ev : Envelope (lossWeight k) p t G V)164 (cu : ContinuousOn U (Icc a d)) (cv : ContinuousOn V (Icc a d))165 (fu : ∀ x ∈ Icc a d, U x = own (p-b*(p-q)) p k S x (F x))166 (gv : ∀ x ∈ Icc a d, V x = own (p-b*(p-q)) p k S x (G x))167 (above : ∀ x ∈ Icc a d, vertex p q b k*x ≤ F x ∧ vertex p q b k*x ≤ G x)168 (init : U a=V a) : EqOn F G (Icc a d) := by169 let l := vertex p q b k170 let J := curvature k171 have hJ : 0 < J := by dsimp [J,curvature]; positivity172 let A := fun x => own (p-b*(p-q)) p k S x (l*x)173 have cA : Continuous A := by unfold A own value investment; fun_prop174 have sqF (x : ℝ) (hx : x ∈ Icc a d) : U x=A x-J*(F x-l*x)^2 := (fu x hx).trans (own_square hk ..)175 have sqG (x : ℝ) (hx : x ∈ Icc a d) : V x=A x-J*(G x-l*x)^2 := (gv x hx).trans (own_square hk ..)176 have recover {W f : ℝ → ℝ} (hw : ContinuousOn W (Icc a d))177 (sq : ∀ x ∈ Icc a d, W x=A x-J*(f x-l*x)^2)178 (ha : ∀ x ∈ Icc a d, l*x ≤ f x) : ContinuousOn f (Icc a d) := by179 apply (show ContinuousOn (fun x => l*x+Real.sqrt ((A x-W x)/J)) (Icc a d) by fun_prop).congr180 intro x hx181 have he : (A x-W x)/J=(f x-l*x)^2 := (div_eq_iff hJ.ne').2 (by nlinarith only [sq x hx])182 dsimp only; rw [he,Real.sqrt_sq (sub_nonneg.mpr (ha x hx))]; ring183 have cf := recover cu sqF (fun x hx => (above x hx).1)184 have cg := recover cv sqG (fun x hx => (above x hx).2)185 have hw : 0 < lossWeight k := div_pos hk (by linarith)186 let dv := fun x => 2*(U x - V x)*(2*lossWeight k*p*(F x-p*x)-2*lossWeight k*p*(G x-p*x))187 have dec (x : ℝ) (hx : x ∈ Ico a d) : dv x ≤ 0 := by188 have hx' := Ico_subset_Icc_self hx189 have hsg : 0 ≤ F x+G x-2*l*x := by have hh := above x hx'; linarith [hh.1,hh.2]190 have ident : dv x = -4*lossWeight k*p*J*(F x-G x)^2*(F x+G x-2*l*x) := by191 dsimp [dv]; rw [sqF x hx',sqG x hx']; ring192 rw [ident]; apply mul_nonpos_of_nonpos_of_nonneg _ hsg193 apply mul_nonpos_of_nonpos_of_nonneg _ (sq_nonneg _)194 nlinarith only [mul_pos (mul_pos hw hp) hJ]195 have hdv (x : ℝ) (hx : x ∈ Ico a d) :196 HasDerivWithinAt (fun y => (U y-V y)^2) (dv x) (Ici x) x := by197 convert ((envelope_right eu sub hx cf).sub (envelope_right ev sub hx cg)).pow 2 using 1198 dsimp [dv]; ring199 have nonpos := image_le_of_deriv_right_le_deriv_boundary (f := fun x => (U x-V x)^2)200 (f' := dv) (B := fun _ => (0:ℝ)) (B' := fun _ => 0) ((cu.sub cv).pow 2) hdv201 (by simp [init]) continuousOn_const (fun x _ => (hasDerivAt_const x (0:ℝ)).hasDerivWithinAt) dec202 intro x hx; have hz := nonpos hx203 have heq : U x=V x := by nlinarith only [hz,sq_nonneg (U x-V x)]204 have same : (F x-l*x)^2=(G x-l*x)^2 := by205 apply mul_left_cancel₀ hJ.ne'; linarith only [sqF x hx,sqG x hx,heq]206 have eqabs := (sq_eq_sq_iff_abs_eq_abs _ _).mp same207 rw [abs_of_nonneg (sub_nonneg.mpr (above x hx).1),abs_of_nonneg (sub_nonneg.mpr (above x hx).2)] at eqabs208 linarith209210/-- Lemma 1 for *any* separating threshold equilibrium. IC provides the211envelope, D1 fixes the marginal forecast, and forward identification recovers212the increasing schedule constructed from (A16). No differentiability of the213input equilibrium strategy is assumed. -/214theorem lemma1 {p q b k S t : ℝ} {F U : ℝ → ℝ}215 (h : Separating (p-b*(p-q)) p k S t F U)216 (hq : 0 < q) (hpq : q < p) (hu : p < 2*q) (hb : 0 < b) (hb1 : b ≤ 1)217 (hk : 0 < k) (ht : t ∈ Ioo 0 1) :218 StrictMonoOn F (Icc t 1) ∧ F t=p*t ∧ investment p k t (F t)=p*t ∧219 StrictMonoOn (fun x => F x-investment p k x (F x)) (Icc t 1) ∧220 (∀ x ∈ Ioc t 1, 0 < F x-investment p k x (F x)) := by221 have hp := hq.trans hpq222 have hdiff := sub_pos.mpr hpq223 have hw : 0 < lossWeight k := div_pos hk (by linarith)224 have tm : t ∈ Icc t 1 := ⟨le_rfl,ht.2.le⟩225 have sep := ordering_of_equilibrium h hp hk ht226 obtain ⟨hUt,hFt⟩ := marginal_of_equilibrium h hp hk227 (by linarith [mul_nonneg hb.le hdiff.le]) ht228 obtain ⟨e,w,path⟩ := path_exists hq hpq hu hb hb1 hk ht229 have inc := path_incentives path hq hpq hu hb hb1 hk ht230 let G := forecast p k e231 let V := selfGain p q b k t e232 have vform (x : ℝ) (_hx : x ∈ Icc t 1) : V x = own (p-b*(p-q)) p k S x (G x) := by233 have hh := h.realized t tm234 rw [hUt,hFt,price_accurate hk,sub_self] at hh235 have hS : S=accurateValue p q b t := by nlinarith236 dsimp [V,G,selfGain,own]; rw [← path_realizes_price hk,hS]237 have eu := envelope_of_equilibrium h ht.1.le238 have ev : Envelope (lossWeight k) p t G V := by239 intro x hx y hy240 have cmp := inc.onPath y ⟨ht.1.le.trans hy.1,hy.2⟩ x hx241 rw [gain,if_neg (not_lt_of_ge hy.1)] at cmp242 dsimp [V,G,selfGain] at *; nlinarith only [cmp]243 have cu := envelope_cont eu hp hw ht sep.monotoneOn h.nonnegative244 have cv : ContinuousOn V (Icc t 1) := fun x hx => (self_deriv path hk hx).continuousWithinAt245 let l := vertex p q b k246 have hlp : l < p := by247 unfold l vertex; exact sub_lt_self _ (by positivity)248 have hl : 0 < l := by249 unfold l vertex; rw [sub_pos,div_lt_iff₀ (show 0 < 1+4*k by positivity)]250 have hbnd := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right hb1 hdiff.le)251 (show 0 ≤ 1+2*k by positivity)252 nlinarith [mul_pos hk hp,mul_pos hk hq]253 let δ := (p-l)*t/l254 have ht0 := ht.1255 have hδ : 0 < δ := div_pos (mul_pos (sub_pos.mpr hlp) ht0) hl256 have hδeq : δ*l=(p-l)*t := by dsimp [δ]; field_simp257 have ghigh (x : ℝ) (hx : x ∈ Icc t 1) : p*x ≤ G x := by258 dsimp [G,forecast]259 exact le_add_of_nonneg_right (mul_nonneg (by positivity) (path.positive x hx).1)260 have idn (n : ℕ) : ∀ x ∈ Icc t 1, x ≤ t+n*δ → F x=G x := by261 induction n with262 | zero =>263 intro x hx hx'; simp only [Nat.cast_zero,zero_mul,add_zero] at hx'264 have he := le_antisymm hx' hx.1; rw [he,hFt]; exact inc.marginal.symm265 | succ n ih =>266 intro x hx hbound267 let a := t+(n:ℝ)*δ268 by_cases hxa : x ≤ a269 · exact ih x hx hxa270 have hax := lt_of_not_ge hxa271 have hta : t ≤ a := le_add_of_nonneg_right (by positivity)272 have ha : a ∈ Icc t 1 := ⟨hta,hax.le.trans hx.2⟩273 have sub : Icc a x ⊆ Icc t 1 := Icc_subset_Icc hta hx.2274 have heqa := ih a ha le_rfl275 have init : U a=V a := by rw [h.realized a ha,vform a ha,heqa]; rfl276 have hlen : x ≤ a+δ := by dsimp [a]; push_cast at hbound; nlinarith277 have both (y : ℝ) (hy : y ∈ Icc a x) : l*y ≤ F y ∧ l*y ≤ G y := by278 have hly : l*y ≤ p*a := by279 nlinarith only [mul_nonneg (sub_nonneg.mpr hlp.le) (sub_nonneg.mpr hta),280 mul_le_mul_of_nonneg_left (hy.2.trans hlen) hl.le,hδeq]281 have g0 := ghigh a ha282 exact ⟨hly.trans ((g0.trans_eq heqa.symm).trans (sep.monotoneOn ha (sub hy) hy.1)),283 (mul_le_mul_of_nonneg_right hlp.le (ht.1.le.trans (sub hy).1)).trans (ghigh _ (sub hy))⟩284 exact local_identification hp hk hax.le sub eu ev (cu.mono sub) (cv.mono sub)285 (fun y hy => h.realized y (sub hy)) (fun y hy => vform y (sub hy)) both init ⟨hax.le,le_rfl⟩286 obtain ⟨n,hn⟩ := exists_nat_ge ((1-t)/δ)287 have bound : 1 ≤ t+(n:ℝ)*δ := by linarith [(div_le_iff₀ hδ).mp hn]288 have err (x : ℝ) (hx : x ∈ Icc t 1) : F x-investment p k x (F x)=e x := by289 rw [idn n x hx (hx.2.trans bound)]; unfold G forecast investment290 field_simp [show 1+2*k ≠ 0 by linarith]; ring291 have et := err t tm292 refine ⟨sep,hFt,by linarith [path.marginal],?_,?_⟩293 · intro x hx y hy hxy; dsimp only; rw [err x hx,err y hy]; exact path.mono hx hy hxy294 · intro x hx; rw [err x (Ioc_subset_Icc_self hx),← path.marginal]; exact path.mono tm (Ioc_subset_Icc_self hx) hx.1295end QuietInvestment
ProofAudit.lean
Back to results1import Manuscript23/- Each line asks Lean to list the logical axioms in the transitive proof.4The root module imports every manuscript module through Manuscript. -/56#print axioms QuietInvestment.lemma17#print axioms QuietInvestment.optimal_investment8#print axioms QuietInvestment.optimized_payoff9#print axioms QuietInvestment.anchor_indifference10#print axioms QuietInvestment.lemma211#print axioms QuietInvestment.lemma312#print axioms QuietInvestment.lemma3_equilibrium13#print axioms QuietInvestment.corollary1_model14#print axioms QuietInvestment.corollary215#print axioms QuietInvestment.proposition116#print axioms QuietInvestment.proposition217#print axioms QuietInvestment.Investment.proposition318#print axioms QuietInvestment.proposition3_mean19#print axioms QuietInvestment.Earnings.proposition420#print axioms QuietInvestment.Earnings.cleared_gain21#print axioms QuietInvestment.Earnings.earnings_error22#print axioms QuietInvestment.Earnings.earnings_choice23#print axioms QuietInvestment.Earnings.forecast_earnings_deriv24#print axioms QuietInvestment.Earnings.earnings_forecast_order25#print axioms QuietInvestment.Earnings.cutoff_deriv_at_certainty26#print axioms QuietInvestment.proposition4_issuance27#print axioms QuietInvestment.earnings_issuance_comparison28#print axioms QuietInvestment.proposition529#print axioms QuietInvestment.proposition630#print axioms QuietInvestment.second_moment_density31#print axioms QuietInvestment.investment_boundary_partial32#print axioms QuietInvestment.investment_variation_bound33#print axioms QuietInvestment.sophistication_cutoff_deriv
QuietInvestment.lean
Back to results1import Mathlib.Analysis.SpecialFunctions.Pow.Deriv2import Mathlib.Analysis.SpecialFunctions.Sqrt3import Mathlib.Analysis.Calculus.Deriv.MeanValue4import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus5import Mathlib.Tactic.FieldSimp6import Mathlib.Tactic.Linarith7import Mathlib.Tactic.Positivity8import Mathlib.Tactic.Ring910/-! # Quiet Investment11Formal audit of the November 25, 2026 manuscript. All variables below are real.12Equation labels refer to the submission PDF. The hypotheses of each theorem13record any earlier economic or analytic result on which it depends. -/14noncomputable section15open Set Filter MeasureTheory16open scoped Topology Interval17namespace QuietInvestment1819/-- Productivity coefficient in (A19), (B2), and (C1). -/20def D (p q b : ℝ) := p * (p - 2*b*(p-q))21def N (p q b : ℝ) := p - b*(2*p-q)22def C (a K : ℝ) := 2*(a+2)*K23def cutoff (c d : ℝ) := Real.sqrt (c/d)24def issue (a t : ℝ) := 1 - t ^ a25def prob (a c p q b : ℝ) := issue a (cutoff c (D p q b))2627theorem D_pos {p q b : ℝ} (hq : 0 < q) (hpq : q ≤ p) (hu : p < 2*q)28 (hb : b ≤ 1) : 0 < D p q b := by29 unfold D30 apply mul_pos (lt_of_lt_of_le hq hpq)31 nlinarith [mul_nonneg (sub_nonneg.mpr hb) (sub_nonneg.mpr hpq)]3233theorem D_deriv_p (p q b : ℝ) :34 HasDerivAt (fun x => D x q b) (2*N p q b) p := by35 convert (hasDerivAt_id p).mul ((hasDerivAt_id p).sub36 (((hasDerivAt_id p).sub_const q).const_mul (2*b))) using 137 simp [D,N]; ring3839theorem D_deriv_b (p q b : ℝ) :40 HasDerivAt (D p q) (-2*p*(p-q)) b := by41 convert ((((hasDerivAt_id b).const_mul 2).mul_const (p-q)).const_sub p).const_mul p using 142 simp [D]; ring4344theorem cutoff_pos {c d : ℝ} (hc : 0 < c) (hd : 0 < d) : 0 < cutoff c d :=45 Real.sqrt_pos.2 (div_pos hc hd)4647theorem cutoff_sq {c d : ℝ} (hc : 0 < c) (hd : 0 < d) :48 (cutoff c d)^2 = c/d := Real.sq_sqrt (div_pos hc hd).le4950/-- Lemma 2, scalar equilibrium condition (A19), including existence,51interiority and uniqueness on the economically relevant domain. -/52theorem cutoff_unique {c d : ℝ} (hc : 0 < c) (hcost : c < d) :53 cutoff c d ∈ Ioo 0 1 ∧ ∀ t : ℝ, 0 ≤ t → (d*t^2 = c ↔ t = cutoff c d) := by54 have hd := hc.trans hcost55 have hs := cutoff_sq hc hd56 have ht := cutoff_pos hc hd57 have he : d * (cutoff c d)^2 = c := by rw [hs]; field_simp58 constructor59 · exact ⟨ht, by nlinarith [((div_lt_one hd).2 hcost), sq_nonneg (cutoff c d - 1)]⟩60 · intro t ht061 refine ⟨fun h => ?_, fun h => h ▸ he⟩62 have hh : t^2 = (cutoff c d)^2 := mul_left_cancel₀ hd.ne' (h.trans he.symm)63 simpa [abs_of_nonneg ht0,abs_of_pos ht] using (sq_eq_sq_iff_abs_eq_abs _ _).mp hh6465theorem cutoff_hasDeriv {f : ℝ → ℝ} {x v c : ℝ}66 (hf : HasDerivAt f v x) (hc : 0 < c) (hd : 0 < f x) :67 HasDerivAt (fun y => cutoff c (f y)) (-cutoff c (f x)*v/(2*f x)) x := by68 have h := ((hasDerivAt_const x c).div hf hd.ne').sqrt (div_pos hc hd).ne'69 have ht := cutoff_pos hc hd70 have hs := cutoff_sq hc hd71 change HasDerivAt (fun y => Real.sqrt (c / f y)) _ x72 convert h using 173 change -cutoff c (f x)*v/(2*f x) = _ / (2*cutoff c (f x))74 field_simp [hd.ne', ht.ne'] at hs ⊢75 nlinarith [congrArg (fun w : ℝ => w * v) hs]7677theorem issue_hasDeriv {f : ℝ → ℝ} {x v a : ℝ} (hf : HasDerivAt f v x)78 (ht : 0 < f x) :79 HasDerivAt (fun y => issue a (f y)) (-v*a*((f x)^a)/(f x)) x := by80 convert ((hf.rpow_const (p := a) (Or.inl ht.ne')).const_sub 1) using 181 rw [Real.rpow_sub_one ht.ne']; ring8283/-- (A24) obtained by differentiating the actual issuance probability. -/84theorem prob_deriv (a c p q b : ℝ) (hc : 0 < c) (hd : 0 < D p q b) :85 HasDerivAt (fun x => prob a c x q b)86 (a*(cutoff c (D p q b))^a*N p q b / D p q b) p := by87 have ht := cutoff_pos hc hd88 have h := issue_hasDeriv (a := a) (cutoff_hasDeriv (D_deriv_p p q b) hc hd) ht89 convert h using 190 field_simp [ht.ne',hd.ne']; ring9192private theorem divNeg {x d : ℝ} (h : 0 < d) : x/d < 0 ↔ x < 0 := by93 rw [div_lt_iff₀ h, zero_mul]94private theorem mulNegL {w x : ℝ} (h : 0 < w) : w*x < 0 ↔ x < 0 := by95 constructor96 · intro v; by_contra! hx; exact (not_lt_of_ge (mul_nonneg h.le hx)) v97 · exact mul_neg_of_pos_of_neg h98private theorem mulNegR {w x : ℝ} (h : 0 < w) : x*w < 0 ↔ x < 0 := by99 rw [mul_comm]; exact mulNegL h100101/-- Proposition 1. All three signs, including the equality case. -/102theorem proposition1 {a c p q b : ℝ} (ha : 0 < a) (hc : 0 < c)103 (hq : 0 < q) (hpq : q < p) (hu : p < 2*q) (hb : b ≤ 1) :104 let v := deriv (fun x => prob a c x q b) p105 (v < 0 ↔ p/(2*p-q) < b) ∧ (v = 0 ↔ b = p/(2*p-q)) ∧106 (0 < v ↔ b < p/(2*p-q)) := by107 dsimp only108 have hd := D_pos hq hpq.le hu hb109 have he : 0 < 2*p-q := by linarith110 have hpos := mul_pos ha (Real.rpow_pos_of_pos (cutoff_pos hc hd) a)111 rw [(prob_deriv a c p q b hc hd).deriv]112 simp only [divNeg hd, mulNegL hpos,113 div_eq_zero_iff, mul_eq_zero, hpos.ne', hd.ne', false_or, or_false,114 div_pos_iff_of_pos_right hd, mul_pos_iff_of_pos_left hpos, N,115 div_lt_iff₀ he, lt_div_iff₀ he, eq_div_iff he.ne']116 constructor117 · constructor <;> intro h <;> linarith118 · constructor <;> constructor <;> intro h <;> linarith119120/-- Compare two common priors in Lemma 3 (both move together). -/121theorem lemma3 {a c p r b : ℝ} (ha : 0 < a) (hc : 0 < c) (hp : 0 < p) (hr : p < r) :122 cutoff c (D r r b) < cutoff c (D p p b) ∧ prob a c p p b < prob a c r r b := by123 have hd : 0 < D p p b := by simp [D]; positivity124 have hh : D p p b < D r r b := by simp [D]; nlinarith [sq_nonneg (r-p)]125 have h := Real.sqrt_lt_sqrt (div_pos hc (hd.trans hh)).le (div_lt_div_of_pos_left hc hd hh)126 exact ⟨h, sub_lt_sub_left (Real.rpow_lt_rpow (cutoff_pos hc (hd.trans hh)).le h ha) 1⟩127128/-- Corollary 2. Actual mixed partial, with p held fixed in the outer derivative. -/129theorem corollary2 {a c p q b : ℝ} (ha : 0 < a) (hc : 0 < c)130 (hq : 0 < q) (hpq : q < p) (hu : p < 2*q) (hb : b ≤ 1)131 (hreg : p/(2*p-q) < b) :132 deriv (fun y => deriv (fun x => prob a c x q y) p) b < 0 := by133 have hd := D_pos hq hpq.le hu hb134 have ht := cutoff_pos hc hd135 have hp : 0 < p := hq.trans hpq136 have he : 0 < 2*p-q := by linarith137 have hn : N p q b < 0 := by unfold N; linarith [(div_lt_iff₀ he).1 hreg]138 have hd' := D_deriv_b p q b139 have ht' := cutoff_hasDeriv hd' hc hd140 have hpow := ht'.rpow_const (p := a) (Or.inl ht.ne')141 have hn' : HasDerivAt (N p q) (-(2*p-q)) b := by142 convert (((hasDerivAt_id b).mul_const (2*p-q)).const_sub p) using 1143 simp [N]144 have hw := (hpow.const_mul a).div hd' hd.ne'145 have hwpos : 0 < a*(cutoff c (D p q b))^a/D p q b := by positivity146 have hdneg : -2*p*(p-q) < 0 := by nlinarith [mul_pos hp (sub_pos.mpr hpq)]147 have htv : 0 < -cutoff c (D p q b)*(-2*p*(p-q))/(2*D p q b) :=148 div_pos (mul_pos_of_neg_of_neg (neg_neg_of_pos ht) hdneg) (by positivity)149 have hpowpos := Real.rpow_pos_of_pos ht (a-1)150 have hnum := Real.rpow_pos_of_pos ht a151 have hw' : 0 < (a*((-cutoff c (D p q b)*(-2*p*(p-q))/(2*D p q b))*a*152 (cutoff c (D p q b))^(a-1))*D p q b - a*(cutoff c (D p q b))^a*(-2*p*(p-q))) /153 (D p q b)^2 := by154 apply div_pos _ (sq_pos_of_pos hd)155 apply sub_pos.mpr156 exact (mul_nonpos_of_nonneg_of_nonpos (by positivity) hdneg.le).trans_lt (by positivity)157 have heq : (fun y => deriv (fun x => prob a c x q y) p) =ᶠ[𝓝 b]158 (fun y => a*(cutoff c (D p q y))^a / D p q y * N p q y) := by159 filter_upwards [hd'.continuousAt.eventually (lt_mem_nhds hd)] with y hy160 rw [(prob_deriv a c p q y hc hy).deriv]; ring161 rw [heq.deriv_eq]162 rw [(hw.mul hn').deriv]163 exact add_neg (mul_neg_of_pos_of_neg hw' hn) (mul_neg_of_pos_of_neg hwpos (neg_neg_of_pos he))164165/-- Appendix C (C2), grounded in the unique positive solution (C1). -/166def variableGain (a K d t x : ℝ) := d/2*(x^2 - a*t^2/(a+2)) - 2*K*x167168theorem variable_gain_factor {a K d : ℝ} (ha : 0 < a) (hd : 0 < d) (x : ℝ) :169 let t := C a K / d170 variableGain a K d t x = (x-t)*(d*x/2 + a*K) := by171 dsimp [variableGain,C]172 field_simp [hd.ne',show a+2 ≠ 0 by linarith]; ring173174theorem proposition6_choice {a K d : ℝ} (ha : 0 < a) (hK : 0 < K) (hcost : C a K < d)175 {x : ℝ} (hx : 0 ≤ x) :176 let t := C a K/d177 t ∈ Ioo 0 1 ∧ (variableGain a K d t x < 0 ↔ x < t) ∧178 (variableGain a K d t x = 0 ↔ x = t) ∧ (0 < variableGain a K d t x ↔ t < x) := by179 have hc : 0 < C a K := by unfold C; positivity180 have hd := hc.trans hcost181 have hf : 0 < d*x/2+a*K := add_pos_of_nonneg_of_pos (by positivity) (mul_pos ha hK)182 dsimp only183 rw [variable_gain_factor ha hd]184 simp [div_pos hc hd, (div_lt_one hd).2 hcost, hf, hf.ne', mulNegR hf,185 mul_pos_iff_of_pos_right hf, sub_eq_zero, sub_neg, sub_pos, Set.mem_Ioo]186187theorem proposition6_deriv {a c p q b : ℝ} (ha : 0 < a) (hc : 0 < c)188 (hq : 0 < q) (hpq : q < p) (hu : p < 2*q) (hb : b ≤ 1) :189 deriv (fun x => issue a (c/D x q b)) p < 0 ↔ p/(2*p-q) < b := by190 have hd := D_pos hq hpq.le hu hb191 have he : 0 < 2*p-q := by linarith192 have h := issue_hasDeriv (a := a)193 ((hasDerivAt_const p c).div (D_deriv_p p q b) hd.ne') (div_pos hc hd)194 rw [h.deriv, div_lt_iff₀ he]195 have hr := Real.rpow_pos_of_pos (div_pos hc hd) a196 have hfactor : 0 < 2*c*a*(c/D p q b)^a / ((D p q b)^2*(c/D p q b)) := by positivity197 have heq : -((0*D p q b-c*(2*N p q b))/(D p q b)^2)*a*(c/D p q b)^a/(c/D p q b) =198 (2*c*a*(c/D p q b)^a / ((D p q b)^2*(c/D p q b))) * N p q b := by ring199 rw [heq, mulNegL hfactor]; unfold N; constructor <;> intro hz <;> linarith200201end QuietInvestment
Schedules.lean
Back to results1import Mathlib.Analysis.ODE.PicardLindelof2import Mathlib.Analysis.Calculus.Deriv.MeanValue3import Mathlib.Tactic.FieldSimp4import Mathlib.Tactic.Positivity5import Mathlib.Tactic.Linarith6import Mathlib.Tactic.Ring78noncomputable section9open Set Filter10open scoped Topology NNReal11namespace QuietInvestment12/-- (A16) in the form e' = (A*x-B*e)/(U*x+V*e), all four coefficients positive. -/13def slope (A B U V x e : ℝ) := (A*x-B*e)/(U*x+V*e)1415/-- Extension to negative e for Picard–Lindelöf. On a nonnegative solution16this coincides with the manuscript's rational vector field. -/17private def extSlope (A B U V x e : ℝ) := slope A B U V x (max e 0)1819private theorem slope_bounds {A B U V x e : ℝ} (hA : 0 < A) (hB : 0 < B)20 (hU : 0 < U) (hV : 0 < V) (hx : 0 < x) (he : 0 ≤ e) :21 -B/V ≤ slope A B U V x e ∧ slope A B U V x e ≤ A/U := by22 unfold slope23 have hd : 0 < U*x+V*e := by positivity24 constructor25 · rw [div_le_div_iff₀ hV hd]26 nlinarith [mul_pos (mul_pos hA hx) hV, mul_pos (mul_pos hB hU) hx]27 · rw [div_le_div_iff₀ hd hU]28 nlinarith [mul_nonneg (mul_pos hA hV).le he, mul_nonneg (mul_pos hB hU).le he]2930private theorem slope_lipschitz {A B U V t x : ℝ} (hA : 0 < A) (hB : 0 < B)31 (hU : 0 < U) (hV : 0 < V) (ht : 0 < t) (hx : t ≤ x) :32 LipschitzWith ⟨(B*U+A*V)/(U^2*t), by positivity⟩ (extSlope A B U V x) := by33 apply LipschitzWith.of_dist_le_mul34 intro v w35 have hx0 := ht.trans_le hx36 let m := max v 037 let n := max w 038 have hm : 0 ≤ m := le_max_right _ _39 have hn : 0 ≤ n := le_max_right _ _40 have h1 : 0 < U*x+V*m := by positivity41 have h2 : 0 < U*x+V*n := by positivity42 have hL : 0 < (B*U+A*V)/(U^2*t) := by positivity43 have he : slope A B U V x m - slope A B U V x n =44 -((B*U+A*V)*x/((U*x+V*m)*(U*x+V*n)))*(m-n) := by45 unfold slope; field_simp [h1.ne',h2.ne']; ring46 have hc : (B*U+A*V)*x/((U*x+V*m)*(U*x+V*n)) ≤ (B*U+A*V)/(U^2*t) := by47 rw [div_le_div_iff₀ (mul_pos h1 h2) (by positivity)]48 have hm' : U*x ≤ U*x+V*m := le_add_of_nonneg_right (mul_nonneg hV.le hm)49 have hn' : U*t ≤ U*x+V*n := (mul_le_mul_of_nonneg_left hx hU.le).trans50 (le_add_of_nonneg_right (mul_nonneg hV.le hn))51 have hh := mul_le_mul hm' hn' (mul_pos hU ht).le h1.le52 have := mul_le_mul_of_nonneg_left hh (show 0 ≤ B*U+A*V by positivity)53 nlinarith only [this]54 have habs : |m-n| ≤ |v-w| := by55 simpa only [m,n,NNReal.coe_one,dist_prod_same_right,one_mul,Real.dist_eq] using56 (lipschitzWith_max.dist_le_mul (v,(0:ℝ)) (w,0))57 simp only [Real.dist_eq, NNReal.coe_mk] at *58 change |slope A B U V x m - slope A B U V x n| ≤ _ * |v-w|59 rw [he,abs_mul,abs_neg,abs_of_nonneg (by positivity : 0 ≤ (B*U+A*V)*x/((U*x+V*m)*(U*x+V*n)))]60 exact mul_le_mul hc habs (abs_nonneg _) hL.le6162/-- Global existence and strict increase of a solution of (A16) on the full63issuing interval. The upper comparison function is m*x, m=A/(B+U/2);64at contact the solution's slope is strictly less than m. -/65theorem schedule_on_interval {A B U V t T : ℝ} (hA : 0 < A) (hB : 0 < B)66 (hU : 0 < U) (hV : 0 < V) (ht : t ∈ Ioo 0 T) :67 ∃ e : ℝ → ℝ, e t = 0 ∧ StrictMonoOn e (Icc t T) ∧68 ∀ x ∈ Icc t T, 0 ≤ e x ∧ 0 < slope A B U V x (e x) ∧69 HasDerivWithinAt e (slope A B U V x (e x)) (Icc t T) x := by70 let M := A/U+B/V71 have hM : 0 < M := by dsimp [M]; positivity72 have ht0 := ht.173 have ht1 := ht.274 have hpic : IsPicardLindelof (extSlope A B U V) t t T 075 ⟨(B*U+A*V)/(U^2*t), by positivity⟩ (M*(T-t)) M := by76 constructor77 · exact ⟨le_rfl, ht1.le⟩78 · exact mul_nonneg hM.le (sub_nonneg.mpr ht1.le)79 · intro x hx; exact (slope_lipschitz hA hB hU hV ht0 hx.1).lipschitzOnWith80 · intro z _; apply ContinuousOn.div <;> try fun_prop81 intro x hx82 have hx0 := ht0.trans_le hx.183 exact (show 0 < U*x+V*max z 0 by positivity).ne'84 · intro x hx z _85 have hb := slope_bounds hA hB hU hV (ht0.trans_le hx.1) (le_max_right z 0)86 rw [neg_div] at hb87 rw [Real.norm_eq_abs, abs_le]88 dsimp [M,extSlope]; constructor <;> linarith [div_pos hA hU,div_pos hB hV,hb.1,hb.2]89 · simp [max_eq_left (sub_nonneg.mpr ht1.le)]90 obtain ⟨e,het,hed⟩ := hpic.exists_forall_hasDerivWithinAt_Icc_eq 091 have hec : ContinuousOn e (Icc t T) := fun x hx => (hed x hx).continuousWithinAt92 have her (x : ℝ) (hx : x ∈ Ico t T) := (hed x (Ico_subset_Icc_self hx)).mono_of_mem_nhdsWithin93 (Icc_mem_nhdsGE_of_mem hx)94 have lo : ∀ x ∈ Icc t T, 0 ≤ e x := by95 apply image_le_of_deriv_right_lt_deriv_boundary' (f := fun _ => 0) (f' := fun _ => 0)96 continuousOn_const (fun x _ => (hasDerivAt_const x (0:ℝ)).hasDerivWithinAt)97 (by simp [het]) hec her98 intro x hx hz; rw [← hz]99 simp [extSlope,slope]; exact div_pos (mul_pos hA (ht0.trans_le hx.1)) (mul_pos hU (ht0.trans_le hx.1))100 let m := A/(B+U/2)101 have hm : 0 < m := by dsimp [m]; positivity102 have hmE : m*(B+U/2) = A := by dsimp [m]; field_simp103 have hi : ∀ x ∈ Icc t T, e x ≤ m*x := by104 apply image_le_of_deriv_right_lt_deriv_boundary (B := fun x => m*x)105 (B' := fun _ => m) hec her (by rw [het]; positivity)106 (fun x => by simpa using (hasDerivAt_id x).const_mul m)107 intro x hx hhit108 have hx0 := ht0.trans_le hx.1109 rw [hhit]; unfold extSlope slope; rw [max_eq_left (mul_pos hm hx0).le]110 rw [div_lt_iff₀ (by positivity)]111 nlinarith only [congrArg (fun w : ℝ => w*x) hmE,112 mul_pos (mul_pos hm hU) hx0, mul_pos (mul_pos (mul_pos hm hV) hm) hx0]113 have hpos (x : ℝ) (hx : x ∈ Icc t T) : 0 < slope A B U V x (e x) := by114 have hx0 := ht0.trans_le hx.1115 have hl := lo x hx116 unfold slope; apply div_pos _ (by positivity)117 have hb := mul_le_mul_of_nonneg_left (hi x hx) hB.le118 nlinarith only [hb,congrArg (fun w : ℝ => w*x) hmE,mul_pos (mul_pos hm hU) hx0]119 have hder (x : ℝ) (hx : x ∈ Icc t T) :120 HasDerivWithinAt e (slope A B U V x (e x)) (Icc t T) x := by121 simpa [extSlope,max_eq_left (lo x hx)] using hed x hx122 refine ⟨e,het,strictMonoOn_of_deriv_pos (convex_Icc _ _) hec ?_,fun x hx => ⟨lo x hx,hpos x hx,hder x hx⟩⟩123 intro x hx124 rw [interior_Icc] at hx125 rw [((hder x (Ioo_subset_Icc_self hx)).hasDerivAt (Icc_mem_nhds hx.1 hx.2)).deriv]126 exact hpos x (Ioo_subset_Icc_self hx)127128theorem schedule_exists {A B U V t : ℝ} (hA : 0 < A) (hB : 0 < B)129 (hU : 0 < U) (hV : 0 < V) (ht : t ∈ Ioo 0 1) :130 ∃ e : ℝ → ℝ, e t = 0 ∧ StrictMonoOn e (Icc t 1) ∧131 ∀ x ∈ Icc t 1, 0 ≤ e x ∧ 0 < slope A B U V x (e x) ∧132 HasDerivWithinAt e (slope A B U V x (e x)) (Icc t 1) x :=133 schedule_on_interval hA hB hU hV ht134end QuietInvestment
Selection.lean
Back to results1import Mathlib.Analysis.Calculus.MeanValue2import Mathlib.Analysis.SpecialFunctions.Integrals3import Mathlib.Analysis.SpecialFunctions.Pow.Deriv4import Mathlib.Tactic.FieldSimp5import Mathlib.Tactic.Linarith6import Mathlib.Tactic.Positivity7import Mathlib.Tactic.Ring8noncomputable section9open Set Filter MeasureTheory10open scoped Topology Interval11namespace QuietInvestment1213/-- Rescaled overforecasting slope (A25); H=(a+2)K/k, V=1+4k,14U=b(p-q)t, B=(p+b(p-q))t, t=issuance cutoff. -/15def relSlope (H B U V y e : ℝ) := (H*y-B*e)/(U*y+V*e)1617/-- (A16) implies (A25), by the chain rule and the threshold equation. -/18theorem rescale_slope {k p q b a K t y e v : ℝ} (hk : k ≠ 0)19 (hcut : p*(p-2*b*(p-q))*t^2 = 2*(a+2)*K)20 (hode : (b*(p-q)*(t*y)+(1+4*k)*e)*v =21 p*(p-2*b*(p-q))/(2*k)*(t*y)-(p+b*(p-q))*e)22 (hden : b*(p-q)*t*y+(1+4*k)*e ≠ 0) :23 t*v = relSlope ((a+2)*K/k) ((p+b*(p-q))*t) (b*(p-q)*t) (1+4*k) y e := by24 unfold relSlope25 rw [eq_div_iff hden]26 field_simp [hk] at hode ⊢27 linear_combination (t/2)*hode + (y/2)*hcut2829/-- On the common relative-quality interval the high-p schedule lies below30the low-p schedule. Slopes are compared only at equal overforecasting. -/31theorem relative_schedule_le {L H B₁ B₂ U₁ U₂ V : ℝ} {e₁ e₂ : ℝ → ℝ}32 (hB : B₁ ≤ B₂) (hU₁ : 0 < U₁) (hU : U₁ < U₂) (hV : 0 < V)33 (hinit : e₂ 1 ≤ e₁ 1)34 (d₁ : ∀ y ∈ Icc 1 L, HasDerivWithinAt e₁ (relSlope H B₁ U₁ V y (e₁ y)) (Icc 1 L) y)35 (d₂ : ∀ y ∈ Icc 1 L, HasDerivWithinAt e₂ (relSlope H B₂ U₂ V y (e₂ y)) (Icc 1 L) y)36 (h₁ : ∀ y ∈ Icc 1 L, 0 ≤ e₁ y)37 (inc : ∀ y ∈ Ico 1 L, 0 < relSlope H B₂ U₂ V y (e₂ y)) :38 ∀ y ∈ Icc 1 L, e₂ y ≤ e₁ y := by39 apply image_le_of_deriv_right_lt_deriv_boundary'40 (fun x hx => (d₂ x hx).continuousWithinAt)41 (fun x hx => (d₂ x (Ico_subset_Icc_self hx)).mono_of_mem_nhdsWithin (Icc_mem_nhdsGE_of_mem hx))42 hinit (fun x hx => (d₁ x hx).continuousWithinAt)43 (fun x hx => (d₁ x (Ico_subset_Icc_self hx)).mono_of_mem_nhdsWithin (Icc_mem_nhdsGE_of_mem hx))44 intro y hy he45 have hy0 : 0 < y := lt_of_lt_of_le zero_lt_one hy.146 have he0 := h₁ y (Ico_subset_Icc_self hy)47 have hd₁ : 0 < U₁*y+V*e₁ y := by positivity48 have hd : U₁*y+V*e₁ y < U₂*y+V*e₁ y := add_lt_add_right (mul_lt_mul_of_pos_right hU hy0) _49 have hv := inc y hy50 rw [he] at hv ⊢51 unfold relSlope at *52 have hn := (div_pos_iff_of_pos_right (hd₁.trans hd)).mp hv53 apply (div_lt_div_of_pos_left hn hd₁ hd).trans_le54 exact div_le_div_of_nonneg_right (sub_le_sub_left (mul_le_mul_of_nonneg_right hB he0) _) hd₁.le5556/-- Conditional issuer mean in relative quality. The constant in the57conditional power density cancels between numerator and denominator. -/58def weightedMean (w e : ℝ → ℝ) (L : ℝ) :=59 (∫ y in (1:ℝ)..L, e y*w y)/(∫ y in (1:ℝ)..L, w y)6061/-- Strict tail-selection comparison; only the lower-p curve must be strictly62increasing. Applies in particular to w(y)=y^(a-1) on y≥1. -/63theorem selection_mean_lt {L₂ L₁ : ℝ} (h₂ : 1 < L₂) (h₁ : L₂ < L₁)64 {w e₁ e₂ : ℝ → ℝ} (hw : ContinuousOn w (Icc 1 L₁))65 (hwp : ∀ y ∈ Icc 1 L₁, 0 < w y)66 (he₁ : ContinuousOn e₁ (Icc 1 L₁)) (he₂ : ContinuousOn e₂ (Icc 1 L₂))67 (hmono : StrictMonoOn e₁ (Icc 1 L₁)) (hle : ∀ y ∈ Icc 1 L₂, e₂ y ≤ e₁ y) :68 weightedMean w e₂ L₂ < weightedMean w e₁ L₁ := by69 have subA : Icc 1 L₂ ⊆ Icc 1 L₁ := Icc_subset_Icc_right h₁.le70 have subB : Icc L₂ L₁ ⊆ Icc 1 L₁ := Icc_subset_Icc_left h₂.le71 have intA (f : ℝ → ℝ) (h : ContinuousOn f (Icc 1 L₁)) := (h.mono subA).intervalIntegrable_of_Icc (μ := volume) h₂.le72 have intB (f : ℝ → ℝ) (h : ContinuousOn f (Icc 1 L₁)) := (h.mono subB).intervalIntegrable_of_Icc (μ := volume) h₁.le73 have wc := he₁.mul hw74 have hx₂ : L₂ ∈ Icc 1 L₁ := ⟨h₂.le,h₁.le⟩75 have hx₁ : L₁ ∈ Icc 1 L₁ := ⟨(h₂.trans h₁).le,le_rfl⟩76 have Aw : 0 < ∫ y in (1:ℝ)..L₂,w y := intervalIntegral.integral_pos h₂ (hw.mono subA)77 (fun x hx => (hwp x (subA (Ioc_subset_Icc_self hx))).le) ⟨L₂,⟨h₂.le,le_rfl⟩,hwp _ hx₂⟩78 have Bw : 0 < ∫ y in L₂..L₁,w y := intervalIntegral.integral_pos h₁ (hw.mono subB)79 (fun x hx => (hwp x (subB (Ioc_subset_Icc_self hx))).le) ⟨L₁,⟨h₁.le,le_rfl⟩,hwp _ hx₁⟩80 have A : (∫ y in (1:ℝ)..L₂,e₁ y*w y) ≤ e₁ L₂*(∫ y in (1:ℝ)..L₂,w y) := by81 rw [← intervalIntegral.integral_const_mul]82 apply intervalIntegral.integral_mono_on h₂.le (intA _ wc) (intA _ (continuousOn_const.mul hw))83 intro x hx84 exact mul_le_mul_of_nonneg_right (hmono.monotoneOn (subA hx) hx₂ hx.2) (hwp _ (subA hx)).le85 have B : e₁ L₂*(∫ y in L₂..L₁,w y) < ∫ y in L₂..L₁,e₁ y*w y := by86 rw [← intervalIntegral.integral_const_mul]87 apply intervalIntegral.integral_lt_integral_of_continuousOn_of_le_of_exists_lt h₁88 (continuousOn_const.mul (hw.mono subB)) (wc.mono subB)89 · intro x hx; exact mul_le_mul_of_nonneg_right90 (hmono.monotoneOn hx₂ (subB (Ioc_subset_Icc_self hx)) hx.1.le)91 (hwp _ (subB (Ioc_subset_Icc_self hx))).le92 · exact ⟨L₁,⟨h₁.le,le_rfl⟩,mul_lt_mul_of_pos_right (hmono hx₂ hx₁ h₁) (hwp _ hx₁)⟩93 have AB : (∫ y in (1:ℝ)..L₂,e₂ y*w y) ≤ ∫ y in (1:ℝ)..L₂,e₁ y*w y := by94 apply intervalIntegral.integral_mono_on h₂.le ((he₂.mul (hw.mono subA)).intervalIntegrable_of_Icc h₂.le) (intA _ wc)95 exact fun x hx => mul_le_mul_of_nonneg_right (hle x hx) (hwp _ (subA hx)).le96 unfold weightedMean97 rw [← intervalIntegral.integral_add_adjacent_intervals (intA _ wc) (intB _ wc),98 ← intervalIntegral.integral_add_adjacent_intervals (intA _ hw) (intB _ hw)]99 apply (div_le_div_of_nonneg_right AB Aw.le).trans_lt100 rw [div_lt_div_iff₀ Aw (add_pos Aw Bw)]101 nlinarith only [mul_le_mul_of_nonneg_right A Bw.le, mul_lt_mul_of_pos_right B Aw]102103theorem power_weight {a L : ℝ} :104 ContinuousOn (fun y : ℝ => y^(a-1)) (Icc 1 L) ∧105 ∀ y ∈ Icc 1 L, 0 < y^(a-1) := by106 constructor107 · intro y hy; exact (Real.continuousAt_rpow_const _ _ (Or.inl (lt_of_lt_of_le zero_lt_one hy.1).ne')).continuousWithinAt108 · intro y hy; exact Real.rpow_pos_of_pos (lt_of_lt_of_le zero_lt_one hy.1) _109110/-- (A18) using the conditional second-moment integral; its numerator density111is a*x^(a+1), i.e. x² times the power density for x>0. -/112theorem power_second_moment {a t : ℝ} (ha : 0 < a) (ht : 0 < t) :113 (∫ x in (0:ℝ)..t, a*x^(a+1))/(t^a) = a*t^2/(a+2) := by114 rw [intervalIntegral.integral_const_mul, integral_rpow (Or.inl (by linarith))]115 rw [show a+1+1 = a+2 by ring,Real.zero_rpow (by linarith),sub_zero,Real.rpow_add ht,Real.rpow_two]116 field_simp [(Real.rpow_pos_of_pos ht a).ne',show a+2 ≠ 0 by linarith]; ring117end QuietInvestment