From 17b1829f076deddd003e884a58a1d9de13dfabe1 Mon Sep 17 00:00:00 2001 From: Oscar11218 Date: Wed, 3 Dec 2025 19:42:53 -0500 Subject: [PATCH] Basic definition on convex set and convex function --- Probability/Probability/Defs.lean | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Probability/Probability/Defs.lean b/Probability/Probability/Defs.lean index 8204a66..4d88fbf 100644 --- a/Probability/Probability/Defs.lean +++ b/Probability/Probability/Defs.lean @@ -209,7 +209,7 @@ theorem one_of_ind_bool_or_not : (๐•€โˆ˜B) + (๐•€โˆ˜(ยฌแตฃ B)) = (1 : FinRV n variable {X Y: FinRV n โ„š} -theorem rv_le_abs : X โ‰ค abs โˆ˜ X := by intro i; simp [le_abs_self (X i)] +theorem rv_le_abs(X : FinRV n โ„š) : X โ‰ค abs โˆ˜ X := by intro i; simp [le_abs_self (X i)] theorem rv_prod_sum_linear {Xs : Fin k โ†’ FinRV n โ„š} : โˆ‘ i, Y * (Xs i) = Y * (โˆ‘ i, Xs i) := by ext ฯ‰ @@ -348,3 +348,18 @@ theorem exp_indi_eq_exp_indr : โˆ€i : Fin k, ๐”ผ[L =แตข i // P] = ๐”ผ[๐•€ โˆ˜ theorem exp_monotone (h: X โ‰ค Y) : ๐”ผ[X // P] โ‰ค ๐”ผ[Y // P] := dotProduct_le_dotProduct_of_nonneg_left h P.nneg end Expectation_properties + +namespace Geometry + +variable {E : Type} [AddCommGroup E] [Module โ„š E] + +def convex (S : Set E) : Prop := + โˆ€ โฆƒx y : Eโฆ„ โฆƒt : โ„šโฆ„, 0 โ‰ค t โ†’ t โ‰ค 1 โ†’ x โˆˆ S โ†’ y โˆˆ S โ†’ t โ€ข x + (1 - t) โ€ข y โˆˆ S + +def convex_on (S : Set E) (f : E โ†’ โ„š) : Prop := + convex S โˆง โˆ€ โฆƒx y : Eโฆ„ โฆƒt : โ„šโฆ„, 0 โ‰ค t โ†’ t โ‰ค 1 โ†’ x โˆˆ S โ†’ y โˆˆ S โ†’ + f (t โ€ข x + (1 - t) โ€ข y) โ‰ค t * f x + (1 - t) * f y + + + +end Geometry