state
stringlengths 0
159k
| srcUpToTactic
stringlengths 387
167k
| nextTactic
stringlengths 3
9k
| declUpToTactic
stringlengths 22
11.5k
| declId
stringlengths 38
95
| decl
stringlengths 16
1.89k
| file_tag
stringlengths 17
73
|
---|---|---|---|---|---|---|
C : Type u_1
D : Type u_2
instβΒ² : Category.{?u.38, u_1} C
instβΒΉ : Category.{?u.42, u_2} D
instβ : Preadditive D
Pβ Qβ Rβ : C β₯€ D
fβ f'β : Pβ βΆ Qβ
gβ : Qβ βΆ Rβ
β’ (fβ + f'β) β« gβ = fβ β« gβ + f'β β« gβ
|
/-
Copyright (c) 2021 Johan Commelin. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johan Commelin
-/
import Mathlib.CategoryTheory.Preadditive.Basic
#align_import category_theory.preadditive.functor_category from "leanprover-community/mathlib"@"829895f162a1f29d0133f4b3538f4cd1fb5bffd3"
/-!
# Preadditive structure on functor categories
If `C` and `D` are categories and `D` is preadditive,
then `C β₯€ D` is also preadditive.
-/
open BigOperators
namespace CategoryTheory
open CategoryTheory.Limits Preadditive
variable {C D : Type*} [Category C] [Category D] [Preadditive D]
instance functorCategoryPreadditive : Preadditive (C β₯€ D)
where
homGroup F G :=
{ add := fun Ξ± Ξ² => { app := fun X => Ξ±.app X + Ξ².app X }
zero := { app := fun X => 0 }
neg := fun Ξ± => { app := fun X => -Ξ±.app X }
sub := fun Ξ± Ξ² => { app := fun X => Ξ±.app X - Ξ².app X }
add_assoc := by
intros
ext
apply add_assoc
zero_add := by
intros
ext
apply zero_add
add_zero := by
intros
ext
apply add_zero
add_comm := by
intros
ext
apply add_comm
sub_eq_add_neg := by
intros
ext
apply sub_eq_add_neg
add_left_neg := by
intros
ext
apply add_left_neg }
add_comp := by
intros
|
ext
|
instance functorCategoryPreadditive : Preadditive (C β₯€ D)
where
homGroup F G :=
{ add := fun Ξ± Ξ² => { app := fun X => Ξ±.app X + Ξ².app X }
zero := { app := fun X => 0 }
neg := fun Ξ± => { app := fun X => -Ξ±.app X }
sub := fun Ξ± Ξ² => { app := fun X => Ξ±.app X - Ξ².app X }
add_assoc := by
intros
ext
apply add_assoc
zero_add := by
intros
ext
apply zero_add
add_zero := by
intros
ext
apply add_zero
add_comm := by
intros
ext
apply add_comm
sub_eq_add_neg := by
intros
ext
apply sub_eq_add_neg
add_left_neg := by
intros
ext
apply add_left_neg }
add_comp := by
intros
|
Mathlib.CategoryTheory.Preadditive.FunctorCategory.27_0.Nvs9V8Hq6lv6L8Y
|
instance functorCategoryPreadditive : Preadditive (C β₯€ D)
where
homGroup F G
|
Mathlib_CategoryTheory_Preadditive_FunctorCategory
|
case w.h
C : Type u_1
D : Type u_2
instβΒ² : Category.{?u.38, u_1} C
instβΒΉ : Category.{?u.42, u_2} D
instβ : Preadditive D
Pβ Qβ Rβ : C β₯€ D
fβ f'β : Pβ βΆ Qβ
gβ : Qβ βΆ Rβ
xβ : C
β’ ((fβ + f'β) β« gβ).app xβ = (fβ β« gβ + f'β β« gβ).app xβ
|
/-
Copyright (c) 2021 Johan Commelin. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johan Commelin
-/
import Mathlib.CategoryTheory.Preadditive.Basic
#align_import category_theory.preadditive.functor_category from "leanprover-community/mathlib"@"829895f162a1f29d0133f4b3538f4cd1fb5bffd3"
/-!
# Preadditive structure on functor categories
If `C` and `D` are categories and `D` is preadditive,
then `C β₯€ D` is also preadditive.
-/
open BigOperators
namespace CategoryTheory
open CategoryTheory.Limits Preadditive
variable {C D : Type*} [Category C] [Category D] [Preadditive D]
instance functorCategoryPreadditive : Preadditive (C β₯€ D)
where
homGroup F G :=
{ add := fun Ξ± Ξ² => { app := fun X => Ξ±.app X + Ξ².app X }
zero := { app := fun X => 0 }
neg := fun Ξ± => { app := fun X => -Ξ±.app X }
sub := fun Ξ± Ξ² => { app := fun X => Ξ±.app X - Ξ².app X }
add_assoc := by
intros
ext
apply add_assoc
zero_add := by
intros
ext
apply zero_add
add_zero := by
intros
ext
apply add_zero
add_comm := by
intros
ext
apply add_comm
sub_eq_add_neg := by
intros
ext
apply sub_eq_add_neg
add_left_neg := by
intros
ext
apply add_left_neg }
add_comp := by
intros
ext
|
apply add_comp
|
instance functorCategoryPreadditive : Preadditive (C β₯€ D)
where
homGroup F G :=
{ add := fun Ξ± Ξ² => { app := fun X => Ξ±.app X + Ξ².app X }
zero := { app := fun X => 0 }
neg := fun Ξ± => { app := fun X => -Ξ±.app X }
sub := fun Ξ± Ξ² => { app := fun X => Ξ±.app X - Ξ².app X }
add_assoc := by
intros
ext
apply add_assoc
zero_add := by
intros
ext
apply zero_add
add_zero := by
intros
ext
apply add_zero
add_comm := by
intros
ext
apply add_comm
sub_eq_add_neg := by
intros
ext
apply sub_eq_add_neg
add_left_neg := by
intros
ext
apply add_left_neg }
add_comp := by
intros
ext
|
Mathlib.CategoryTheory.Preadditive.FunctorCategory.27_0.Nvs9V8Hq6lv6L8Y
|
instance functorCategoryPreadditive : Preadditive (C β₯€ D)
where
homGroup F G
|
Mathlib_CategoryTheory_Preadditive_FunctorCategory
|
C : Type u_1
D : Type u_2
instβΒ² : Category.{?u.38, u_1} C
instβΒΉ : Category.{?u.42, u_2} D
instβ : Preadditive D
β’ β (P Q R : C β₯€ D) (f : P βΆ Q) (g g' : Q βΆ R), f β« (g + g') = f β« g + f β« g'
|
/-
Copyright (c) 2021 Johan Commelin. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johan Commelin
-/
import Mathlib.CategoryTheory.Preadditive.Basic
#align_import category_theory.preadditive.functor_category from "leanprover-community/mathlib"@"829895f162a1f29d0133f4b3538f4cd1fb5bffd3"
/-!
# Preadditive structure on functor categories
If `C` and `D` are categories and `D` is preadditive,
then `C β₯€ D` is also preadditive.
-/
open BigOperators
namespace CategoryTheory
open CategoryTheory.Limits Preadditive
variable {C D : Type*} [Category C] [Category D] [Preadditive D]
instance functorCategoryPreadditive : Preadditive (C β₯€ D)
where
homGroup F G :=
{ add := fun Ξ± Ξ² => { app := fun X => Ξ±.app X + Ξ².app X }
zero := { app := fun X => 0 }
neg := fun Ξ± => { app := fun X => -Ξ±.app X }
sub := fun Ξ± Ξ² => { app := fun X => Ξ±.app X - Ξ².app X }
add_assoc := by
intros
ext
apply add_assoc
zero_add := by
intros
ext
apply zero_add
add_zero := by
intros
ext
apply add_zero
add_comm := by
intros
ext
apply add_comm
sub_eq_add_neg := by
intros
ext
apply sub_eq_add_neg
add_left_neg := by
intros
ext
apply add_left_neg }
add_comp := by
intros
ext
apply add_comp
comp_add := by
|
intros
|
instance functorCategoryPreadditive : Preadditive (C β₯€ D)
where
homGroup F G :=
{ add := fun Ξ± Ξ² => { app := fun X => Ξ±.app X + Ξ².app X }
zero := { app := fun X => 0 }
neg := fun Ξ± => { app := fun X => -Ξ±.app X }
sub := fun Ξ± Ξ² => { app := fun X => Ξ±.app X - Ξ².app X }
add_assoc := by
intros
ext
apply add_assoc
zero_add := by
intros
ext
apply zero_add
add_zero := by
intros
ext
apply add_zero
add_comm := by
intros
ext
apply add_comm
sub_eq_add_neg := by
intros
ext
apply sub_eq_add_neg
add_left_neg := by
intros
ext
apply add_left_neg }
add_comp := by
intros
ext
apply add_comp
comp_add := by
|
Mathlib.CategoryTheory.Preadditive.FunctorCategory.27_0.Nvs9V8Hq6lv6L8Y
|
instance functorCategoryPreadditive : Preadditive (C β₯€ D)
where
homGroup F G
|
Mathlib_CategoryTheory_Preadditive_FunctorCategory
|
C : Type u_1
D : Type u_2
instβΒ² : Category.{?u.38, u_1} C
instβΒΉ : Category.{?u.42, u_2} D
instβ : Preadditive D
Pβ Qβ Rβ : C β₯€ D
fβ : Pβ βΆ Qβ
gβ g'β : Qβ βΆ Rβ
β’ fβ β« (gβ + g'β) = fβ β« gβ + fβ β« g'β
|
/-
Copyright (c) 2021 Johan Commelin. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johan Commelin
-/
import Mathlib.CategoryTheory.Preadditive.Basic
#align_import category_theory.preadditive.functor_category from "leanprover-community/mathlib"@"829895f162a1f29d0133f4b3538f4cd1fb5bffd3"
/-!
# Preadditive structure on functor categories
If `C` and `D` are categories and `D` is preadditive,
then `C β₯€ D` is also preadditive.
-/
open BigOperators
namespace CategoryTheory
open CategoryTheory.Limits Preadditive
variable {C D : Type*} [Category C] [Category D] [Preadditive D]
instance functorCategoryPreadditive : Preadditive (C β₯€ D)
where
homGroup F G :=
{ add := fun Ξ± Ξ² => { app := fun X => Ξ±.app X + Ξ².app X }
zero := { app := fun X => 0 }
neg := fun Ξ± => { app := fun X => -Ξ±.app X }
sub := fun Ξ± Ξ² => { app := fun X => Ξ±.app X - Ξ².app X }
add_assoc := by
intros
ext
apply add_assoc
zero_add := by
intros
ext
apply zero_add
add_zero := by
intros
ext
apply add_zero
add_comm := by
intros
ext
apply add_comm
sub_eq_add_neg := by
intros
ext
apply sub_eq_add_neg
add_left_neg := by
intros
ext
apply add_left_neg }
add_comp := by
intros
ext
apply add_comp
comp_add := by
intros
|
ext
|
instance functorCategoryPreadditive : Preadditive (C β₯€ D)
where
homGroup F G :=
{ add := fun Ξ± Ξ² => { app := fun X => Ξ±.app X + Ξ².app X }
zero := { app := fun X => 0 }
neg := fun Ξ± => { app := fun X => -Ξ±.app X }
sub := fun Ξ± Ξ² => { app := fun X => Ξ±.app X - Ξ².app X }
add_assoc := by
intros
ext
apply add_assoc
zero_add := by
intros
ext
apply zero_add
add_zero := by
intros
ext
apply add_zero
add_comm := by
intros
ext
apply add_comm
sub_eq_add_neg := by
intros
ext
apply sub_eq_add_neg
add_left_neg := by
intros
ext
apply add_left_neg }
add_comp := by
intros
ext
apply add_comp
comp_add := by
intros
|
Mathlib.CategoryTheory.Preadditive.FunctorCategory.27_0.Nvs9V8Hq6lv6L8Y
|
instance functorCategoryPreadditive : Preadditive (C β₯€ D)
where
homGroup F G
|
Mathlib_CategoryTheory_Preadditive_FunctorCategory
|
case w.h
C : Type u_1
D : Type u_2
instβΒ² : Category.{?u.38, u_1} C
instβΒΉ : Category.{?u.42, u_2} D
instβ : Preadditive D
Pβ Qβ Rβ : C β₯€ D
fβ : Pβ βΆ Qβ
gβ g'β : Qβ βΆ Rβ
xβ : C
β’ (fβ β« (gβ + g'β)).app xβ = (fβ β« gβ + fβ β« g'β).app xβ
|
/-
Copyright (c) 2021 Johan Commelin. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johan Commelin
-/
import Mathlib.CategoryTheory.Preadditive.Basic
#align_import category_theory.preadditive.functor_category from "leanprover-community/mathlib"@"829895f162a1f29d0133f4b3538f4cd1fb5bffd3"
/-!
# Preadditive structure on functor categories
If `C` and `D` are categories and `D` is preadditive,
then `C β₯€ D` is also preadditive.
-/
open BigOperators
namespace CategoryTheory
open CategoryTheory.Limits Preadditive
variable {C D : Type*} [Category C] [Category D] [Preadditive D]
instance functorCategoryPreadditive : Preadditive (C β₯€ D)
where
homGroup F G :=
{ add := fun Ξ± Ξ² => { app := fun X => Ξ±.app X + Ξ².app X }
zero := { app := fun X => 0 }
neg := fun Ξ± => { app := fun X => -Ξ±.app X }
sub := fun Ξ± Ξ² => { app := fun X => Ξ±.app X - Ξ².app X }
add_assoc := by
intros
ext
apply add_assoc
zero_add := by
intros
ext
apply zero_add
add_zero := by
intros
ext
apply add_zero
add_comm := by
intros
ext
apply add_comm
sub_eq_add_neg := by
intros
ext
apply sub_eq_add_neg
add_left_neg := by
intros
ext
apply add_left_neg }
add_comp := by
intros
ext
apply add_comp
comp_add := by
intros
ext
|
apply comp_add
|
instance functorCategoryPreadditive : Preadditive (C β₯€ D)
where
homGroup F G :=
{ add := fun Ξ± Ξ² => { app := fun X => Ξ±.app X + Ξ².app X }
zero := { app := fun X => 0 }
neg := fun Ξ± => { app := fun X => -Ξ±.app X }
sub := fun Ξ± Ξ² => { app := fun X => Ξ±.app X - Ξ².app X }
add_assoc := by
intros
ext
apply add_assoc
zero_add := by
intros
ext
apply zero_add
add_zero := by
intros
ext
apply add_zero
add_comm := by
intros
ext
apply add_comm
sub_eq_add_neg := by
intros
ext
apply sub_eq_add_neg
add_left_neg := by
intros
ext
apply add_left_neg }
add_comp := by
intros
ext
apply add_comp
comp_add := by
intros
ext
|
Mathlib.CategoryTheory.Preadditive.FunctorCategory.27_0.Nvs9V8Hq6lv6L8Y
|
instance functorCategoryPreadditive : Preadditive (C β₯€ D)
where
homGroup F G
|
Mathlib_CategoryTheory_Preadditive_FunctorCategory
|
C : Type u_1
D : Type u_2
instβΒ² : Category.{u_5, u_1} C
instβΒΉ : Category.{u_4, u_2} D
instβ : Preadditive D
F G : C β₯€ D
ΞΉ : Type u_3
s : Finset ΞΉ
X : C
Ξ± : ΞΉ β (F βΆ G)
β’ (β i in s, Ξ± i).app X = β i in s, (Ξ± i).app X
|
/-
Copyright (c) 2021 Johan Commelin. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johan Commelin
-/
import Mathlib.CategoryTheory.Preadditive.Basic
#align_import category_theory.preadditive.functor_category from "leanprover-community/mathlib"@"829895f162a1f29d0133f4b3538f4cd1fb5bffd3"
/-!
# Preadditive structure on functor categories
If `C` and `D` are categories and `D` is preadditive,
then `C β₯€ D` is also preadditive.
-/
open BigOperators
namespace CategoryTheory
open CategoryTheory.Limits Preadditive
variable {C D : Type*} [Category C] [Category D] [Preadditive D]
instance functorCategoryPreadditive : Preadditive (C β₯€ D)
where
homGroup F G :=
{ add := fun Ξ± Ξ² => { app := fun X => Ξ±.app X + Ξ².app X }
zero := { app := fun X => 0 }
neg := fun Ξ± => { app := fun X => -Ξ±.app X }
sub := fun Ξ± Ξ² => { app := fun X => Ξ±.app X - Ξ².app X }
add_assoc := by
intros
ext
apply add_assoc
zero_add := by
intros
ext
apply zero_add
add_zero := by
intros
ext
apply add_zero
add_comm := by
intros
ext
apply add_comm
sub_eq_add_neg := by
intros
ext
apply sub_eq_add_neg
add_left_neg := by
intros
ext
apply add_left_neg }
add_comp := by
intros
ext
apply add_comp
comp_add := by
intros
ext
apply comp_add
#align category_theory.functor_category_preadditive CategoryTheory.functorCategoryPreadditive
namespace NatTrans
variable {F G : C β₯€ D}
/-- Application of a natural transformation at a fixed object,
as group homomorphism -/
@[simps]
def appHom (X : C) : (F βΆ G) β+ (F.obj X βΆ G.obj X)
where
toFun Ξ± := Ξ±.app X
map_zero' := rfl
map_add' _ _ := rfl
#align category_theory.nat_trans.app_hom CategoryTheory.NatTrans.appHom
@[simp]
theorem app_zero (X : C) : (0 : F βΆ G).app X = 0 :=
rfl
#align category_theory.nat_trans.app_zero CategoryTheory.NatTrans.app_zero
@[simp]
theorem app_add (X : C) (Ξ± Ξ² : F βΆ G) : (Ξ± + Ξ²).app X = Ξ±.app X + Ξ².app X :=
rfl
#align category_theory.nat_trans.app_add CategoryTheory.NatTrans.app_add
@[simp]
theorem app_sub (X : C) (Ξ± Ξ² : F βΆ G) : (Ξ± - Ξ²).app X = Ξ±.app X - Ξ².app X :=
rfl
#align category_theory.nat_trans.app_sub CategoryTheory.NatTrans.app_sub
@[simp]
theorem app_neg (X : C) (Ξ± : F βΆ G) : (-Ξ±).app X = -Ξ±.app X :=
rfl
#align category_theory.nat_trans.app_neg CategoryTheory.NatTrans.app_neg
@[simp]
theorem app_nsmul (X : C) (Ξ± : F βΆ G) (n : β) : (n β’ Ξ±).app X = n β’ Ξ±.app X :=
(appHom X).map_nsmul Ξ± n
#align category_theory.nat_trans.app_nsmul CategoryTheory.NatTrans.app_nsmul
@[simp]
theorem app_zsmul (X : C) (Ξ± : F βΆ G) (n : β€) : (n β’ Ξ±).app X = n β’ Ξ±.app X :=
(appHom X : (F βΆ G) β+ (F.obj X βΆ G.obj X)).map_zsmul Ξ± n
#align category_theory.nat_trans.app_zsmul CategoryTheory.NatTrans.app_zsmul
@[simp]
theorem app_sum {ΞΉ : Type*} (s : Finset ΞΉ) (X : C) (Ξ± : ΞΉ β (F βΆ G)) :
(β i in s, Ξ± i).app X = β i in s, (Ξ± i).app X := by
|
simp only [β appHom_apply, map_sum]
|
@[simp]
theorem app_sum {ΞΉ : Type*} (s : Finset ΞΉ) (X : C) (Ξ± : ΞΉ β (F βΆ G)) :
(β i in s, Ξ± i).app X = β i in s, (Ξ± i).app X := by
|
Mathlib.CategoryTheory.Preadditive.FunctorCategory.112_0.Nvs9V8Hq6lv6L8Y
|
@[simp]
theorem app_sum {ΞΉ : Type*} (s : Finset ΞΉ) (X : C) (Ξ± : ΞΉ β (F βΆ G)) :
(β i in s, Ξ± i).app X = β i in s, (Ξ± i).app X
|
Mathlib_CategoryTheory_Preadditive_FunctorCategory
|
π : Type u_1
E : Type u_2
instβΒ³ : NormedLinearOrderedField π
instβΒ² : NormedAddCommGroup E
instβΒΉ : NormedSpace π E
instβ : StrictConvexSpace π E
x : E
r : β
β’ StrictConvex π (closedBall x r)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
|
rcases le_or_lt r 0 with hr | hr
|
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
|
Mathlib.Analysis.Convex.StrictConvexSpace.80_0.LKetms5NIkPrXf9
|
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r)
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
case inl
π : Type u_1
E : Type u_2
instβΒ³ : NormedLinearOrderedField π
instβΒ² : NormedAddCommGroup E
instβΒΉ : NormedSpace π E
instβ : StrictConvexSpace π E
x : E
r : β
hr : r β€ 0
β’ StrictConvex π (closedBall x r)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β·
|
exact (subsingleton_closedBall x hr).strictConvex
|
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β·
|
Mathlib.Analysis.Convex.StrictConvexSpace.80_0.LKetms5NIkPrXf9
|
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r)
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
case inr
π : Type u_1
E : Type u_2
instβΒ³ : NormedLinearOrderedField π
instβΒ² : NormedAddCommGroup E
instβΒΉ : NormedSpace π E
instβ : StrictConvexSpace π E
x : E
r : β
hr : 0 < r
β’ StrictConvex π (closedBall x r)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
|
rw [β vadd_closedBall_zero]
|
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
|
Mathlib.Analysis.Convex.StrictConvexSpace.80_0.LKetms5NIkPrXf9
|
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r)
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
case inr
π : Type u_1
E : Type u_2
instβΒ³ : NormedLinearOrderedField π
instβΒ² : NormedAddCommGroup E
instβΒΉ : NormedSpace π E
instβ : StrictConvexSpace π E
x : E
r : β
hr : 0 < r
β’ StrictConvex π (x +α΅₯ closedBall 0 r)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
|
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
|
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
|
Mathlib.Analysis.Convex.StrictConvexSpace.80_0.LKetms5NIkPrXf9
|
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r)
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instββ΄ : NormedLinearOrderedField π
instβΒ³ : NormedAddCommGroup E
instβΒ² : NormedSpace π E
instβΒΉ : NormedSpace β E
instβ : LinearMap.CompatibleSMul E E π β
h : StrictConvex π (closedBall 0 1)
r : β
hr : 0 < r
β’ StrictConvex π (closedBall 0 r)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by
|
simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul r
|
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by
|
Mathlib.Analysis.Convex.StrictConvexSpace.91_0.LKetms5NIkPrXf9
|
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instβΒ³ : NormedLinearOrderedField π
instβΒ² : NormedAddCommGroup E
instβΒΉ : NormedSpace π E
instβ : NormedSpace β E
h : β (x y : E), βxβ = 1 β βyβ = 1 β x β y β β a b, a + b = 1 β§ βa β’ x + b β’ yβ < 1
β’ StrictConvexSpace β E
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
|
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
|
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
|
Mathlib.Analysis.Convex.StrictConvexSpace.97_0.LKetms5NIkPrXf9
|
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instβΒ³ : NormedLinearOrderedField π
instβΒ² : NormedAddCommGroup E
instβΒΉ : NormedSpace π E
instβ : NormedSpace β E
h : β (x y : E), βxβ = 1 β βyβ = 1 β x β y β β a b, a + b = 1 β§ βa β’ x + b β’ yβ < 1
x : E
hx : x β closedBall 0 1 \ interior (closedBall 0 1)
y : E
hy : y β closedBall 0 1 \ interior (closedBall 0 1)
hne : x β y
β’ (fun x y => β c, (AffineMap.lineMap x y) c β interior (closedBall 0 1)) x y
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
|
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
|
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
|
Mathlib.Analysis.Convex.StrictConvexSpace.97_0.LKetms5NIkPrXf9
|
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instβΒ³ : NormedLinearOrderedField π
instβΒ² : NormedAddCommGroup E
instβΒΉ : NormedSpace π E
instβ : NormedSpace β E
h : β (x y : E), βxβ = 1 β βyβ = 1 β x β y β β a b, a + b = 1 β§ βa β’ x + b β’ yβ < 1
x : E
hx : βxβ = 1
y : E
hy : βyβ = 1
hne : x β y
β’ β c, (AffineMap.lineMap x y) c β interior (closedBall 0 1)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
|
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
|
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
|
Mathlib.Analysis.Convex.StrictConvexSpace.97_0.LKetms5NIkPrXf9
|
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
case intro.intro.intro
π : Type u_1
E : Type u_2
instβΒ³ : NormedLinearOrderedField π
instβΒ² : NormedAddCommGroup E
instβΒΉ : NormedSpace π E
instβ : NormedSpace β E
h : β (x y : E), βxβ = 1 β βyβ = 1 β x β y β β a b, a + b = 1 β§ βa β’ x + b β’ yβ < 1
x : E
hx : βxβ = 1
y : E
hy : βyβ = 1
hne : x β y
a b : β
hab : a + b = 1
hlt : βa β’ x + b β’ yβ < 1
β’ β c, (AffineMap.lineMap x y) c β interior (closedBall 0 1)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
|
use b
|
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
|
Mathlib.Analysis.Convex.StrictConvexSpace.97_0.LKetms5NIkPrXf9
|
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
case h
π : Type u_1
E : Type u_2
instβΒ³ : NormedLinearOrderedField π
instβΒ² : NormedAddCommGroup E
instβΒΉ : NormedSpace π E
instβ : NormedSpace β E
h : β (x y : E), βxβ = 1 β βyβ = 1 β x β y β β a b, a + b = 1 β§ βa β’ x + b β’ yβ < 1
x : E
hx : βxβ = 1
y : E
hy : βyβ = 1
hne : x β y
a b : β
hab : a + b = 1
hlt : βa β’ x + b β’ yβ < 1
β’ (AffineMap.lineMap x y) b β interior (closedBall 0 1)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
|
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
|
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
|
Mathlib.Analysis.Convex.StrictConvexSpace.97_0.LKetms5NIkPrXf9
|
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instβΒ³ : NormedLinearOrderedField π
instβΒ² : NormedAddCommGroup E
instβΒΉ : NormedSpace π E
instβ : NormedSpace β E
h : β (x y : E), βxβ = 1 β βyβ = 1 β x β y β β a b, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1
β’ StrictConvexSpace β E
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
|
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
|
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
|
Mathlib.Analysis.Convex.StrictConvexSpace.114_0.LKetms5NIkPrXf9
|
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instβΒ³ : NormedLinearOrderedField π
instβΒ² : NormedAddCommGroup E
instβΒΉ : NormedSpace π E
instβ : NormedSpace β E
h : β (x y : E), βxβ = 1 β βyβ = 1 β x β y β β a b, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1
β’ Set.Pairwise (closedBall 0 1 \ interior (closedBall 0 1)) fun x y =>
Set.Nonempty ([x-[β]y] \ frontier (closedBall 0 1))
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
|
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
|
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
|
Mathlib.Analysis.Convex.StrictConvexSpace.114_0.LKetms5NIkPrXf9
|
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instβΒ³ : NormedLinearOrderedField π
instβΒ² : NormedAddCommGroup E
instβΒΉ : NormedSpace π E
instβ : NormedSpace β E
h : β (x y : E), βxβ = 1 β βyβ = 1 β x β y β β a b, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1
β’ β β¦x : Eβ¦, βxβ = 1 β β β¦y : Eβ¦, βyβ = 1 β x β y β Set.Nonempty ([x-[β]y] \ sphere 0 1)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
|
intro x hx y hy hne
|
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
|
Mathlib.Analysis.Convex.StrictConvexSpace.114_0.LKetms5NIkPrXf9
|
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instβΒ³ : NormedLinearOrderedField π
instβΒ² : NormedAddCommGroup E
instβΒΉ : NormedSpace π E
instβ : NormedSpace β E
h : β (x y : E), βxβ = 1 β βyβ = 1 β x β y β β a b, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1
x : E
hx : βxβ = 1
y : E
hy : βyβ = 1
hne : x β y
β’ Set.Nonempty ([x-[β]y] \ sphere 0 1)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
|
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
|
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
|
Mathlib.Analysis.Convex.StrictConvexSpace.114_0.LKetms5NIkPrXf9
|
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
case intro.intro.intro.intro.intro
π : Type u_1
E : Type u_2
instβΒ³ : NormedLinearOrderedField π
instβΒ² : NormedAddCommGroup E
instβΒΉ : NormedSpace π E
instβ : NormedSpace β E
h : β (x y : E), βxβ = 1 β βyβ = 1 β x β y β β a b, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1
x : E
hx : βxβ = 1
y : E
hy : βyβ = 1
hne : x β y
a b : β
ha : 0 β€ a
hb : 0 β€ b
hab : a + b = 1
hne' : βa β’ x + b β’ yβ β 1
β’ Set.Nonempty ([x-[β]y] \ sphere 0 1)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
|
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
|
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
|
Mathlib.Analysis.Convex.StrictConvexSpace.114_0.LKetms5NIkPrXf9
|
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instβΒ³ : NormedLinearOrderedField π
instβΒ² : NormedAddCommGroup E
instβΒΉ : NormedSpace π E
instβ : NormedSpace β E
h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2
β’ StrictConvexSpace β E
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
|
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
|
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
|
Mathlib.Analysis.Convex.StrictConvexSpace.128_0.LKetms5NIkPrXf9
|
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instβΒ³ : NormedLinearOrderedField π
instβΒ² : NormedAddCommGroup E
instβΒΉ : NormedSpace π E
instβ : NormedSpace β E
h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2
x y : E
hx : βxβ = 1
hy : βyβ = 1
hne : x β y
β’ β(1 / 2) β’ x + (1 / 2) β’ yβ β 1
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
|
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
|
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
|
Mathlib.Analysis.Convex.StrictConvexSpace.128_0.LKetms5NIkPrXf9
|
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instβΒ³ : NormedLinearOrderedField π
instβΒ² : NormedAddCommGroup E
instβΒΉ : NormedSpace π E
instβ : NormedSpace β E
h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2
x y : E
hx : βxβ = 1
hy : βyβ = 1
hne : x β y
β’ Β¬βx + yβ = 2
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
|
exact h hx hy hne
|
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
|
Mathlib.Analysis.Convex.StrictConvexSpace.128_0.LKetms5NIkPrXf9
|
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instβΒ³ : NormedLinearOrderedField π
instβΒ² : NormedAddCommGroup E
instβΒΉ : NormedSpace π E
instβ : NormedSpace β E
h : β (x y : E), βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y
β’ StrictConvexSpace β E
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
|
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
|
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
|
Mathlib.Analysis.Convex.StrictConvexSpace.144_0.LKetms5NIkPrXf9
|
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instβΒ³ : NormedLinearOrderedField π
instβΒ² : NormedAddCommGroup E
instβΒΉ : NormedSpace π E
instβ : NormedSpace β E
h : β (x y : E), βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y
x : E
hx : x β sphere 0 1
y : E
hy : y β sphere 0 1
hβ : βx + yβ = 2
β’ x = y
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
|
rw [mem_sphere_zero_iff_norm] at hx hy
|
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
|
Mathlib.Analysis.Convex.StrictConvexSpace.144_0.LKetms5NIkPrXf9
|
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instβΒ³ : NormedLinearOrderedField π
instβΒ² : NormedAddCommGroup E
instβΒΉ : NormedSpace π E
instβ : NormedSpace β E
h : β (x y : E), βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y
x : E
hx : βxβ = 1
y : E
hy : βyβ = 1
hβ : βx + yβ = 2
β’ x = y
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
rw [mem_sphere_zero_iff_norm] at hx hy
|
exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ)
|
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
rw [mem_sphere_zero_iff_norm] at hx hy
|
Mathlib.Analysis.Convex.StrictConvexSpace.144_0.LKetms5NIkPrXf9
|
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instββ΄ : NormedLinearOrderedField π
instβΒ³ : NormedAddCommGroup E
instβΒ² : NormedSpace π E
instβΒΉ : NormedSpace β E
instβ : StrictConvexSpace β E
x y z : E
a b r : β
hx : x β closedBall z r
hy : y β closedBall z r
hne : x β y
ha : 0 < a
hb : 0 < b
hab : a + b = 1
β’ a β’ x + b β’ y β ball z r
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
rw [mem_sphere_zero_iff_norm] at hx hy
exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ)
#align strict_convex_space.of_norm_add StrictConvexSpace.of_norm_add
variable [StrictConvexSpace β E] {x y z : E} {a b r : β}
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
|
rcases eq_or_ne r 0 with (rfl | hr)
|
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
|
Mathlib.Analysis.Convex.StrictConvexSpace.155_0.LKetms5NIkPrXf9
|
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
case inl
π : Type u_1
E : Type u_2
instββ΄ : NormedLinearOrderedField π
instβΒ³ : NormedAddCommGroup E
instβΒ² : NormedSpace π E
instβΒΉ : NormedSpace β E
instβ : StrictConvexSpace β E
x y z : E
a b : β
hne : x β y
ha : 0 < a
hb : 0 < b
hab : a + b = 1
hx : x β closedBall z 0
hy : y β closedBall z 0
β’ a β’ x + b β’ y β ball z 0
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
rw [mem_sphere_zero_iff_norm] at hx hy
exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ)
#align strict_convex_space.of_norm_add StrictConvexSpace.of_norm_add
variable [StrictConvexSpace β E] {x y z : E} {a b r : β}
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β·
|
rw [closedBall_zero, mem_singleton_iff] at hx hy
|
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β·
|
Mathlib.Analysis.Convex.StrictConvexSpace.155_0.LKetms5NIkPrXf9
|
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
case inl
π : Type u_1
E : Type u_2
instββ΄ : NormedLinearOrderedField π
instβΒ³ : NormedAddCommGroup E
instβΒ² : NormedSpace π E
instβΒΉ : NormedSpace β E
instβ : StrictConvexSpace β E
x y z : E
a b : β
hne : x β y
ha : 0 < a
hb : 0 < b
hab : a + b = 1
hx : x = z
hy : y = z
β’ a β’ x + b β’ y β ball z 0
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
rw [mem_sphere_zero_iff_norm] at hx hy
exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ)
#align strict_convex_space.of_norm_add StrictConvexSpace.of_norm_add
variable [StrictConvexSpace β E] {x y z : E} {a b r : β}
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β· rw [closedBall_zero, mem_singleton_iff] at hx hy
|
exact (hne (hx.trans hy.symm)).elim
|
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β· rw [closedBall_zero, mem_singleton_iff] at hx hy
|
Mathlib.Analysis.Convex.StrictConvexSpace.155_0.LKetms5NIkPrXf9
|
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
case inr
π : Type u_1
E : Type u_2
instββ΄ : NormedLinearOrderedField π
instβΒ³ : NormedAddCommGroup E
instβΒ² : NormedSpace π E
instβΒΉ : NormedSpace β E
instβ : StrictConvexSpace β E
x y z : E
a b r : β
hx : x β closedBall z r
hy : y β closedBall z r
hne : x β y
ha : 0 < a
hb : 0 < b
hab : a + b = 1
hr : r β 0
β’ a β’ x + b β’ y β ball z r
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
rw [mem_sphere_zero_iff_norm] at hx hy
exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ)
#align strict_convex_space.of_norm_add StrictConvexSpace.of_norm_add
variable [StrictConvexSpace β E] {x y z : E} {a b r : β}
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β· rw [closedBall_zero, mem_singleton_iff] at hx hy
exact (hne (hx.trans hy.symm)).elim
Β·
|
simp only [β interior_closedBall _ hr] at hx hy β’
|
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β· rw [closedBall_zero, mem_singleton_iff] at hx hy
exact (hne (hx.trans hy.symm)).elim
Β·
|
Mathlib.Analysis.Convex.StrictConvexSpace.155_0.LKetms5NIkPrXf9
|
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
case inr
π : Type u_1
E : Type u_2
instββ΄ : NormedLinearOrderedField π
instβΒ³ : NormedAddCommGroup E
instβΒ² : NormedSpace π E
instβΒΉ : NormedSpace β E
instβ : StrictConvexSpace β E
x y z : E
a b r : β
hx : x β closedBall z r
hy : y β closedBall z r
hne : x β y
ha : 0 < a
hb : 0 < b
hab : a + b = 1
hr : r β 0
β’ a β’ x + b β’ y β interior (closedBall z r)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
rw [mem_sphere_zero_iff_norm] at hx hy
exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ)
#align strict_convex_space.of_norm_add StrictConvexSpace.of_norm_add
variable [StrictConvexSpace β E] {x y z : E} {a b r : β}
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β· rw [closedBall_zero, mem_singleton_iff] at hx hy
exact (hne (hx.trans hy.symm)).elim
Β· simp only [β interior_closedBall _ hr] at hx hy β’
|
exact strictConvex_closedBall β z r hx hy hne ha hb hab
|
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β· rw [closedBall_zero, mem_singleton_iff] at hx hy
exact (hne (hx.trans hy.symm)).elim
Β· simp only [β interior_closedBall _ hr] at hx hy β’
|
Mathlib.Analysis.Convex.StrictConvexSpace.155_0.LKetms5NIkPrXf9
|
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instββ΄ : NormedLinearOrderedField π
instβΒ³ : NormedAddCommGroup E
instβΒ² : NormedSpace π E
instβΒΉ : NormedSpace β E
instβ : StrictConvexSpace β E
x y z : E
a b r : β
hx : βxβ β€ r
hy : βyβ β€ r
hne : x β y
ha : 0 < a
hb : 0 < b
hab : a + b = 1
β’ βa β’ x + b β’ yβ < r
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
rw [mem_sphere_zero_iff_norm] at hx hy
exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ)
#align strict_convex_space.of_norm_add StrictConvexSpace.of_norm_add
variable [StrictConvexSpace β E] {x y z : E} {a b r : β}
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β· rw [closedBall_zero, mem_singleton_iff] at hx hy
exact (hne (hx.trans hy.symm)).elim
Β· simp only [β interior_closedBall _ hr] at hx hy β’
exact strictConvex_closedBall β z r hx hy hne ha hb hab
#align combo_mem_ball_of_ne combo_mem_ball_of_ne
/-- If `x β y` belong to the same closed ball, then the open segment with endpoints `x` and `y` is
included in the corresponding open ball. -/
theorem openSegment_subset_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r)
(hne : x β y) : openSegment β x y β ball z r :=
(openSegment_subset_iff _).2 fun _ _ => combo_mem_ball_of_ne hx hy hne
#align open_segment_subset_ball_of_ne openSegment_subset_ball_of_ne
/-- If `x` and `y` are two distinct vectors of norm at most `r`, then a convex combination of `x`
and `y` with positive coefficients has norm strictly less than `r`. -/
theorem norm_combo_lt_of_ne (hx : βxβ β€ r) (hy : βyβ β€ r) (hne : x β y) (ha : 0 < a) (hb : 0 < b)
(hab : a + b = 1) : βa β’ x + b β’ yβ < r := by
|
simp only [β mem_ball_zero_iff, β mem_closedBall_zero_iff] at hx hy β’
|
/-- If `x` and `y` are two distinct vectors of norm at most `r`, then a convex combination of `x`
and `y` with positive coefficients has norm strictly less than `r`. -/
theorem norm_combo_lt_of_ne (hx : βxβ β€ r) (hy : βyβ β€ r) (hne : x β y) (ha : 0 < a) (hb : 0 < b)
(hab : a + b = 1) : βa β’ x + b β’ yβ < r := by
|
Mathlib.Analysis.Convex.StrictConvexSpace.173_0.LKetms5NIkPrXf9
|
/-- If `x` and `y` are two distinct vectors of norm at most `r`, then a convex combination of `x`
and `y` with positive coefficients has norm strictly less than `r`. -/
theorem norm_combo_lt_of_ne (hx : βxβ β€ r) (hy : βyβ β€ r) (hne : x β y) (ha : 0 < a) (hb : 0 < b)
(hab : a + b = 1) : βa β’ x + b β’ yβ < r
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instββ΄ : NormedLinearOrderedField π
instβΒ³ : NormedAddCommGroup E
instβΒ² : NormedSpace π E
instβΒΉ : NormedSpace β E
instβ : StrictConvexSpace β E
x y z : E
a b r : β
hne : x β y
ha : 0 < a
hb : 0 < b
hab : a + b = 1
hx : x β closedBall 0 r
hy : y β closedBall 0 r
β’ a β’ x + b β’ y β ball 0 r
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
rw [mem_sphere_zero_iff_norm] at hx hy
exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ)
#align strict_convex_space.of_norm_add StrictConvexSpace.of_norm_add
variable [StrictConvexSpace β E] {x y z : E} {a b r : β}
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β· rw [closedBall_zero, mem_singleton_iff] at hx hy
exact (hne (hx.trans hy.symm)).elim
Β· simp only [β interior_closedBall _ hr] at hx hy β’
exact strictConvex_closedBall β z r hx hy hne ha hb hab
#align combo_mem_ball_of_ne combo_mem_ball_of_ne
/-- If `x β y` belong to the same closed ball, then the open segment with endpoints `x` and `y` is
included in the corresponding open ball. -/
theorem openSegment_subset_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r)
(hne : x β y) : openSegment β x y β ball z r :=
(openSegment_subset_iff _).2 fun _ _ => combo_mem_ball_of_ne hx hy hne
#align open_segment_subset_ball_of_ne openSegment_subset_ball_of_ne
/-- If `x` and `y` are two distinct vectors of norm at most `r`, then a convex combination of `x`
and `y` with positive coefficients has norm strictly less than `r`. -/
theorem norm_combo_lt_of_ne (hx : βxβ β€ r) (hy : βyβ β€ r) (hne : x β y) (ha : 0 < a) (hb : 0 < b)
(hab : a + b = 1) : βa β’ x + b β’ yβ < r := by
simp only [β mem_ball_zero_iff, β mem_closedBall_zero_iff] at hx hy β’
|
exact combo_mem_ball_of_ne hx hy hne ha hb hab
|
/-- If `x` and `y` are two distinct vectors of norm at most `r`, then a convex combination of `x`
and `y` with positive coefficients has norm strictly less than `r`. -/
theorem norm_combo_lt_of_ne (hx : βxβ β€ r) (hy : βyβ β€ r) (hne : x β y) (ha : 0 < a) (hb : 0 < b)
(hab : a + b = 1) : βa β’ x + b β’ yβ < r := by
simp only [β mem_ball_zero_iff, β mem_closedBall_zero_iff] at hx hy β’
|
Mathlib.Analysis.Convex.StrictConvexSpace.173_0.LKetms5NIkPrXf9
|
/-- If `x` and `y` are two distinct vectors of norm at most `r`, then a convex combination of `x`
and `y` with positive coefficients has norm strictly less than `r`. -/
theorem norm_combo_lt_of_ne (hx : βxβ β€ r) (hy : βyβ β€ r) (hne : x β y) (ha : 0 < a) (hb : 0 < b)
(hab : a + b = 1) : βa β’ x + b β’ yβ < r
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instββ΄ : NormedLinearOrderedField π
instβΒ³ : NormedAddCommGroup E
instβΒ² : NormedSpace π E
instβΒΉ : NormedSpace β E
instβ : StrictConvexSpace β E
x y z : E
a b r : β
h : Β¬SameRay β x y
β’ βx + yβ < βxβ + βyβ
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
rw [mem_sphere_zero_iff_norm] at hx hy
exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ)
#align strict_convex_space.of_norm_add StrictConvexSpace.of_norm_add
variable [StrictConvexSpace β E] {x y z : E} {a b r : β}
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β· rw [closedBall_zero, mem_singleton_iff] at hx hy
exact (hne (hx.trans hy.symm)).elim
Β· simp only [β interior_closedBall _ hr] at hx hy β’
exact strictConvex_closedBall β z r hx hy hne ha hb hab
#align combo_mem_ball_of_ne combo_mem_ball_of_ne
/-- If `x β y` belong to the same closed ball, then the open segment with endpoints `x` and `y` is
included in the corresponding open ball. -/
theorem openSegment_subset_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r)
(hne : x β y) : openSegment β x y β ball z r :=
(openSegment_subset_iff _).2 fun _ _ => combo_mem_ball_of_ne hx hy hne
#align open_segment_subset_ball_of_ne openSegment_subset_ball_of_ne
/-- If `x` and `y` are two distinct vectors of norm at most `r`, then a convex combination of `x`
and `y` with positive coefficients has norm strictly less than `r`. -/
theorem norm_combo_lt_of_ne (hx : βxβ β€ r) (hy : βyβ β€ r) (hne : x β y) (ha : 0 < a) (hb : 0 < b)
(hab : a + b = 1) : βa β’ x + b β’ yβ < r := by
simp only [β mem_ball_zero_iff, β mem_closedBall_zero_iff] at hx hy β’
exact combo_mem_ball_of_ne hx hy hne ha hb hab
#align norm_combo_lt_of_ne norm_combo_lt_of_ne
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ := by
|
simp only [sameRay_iff_inv_norm_smul_eq, not_or, β Ne.def] at h
|
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ := by
|
Mathlib.Analysis.Convex.StrictConvexSpace.181_0.LKetms5NIkPrXf9
|
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instββ΄ : NormedLinearOrderedField π
instβΒ³ : NormedAddCommGroup E
instβΒ² : NormedSpace π E
instβΒΉ : NormedSpace β E
instβ : StrictConvexSpace β E
x y z : E
a b r : β
h : x β 0 β§ y β 0 β§ βxββ»ΒΉ β’ x β βyββ»ΒΉ β’ y
β’ βx + yβ < βxβ + βyβ
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
rw [mem_sphere_zero_iff_norm] at hx hy
exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ)
#align strict_convex_space.of_norm_add StrictConvexSpace.of_norm_add
variable [StrictConvexSpace β E] {x y z : E} {a b r : β}
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β· rw [closedBall_zero, mem_singleton_iff] at hx hy
exact (hne (hx.trans hy.symm)).elim
Β· simp only [β interior_closedBall _ hr] at hx hy β’
exact strictConvex_closedBall β z r hx hy hne ha hb hab
#align combo_mem_ball_of_ne combo_mem_ball_of_ne
/-- If `x β y` belong to the same closed ball, then the open segment with endpoints `x` and `y` is
included in the corresponding open ball. -/
theorem openSegment_subset_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r)
(hne : x β y) : openSegment β x y β ball z r :=
(openSegment_subset_iff _).2 fun _ _ => combo_mem_ball_of_ne hx hy hne
#align open_segment_subset_ball_of_ne openSegment_subset_ball_of_ne
/-- If `x` and `y` are two distinct vectors of norm at most `r`, then a convex combination of `x`
and `y` with positive coefficients has norm strictly less than `r`. -/
theorem norm_combo_lt_of_ne (hx : βxβ β€ r) (hy : βyβ β€ r) (hne : x β y) (ha : 0 < a) (hb : 0 < b)
(hab : a + b = 1) : βa β’ x + b β’ yβ < r := by
simp only [β mem_ball_zero_iff, β mem_closedBall_zero_iff] at hx hy β’
exact combo_mem_ball_of_ne hx hy hne ha hb hab
#align norm_combo_lt_of_ne norm_combo_lt_of_ne
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ := by
simp only [sameRay_iff_inv_norm_smul_eq, not_or, β Ne.def] at h
|
rcases h with β¨hx, hy, hneβ©
|
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ := by
simp only [sameRay_iff_inv_norm_smul_eq, not_or, β Ne.def] at h
|
Mathlib.Analysis.Convex.StrictConvexSpace.181_0.LKetms5NIkPrXf9
|
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
case intro.intro
π : Type u_1
E : Type u_2
instββ΄ : NormedLinearOrderedField π
instβΒ³ : NormedAddCommGroup E
instβΒ² : NormedSpace π E
instβΒΉ : NormedSpace β E
instβ : StrictConvexSpace β E
x y z : E
a b r : β
hx : x β 0
hy : y β 0
hne : βxββ»ΒΉ β’ x β βyββ»ΒΉ β’ y
β’ βx + yβ < βxβ + βyβ
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
rw [mem_sphere_zero_iff_norm] at hx hy
exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ)
#align strict_convex_space.of_norm_add StrictConvexSpace.of_norm_add
variable [StrictConvexSpace β E] {x y z : E} {a b r : β}
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β· rw [closedBall_zero, mem_singleton_iff] at hx hy
exact (hne (hx.trans hy.symm)).elim
Β· simp only [β interior_closedBall _ hr] at hx hy β’
exact strictConvex_closedBall β z r hx hy hne ha hb hab
#align combo_mem_ball_of_ne combo_mem_ball_of_ne
/-- If `x β y` belong to the same closed ball, then the open segment with endpoints `x` and `y` is
included in the corresponding open ball. -/
theorem openSegment_subset_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r)
(hne : x β y) : openSegment β x y β ball z r :=
(openSegment_subset_iff _).2 fun _ _ => combo_mem_ball_of_ne hx hy hne
#align open_segment_subset_ball_of_ne openSegment_subset_ball_of_ne
/-- If `x` and `y` are two distinct vectors of norm at most `r`, then a convex combination of `x`
and `y` with positive coefficients has norm strictly less than `r`. -/
theorem norm_combo_lt_of_ne (hx : βxβ β€ r) (hy : βyβ β€ r) (hne : x β y) (ha : 0 < a) (hb : 0 < b)
(hab : a + b = 1) : βa β’ x + b β’ yβ < r := by
simp only [β mem_ball_zero_iff, β mem_closedBall_zero_iff] at hx hy β’
exact combo_mem_ball_of_ne hx hy hne ha hb hab
#align norm_combo_lt_of_ne norm_combo_lt_of_ne
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ := by
simp only [sameRay_iff_inv_norm_smul_eq, not_or, β Ne.def] at h
rcases h with β¨hx, hy, hneβ©
|
rw [β norm_pos_iff] at hx hy
|
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ := by
simp only [sameRay_iff_inv_norm_smul_eq, not_or, β Ne.def] at h
rcases h with β¨hx, hy, hneβ©
|
Mathlib.Analysis.Convex.StrictConvexSpace.181_0.LKetms5NIkPrXf9
|
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
case intro.intro
π : Type u_1
E : Type u_2
instββ΄ : NormedLinearOrderedField π
instβΒ³ : NormedAddCommGroup E
instβΒ² : NormedSpace π E
instβΒΉ : NormedSpace β E
instβ : StrictConvexSpace β E
x y z : E
a b r : β
hx : 0 < βxβ
hy : 0 < βyβ
hne : βxββ»ΒΉ β’ x β βyββ»ΒΉ β’ y
β’ βx + yβ < βxβ + βyβ
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
rw [mem_sphere_zero_iff_norm] at hx hy
exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ)
#align strict_convex_space.of_norm_add StrictConvexSpace.of_norm_add
variable [StrictConvexSpace β E] {x y z : E} {a b r : β}
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β· rw [closedBall_zero, mem_singleton_iff] at hx hy
exact (hne (hx.trans hy.symm)).elim
Β· simp only [β interior_closedBall _ hr] at hx hy β’
exact strictConvex_closedBall β z r hx hy hne ha hb hab
#align combo_mem_ball_of_ne combo_mem_ball_of_ne
/-- If `x β y` belong to the same closed ball, then the open segment with endpoints `x` and `y` is
included in the corresponding open ball. -/
theorem openSegment_subset_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r)
(hne : x β y) : openSegment β x y β ball z r :=
(openSegment_subset_iff _).2 fun _ _ => combo_mem_ball_of_ne hx hy hne
#align open_segment_subset_ball_of_ne openSegment_subset_ball_of_ne
/-- If `x` and `y` are two distinct vectors of norm at most `r`, then a convex combination of `x`
and `y` with positive coefficients has norm strictly less than `r`. -/
theorem norm_combo_lt_of_ne (hx : βxβ β€ r) (hy : βyβ β€ r) (hne : x β y) (ha : 0 < a) (hb : 0 < b)
(hab : a + b = 1) : βa β’ x + b β’ yβ < r := by
simp only [β mem_ball_zero_iff, β mem_closedBall_zero_iff] at hx hy β’
exact combo_mem_ball_of_ne hx hy hne ha hb hab
#align norm_combo_lt_of_ne norm_combo_lt_of_ne
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ := by
simp only [sameRay_iff_inv_norm_smul_eq, not_or, β Ne.def] at h
rcases h with β¨hx, hy, hneβ©
rw [β norm_pos_iff] at hx hy
|
have hxy : 0 < βxβ + βyβ := add_pos hx hy
|
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ := by
simp only [sameRay_iff_inv_norm_smul_eq, not_or, β Ne.def] at h
rcases h with β¨hx, hy, hneβ©
rw [β norm_pos_iff] at hx hy
|
Mathlib.Analysis.Convex.StrictConvexSpace.181_0.LKetms5NIkPrXf9
|
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
case intro.intro
π : Type u_1
E : Type u_2
instββ΄ : NormedLinearOrderedField π
instβΒ³ : NormedAddCommGroup E
instβΒ² : NormedSpace π E
instβΒΉ : NormedSpace β E
instβ : StrictConvexSpace β E
x y z : E
a b r : β
hx : 0 < βxβ
hy : 0 < βyβ
hne : βxββ»ΒΉ β’ x β βyββ»ΒΉ β’ y
hxy : 0 < βxβ + βyβ
β’ βx + yβ < βxβ + βyβ
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
rw [mem_sphere_zero_iff_norm] at hx hy
exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ)
#align strict_convex_space.of_norm_add StrictConvexSpace.of_norm_add
variable [StrictConvexSpace β E] {x y z : E} {a b r : β}
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β· rw [closedBall_zero, mem_singleton_iff] at hx hy
exact (hne (hx.trans hy.symm)).elim
Β· simp only [β interior_closedBall _ hr] at hx hy β’
exact strictConvex_closedBall β z r hx hy hne ha hb hab
#align combo_mem_ball_of_ne combo_mem_ball_of_ne
/-- If `x β y` belong to the same closed ball, then the open segment with endpoints `x` and `y` is
included in the corresponding open ball. -/
theorem openSegment_subset_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r)
(hne : x β y) : openSegment β x y β ball z r :=
(openSegment_subset_iff _).2 fun _ _ => combo_mem_ball_of_ne hx hy hne
#align open_segment_subset_ball_of_ne openSegment_subset_ball_of_ne
/-- If `x` and `y` are two distinct vectors of norm at most `r`, then a convex combination of `x`
and `y` with positive coefficients has norm strictly less than `r`. -/
theorem norm_combo_lt_of_ne (hx : βxβ β€ r) (hy : βyβ β€ r) (hne : x β y) (ha : 0 < a) (hb : 0 < b)
(hab : a + b = 1) : βa β’ x + b β’ yβ < r := by
simp only [β mem_ball_zero_iff, β mem_closedBall_zero_iff] at hx hy β’
exact combo_mem_ball_of_ne hx hy hne ha hb hab
#align norm_combo_lt_of_ne norm_combo_lt_of_ne
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ := by
simp only [sameRay_iff_inv_norm_smul_eq, not_or, β Ne.def] at h
rcases h with β¨hx, hy, hneβ©
rw [β norm_pos_iff] at hx hy
have hxy : 0 < βxβ + βyβ := add_pos hx hy
|
have :=
combo_mem_ball_of_ne (inv_norm_smul_mem_closed_unit_ball x)
(inv_norm_smul_mem_closed_unit_ball y) hne (div_pos hx hxy) (div_pos hy hxy)
(by rw [β add_div, div_self hxy.ne'])
|
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ := by
simp only [sameRay_iff_inv_norm_smul_eq, not_or, β Ne.def] at h
rcases h with β¨hx, hy, hneβ©
rw [β norm_pos_iff] at hx hy
have hxy : 0 < βxβ + βyβ := add_pos hx hy
|
Mathlib.Analysis.Convex.StrictConvexSpace.181_0.LKetms5NIkPrXf9
|
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instββ΄ : NormedLinearOrderedField π
instβΒ³ : NormedAddCommGroup E
instβΒ² : NormedSpace π E
instβΒΉ : NormedSpace β E
instβ : StrictConvexSpace β E
x y z : E
a b r : β
hx : 0 < βxβ
hy : 0 < βyβ
hne : βxββ»ΒΉ β’ x β βyββ»ΒΉ β’ y
hxy : 0 < βxβ + βyβ
β’ βxβ / (βxβ + βyβ) + βyβ / (βxβ + βyβ) = 1
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
rw [mem_sphere_zero_iff_norm] at hx hy
exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ)
#align strict_convex_space.of_norm_add StrictConvexSpace.of_norm_add
variable [StrictConvexSpace β E] {x y z : E} {a b r : β}
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β· rw [closedBall_zero, mem_singleton_iff] at hx hy
exact (hne (hx.trans hy.symm)).elim
Β· simp only [β interior_closedBall _ hr] at hx hy β’
exact strictConvex_closedBall β z r hx hy hne ha hb hab
#align combo_mem_ball_of_ne combo_mem_ball_of_ne
/-- If `x β y` belong to the same closed ball, then the open segment with endpoints `x` and `y` is
included in the corresponding open ball. -/
theorem openSegment_subset_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r)
(hne : x β y) : openSegment β x y β ball z r :=
(openSegment_subset_iff _).2 fun _ _ => combo_mem_ball_of_ne hx hy hne
#align open_segment_subset_ball_of_ne openSegment_subset_ball_of_ne
/-- If `x` and `y` are two distinct vectors of norm at most `r`, then a convex combination of `x`
and `y` with positive coefficients has norm strictly less than `r`. -/
theorem norm_combo_lt_of_ne (hx : βxβ β€ r) (hy : βyβ β€ r) (hne : x β y) (ha : 0 < a) (hb : 0 < b)
(hab : a + b = 1) : βa β’ x + b β’ yβ < r := by
simp only [β mem_ball_zero_iff, β mem_closedBall_zero_iff] at hx hy β’
exact combo_mem_ball_of_ne hx hy hne ha hb hab
#align norm_combo_lt_of_ne norm_combo_lt_of_ne
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ := by
simp only [sameRay_iff_inv_norm_smul_eq, not_or, β Ne.def] at h
rcases h with β¨hx, hy, hneβ©
rw [β norm_pos_iff] at hx hy
have hxy : 0 < βxβ + βyβ := add_pos hx hy
have :=
combo_mem_ball_of_ne (inv_norm_smul_mem_closed_unit_ball x)
(inv_norm_smul_mem_closed_unit_ball y) hne (div_pos hx hxy) (div_pos hy hxy)
(by
|
rw [β add_div, div_self hxy.ne']
|
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ := by
simp only [sameRay_iff_inv_norm_smul_eq, not_or, β Ne.def] at h
rcases h with β¨hx, hy, hneβ©
rw [β norm_pos_iff] at hx hy
have hxy : 0 < βxβ + βyβ := add_pos hx hy
have :=
combo_mem_ball_of_ne (inv_norm_smul_mem_closed_unit_ball x)
(inv_norm_smul_mem_closed_unit_ball y) hne (div_pos hx hxy) (div_pos hy hxy)
(by
|
Mathlib.Analysis.Convex.StrictConvexSpace.181_0.LKetms5NIkPrXf9
|
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
case intro.intro
π : Type u_1
E : Type u_2
instββ΄ : NormedLinearOrderedField π
instβΒ³ : NormedAddCommGroup E
instβΒ² : NormedSpace π E
instβΒΉ : NormedSpace β E
instβ : StrictConvexSpace β E
x y z : E
a b r : β
hx : 0 < βxβ
hy : 0 < βyβ
hne : βxββ»ΒΉ β’ x β βyββ»ΒΉ β’ y
hxy : 0 < βxβ + βyβ
this : (βxβ / (βxβ + βyβ)) β’ βxββ»ΒΉ β’ x + (βyβ / (βxβ + βyβ)) β’ βyββ»ΒΉ β’ y β ball 0 1
β’ βx + yβ < βxβ + βyβ
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
rw [mem_sphere_zero_iff_norm] at hx hy
exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ)
#align strict_convex_space.of_norm_add StrictConvexSpace.of_norm_add
variable [StrictConvexSpace β E] {x y z : E} {a b r : β}
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β· rw [closedBall_zero, mem_singleton_iff] at hx hy
exact (hne (hx.trans hy.symm)).elim
Β· simp only [β interior_closedBall _ hr] at hx hy β’
exact strictConvex_closedBall β z r hx hy hne ha hb hab
#align combo_mem_ball_of_ne combo_mem_ball_of_ne
/-- If `x β y` belong to the same closed ball, then the open segment with endpoints `x` and `y` is
included in the corresponding open ball. -/
theorem openSegment_subset_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r)
(hne : x β y) : openSegment β x y β ball z r :=
(openSegment_subset_iff _).2 fun _ _ => combo_mem_ball_of_ne hx hy hne
#align open_segment_subset_ball_of_ne openSegment_subset_ball_of_ne
/-- If `x` and `y` are two distinct vectors of norm at most `r`, then a convex combination of `x`
and `y` with positive coefficients has norm strictly less than `r`. -/
theorem norm_combo_lt_of_ne (hx : βxβ β€ r) (hy : βyβ β€ r) (hne : x β y) (ha : 0 < a) (hb : 0 < b)
(hab : a + b = 1) : βa β’ x + b β’ yβ < r := by
simp only [β mem_ball_zero_iff, β mem_closedBall_zero_iff] at hx hy β’
exact combo_mem_ball_of_ne hx hy hne ha hb hab
#align norm_combo_lt_of_ne norm_combo_lt_of_ne
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ := by
simp only [sameRay_iff_inv_norm_smul_eq, not_or, β Ne.def] at h
rcases h with β¨hx, hy, hneβ©
rw [β norm_pos_iff] at hx hy
have hxy : 0 < βxβ + βyβ := add_pos hx hy
have :=
combo_mem_ball_of_ne (inv_norm_smul_mem_closed_unit_ball x)
(inv_norm_smul_mem_closed_unit_ball y) hne (div_pos hx hxy) (div_pos hy hxy)
(by rw [β add_div, div_self hxy.ne'])
|
rwa [mem_ball_zero_iff, div_eq_inv_mul, div_eq_inv_mul, mul_smul, mul_smul, smul_inv_smulβ hx.ne',
smul_inv_smulβ hy.ne', β smul_add, norm_smul, Real.norm_of_nonneg (inv_pos.2 hxy).le, β
div_eq_inv_mul, div_lt_one hxy] at this
|
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ := by
simp only [sameRay_iff_inv_norm_smul_eq, not_or, β Ne.def] at h
rcases h with β¨hx, hy, hneβ©
rw [β norm_pos_iff] at hx hy
have hxy : 0 < βxβ + βyβ := add_pos hx hy
have :=
combo_mem_ball_of_ne (inv_norm_smul_mem_closed_unit_ball x)
(inv_norm_smul_mem_closed_unit_ball y) hne (div_pos hx hxy) (div_pos hy hxy)
(by rw [β add_div, div_self hxy.ne'])
|
Mathlib.Analysis.Convex.StrictConvexSpace.181_0.LKetms5NIkPrXf9
|
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instββ΄ : NormedLinearOrderedField π
instβΒ³ : NormedAddCommGroup E
instβΒ² : NormedSpace π E
instβΒΉ : NormedSpace β E
instβ : StrictConvexSpace β E
x y z : E
a b r : β
h : Β¬SameRay β x y
β’ βxβ - βyβ < βx - yβ
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
rw [mem_sphere_zero_iff_norm] at hx hy
exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ)
#align strict_convex_space.of_norm_add StrictConvexSpace.of_norm_add
variable [StrictConvexSpace β E] {x y z : E} {a b r : β}
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β· rw [closedBall_zero, mem_singleton_iff] at hx hy
exact (hne (hx.trans hy.symm)).elim
Β· simp only [β interior_closedBall _ hr] at hx hy β’
exact strictConvex_closedBall β z r hx hy hne ha hb hab
#align combo_mem_ball_of_ne combo_mem_ball_of_ne
/-- If `x β y` belong to the same closed ball, then the open segment with endpoints `x` and `y` is
included in the corresponding open ball. -/
theorem openSegment_subset_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r)
(hne : x β y) : openSegment β x y β ball z r :=
(openSegment_subset_iff _).2 fun _ _ => combo_mem_ball_of_ne hx hy hne
#align open_segment_subset_ball_of_ne openSegment_subset_ball_of_ne
/-- If `x` and `y` are two distinct vectors of norm at most `r`, then a convex combination of `x`
and `y` with positive coefficients has norm strictly less than `r`. -/
theorem norm_combo_lt_of_ne (hx : βxβ β€ r) (hy : βyβ β€ r) (hne : x β y) (ha : 0 < a) (hb : 0 < b)
(hab : a + b = 1) : βa β’ x + b β’ yβ < r := by
simp only [β mem_ball_zero_iff, β mem_closedBall_zero_iff] at hx hy β’
exact combo_mem_ball_of_ne hx hy hne ha hb hab
#align norm_combo_lt_of_ne norm_combo_lt_of_ne
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ := by
simp only [sameRay_iff_inv_norm_smul_eq, not_or, β Ne.def] at h
rcases h with β¨hx, hy, hneβ©
rw [β norm_pos_iff] at hx hy
have hxy : 0 < βxβ + βyβ := add_pos hx hy
have :=
combo_mem_ball_of_ne (inv_norm_smul_mem_closed_unit_ball x)
(inv_norm_smul_mem_closed_unit_ball y) hne (div_pos hx hxy) (div_pos hy hxy)
(by rw [β add_div, div_self hxy.ne'])
rwa [mem_ball_zero_iff, div_eq_inv_mul, div_eq_inv_mul, mul_smul, mul_smul, smul_inv_smulβ hx.ne',
smul_inv_smulβ hy.ne', β smul_add, norm_smul, Real.norm_of_nonneg (inv_pos.2 hxy).le, β
div_eq_inv_mul, div_lt_one hxy] at this
#align norm_add_lt_of_not_same_ray norm_add_lt_of_not_sameRay
theorem lt_norm_sub_of_not_sameRay (h : Β¬SameRay β x y) : βxβ - βyβ < βx - yβ := by
|
nth_rw 1 [β sub_add_cancel x y] at h β’
|
theorem lt_norm_sub_of_not_sameRay (h : Β¬SameRay β x y) : βxβ - βyβ < βx - yβ := by
|
Mathlib.Analysis.Convex.StrictConvexSpace.197_0.LKetms5NIkPrXf9
|
theorem lt_norm_sub_of_not_sameRay (h : Β¬SameRay β x y) : βxβ - βyβ < βx - yβ
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instββ΄ : NormedLinearOrderedField π
instβΒ³ : NormedAddCommGroup E
instβΒ² : NormedSpace π E
instβΒΉ : NormedSpace β E
instβ : StrictConvexSpace β E
x y z : E
a b r : β
h : Β¬SameRay β (x - y + y) y
β’ βx - y + yβ - βyβ < βx - yβ
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
rw [mem_sphere_zero_iff_norm] at hx hy
exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ)
#align strict_convex_space.of_norm_add StrictConvexSpace.of_norm_add
variable [StrictConvexSpace β E] {x y z : E} {a b r : β}
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β· rw [closedBall_zero, mem_singleton_iff] at hx hy
exact (hne (hx.trans hy.symm)).elim
Β· simp only [β interior_closedBall _ hr] at hx hy β’
exact strictConvex_closedBall β z r hx hy hne ha hb hab
#align combo_mem_ball_of_ne combo_mem_ball_of_ne
/-- If `x β y` belong to the same closed ball, then the open segment with endpoints `x` and `y` is
included in the corresponding open ball. -/
theorem openSegment_subset_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r)
(hne : x β y) : openSegment β x y β ball z r :=
(openSegment_subset_iff _).2 fun _ _ => combo_mem_ball_of_ne hx hy hne
#align open_segment_subset_ball_of_ne openSegment_subset_ball_of_ne
/-- If `x` and `y` are two distinct vectors of norm at most `r`, then a convex combination of `x`
and `y` with positive coefficients has norm strictly less than `r`. -/
theorem norm_combo_lt_of_ne (hx : βxβ β€ r) (hy : βyβ β€ r) (hne : x β y) (ha : 0 < a) (hb : 0 < b)
(hab : a + b = 1) : βa β’ x + b β’ yβ < r := by
simp only [β mem_ball_zero_iff, β mem_closedBall_zero_iff] at hx hy β’
exact combo_mem_ball_of_ne hx hy hne ha hb hab
#align norm_combo_lt_of_ne norm_combo_lt_of_ne
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ := by
simp only [sameRay_iff_inv_norm_smul_eq, not_or, β Ne.def] at h
rcases h with β¨hx, hy, hneβ©
rw [β norm_pos_iff] at hx hy
have hxy : 0 < βxβ + βyβ := add_pos hx hy
have :=
combo_mem_ball_of_ne (inv_norm_smul_mem_closed_unit_ball x)
(inv_norm_smul_mem_closed_unit_ball y) hne (div_pos hx hxy) (div_pos hy hxy)
(by rw [β add_div, div_self hxy.ne'])
rwa [mem_ball_zero_iff, div_eq_inv_mul, div_eq_inv_mul, mul_smul, mul_smul, smul_inv_smulβ hx.ne',
smul_inv_smulβ hy.ne', β smul_add, norm_smul, Real.norm_of_nonneg (inv_pos.2 hxy).le, β
div_eq_inv_mul, div_lt_one hxy] at this
#align norm_add_lt_of_not_same_ray norm_add_lt_of_not_sameRay
theorem lt_norm_sub_of_not_sameRay (h : Β¬SameRay β x y) : βxβ - βyβ < βx - yβ := by
nth_rw 1 [β sub_add_cancel x y] at h β’
|
exact sub_lt_iff_lt_add.2 (norm_add_lt_of_not_sameRay fun H' => h <| H'.add_left SameRay.rfl)
|
theorem lt_norm_sub_of_not_sameRay (h : Β¬SameRay β x y) : βxβ - βyβ < βx - yβ := by
nth_rw 1 [β sub_add_cancel x y] at h β’
|
Mathlib.Analysis.Convex.StrictConvexSpace.197_0.LKetms5NIkPrXf9
|
theorem lt_norm_sub_of_not_sameRay (h : Β¬SameRay β x y) : βxβ - βyβ < βx - yβ
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instββ΄ : NormedLinearOrderedField π
instβΒ³ : NormedAddCommGroup E
instβΒ² : NormedSpace π E
instβΒΉ : NormedSpace β E
instβ : StrictConvexSpace β E
x y z : E
a b r : β
h : Β¬SameRay β x y
β’ |βxβ - βyβ| < βx - yβ
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
rw [mem_sphere_zero_iff_norm] at hx hy
exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ)
#align strict_convex_space.of_norm_add StrictConvexSpace.of_norm_add
variable [StrictConvexSpace β E] {x y z : E} {a b r : β}
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β· rw [closedBall_zero, mem_singleton_iff] at hx hy
exact (hne (hx.trans hy.symm)).elim
Β· simp only [β interior_closedBall _ hr] at hx hy β’
exact strictConvex_closedBall β z r hx hy hne ha hb hab
#align combo_mem_ball_of_ne combo_mem_ball_of_ne
/-- If `x β y` belong to the same closed ball, then the open segment with endpoints `x` and `y` is
included in the corresponding open ball. -/
theorem openSegment_subset_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r)
(hne : x β y) : openSegment β x y β ball z r :=
(openSegment_subset_iff _).2 fun _ _ => combo_mem_ball_of_ne hx hy hne
#align open_segment_subset_ball_of_ne openSegment_subset_ball_of_ne
/-- If `x` and `y` are two distinct vectors of norm at most `r`, then a convex combination of `x`
and `y` with positive coefficients has norm strictly less than `r`. -/
theorem norm_combo_lt_of_ne (hx : βxβ β€ r) (hy : βyβ β€ r) (hne : x β y) (ha : 0 < a) (hb : 0 < b)
(hab : a + b = 1) : βa β’ x + b β’ yβ < r := by
simp only [β mem_ball_zero_iff, β mem_closedBall_zero_iff] at hx hy β’
exact combo_mem_ball_of_ne hx hy hne ha hb hab
#align norm_combo_lt_of_ne norm_combo_lt_of_ne
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ := by
simp only [sameRay_iff_inv_norm_smul_eq, not_or, β Ne.def] at h
rcases h with β¨hx, hy, hneβ©
rw [β norm_pos_iff] at hx hy
have hxy : 0 < βxβ + βyβ := add_pos hx hy
have :=
combo_mem_ball_of_ne (inv_norm_smul_mem_closed_unit_ball x)
(inv_norm_smul_mem_closed_unit_ball y) hne (div_pos hx hxy) (div_pos hy hxy)
(by rw [β add_div, div_self hxy.ne'])
rwa [mem_ball_zero_iff, div_eq_inv_mul, div_eq_inv_mul, mul_smul, mul_smul, smul_inv_smulβ hx.ne',
smul_inv_smulβ hy.ne', β smul_add, norm_smul, Real.norm_of_nonneg (inv_pos.2 hxy).le, β
div_eq_inv_mul, div_lt_one hxy] at this
#align norm_add_lt_of_not_same_ray norm_add_lt_of_not_sameRay
theorem lt_norm_sub_of_not_sameRay (h : Β¬SameRay β x y) : βxβ - βyβ < βx - yβ := by
nth_rw 1 [β sub_add_cancel x y] at h β’
exact sub_lt_iff_lt_add.2 (norm_add_lt_of_not_sameRay fun H' => h <| H'.add_left SameRay.rfl)
#align lt_norm_sub_of_not_same_ray lt_norm_sub_of_not_sameRay
theorem abs_lt_norm_sub_of_not_sameRay (h : Β¬SameRay β x y) : |βxβ - βyβ| < βx - yβ := by
|
refine' abs_sub_lt_iff.2 β¨lt_norm_sub_of_not_sameRay h, _β©
|
theorem abs_lt_norm_sub_of_not_sameRay (h : Β¬SameRay β x y) : |βxβ - βyβ| < βx - yβ := by
|
Mathlib.Analysis.Convex.StrictConvexSpace.202_0.LKetms5NIkPrXf9
|
theorem abs_lt_norm_sub_of_not_sameRay (h : Β¬SameRay β x y) : |βxβ - βyβ| < βx - yβ
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instββ΄ : NormedLinearOrderedField π
instβΒ³ : NormedAddCommGroup E
instβΒ² : NormedSpace π E
instβΒΉ : NormedSpace β E
instβ : StrictConvexSpace β E
x y z : E
a b r : β
h : Β¬SameRay β x y
β’ βyβ - βxβ < βx - yβ
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
rw [mem_sphere_zero_iff_norm] at hx hy
exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ)
#align strict_convex_space.of_norm_add StrictConvexSpace.of_norm_add
variable [StrictConvexSpace β E] {x y z : E} {a b r : β}
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β· rw [closedBall_zero, mem_singleton_iff] at hx hy
exact (hne (hx.trans hy.symm)).elim
Β· simp only [β interior_closedBall _ hr] at hx hy β’
exact strictConvex_closedBall β z r hx hy hne ha hb hab
#align combo_mem_ball_of_ne combo_mem_ball_of_ne
/-- If `x β y` belong to the same closed ball, then the open segment with endpoints `x` and `y` is
included in the corresponding open ball. -/
theorem openSegment_subset_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r)
(hne : x β y) : openSegment β x y β ball z r :=
(openSegment_subset_iff _).2 fun _ _ => combo_mem_ball_of_ne hx hy hne
#align open_segment_subset_ball_of_ne openSegment_subset_ball_of_ne
/-- If `x` and `y` are two distinct vectors of norm at most `r`, then a convex combination of `x`
and `y` with positive coefficients has norm strictly less than `r`. -/
theorem norm_combo_lt_of_ne (hx : βxβ β€ r) (hy : βyβ β€ r) (hne : x β y) (ha : 0 < a) (hb : 0 < b)
(hab : a + b = 1) : βa β’ x + b β’ yβ < r := by
simp only [β mem_ball_zero_iff, β mem_closedBall_zero_iff] at hx hy β’
exact combo_mem_ball_of_ne hx hy hne ha hb hab
#align norm_combo_lt_of_ne norm_combo_lt_of_ne
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ := by
simp only [sameRay_iff_inv_norm_smul_eq, not_or, β Ne.def] at h
rcases h with β¨hx, hy, hneβ©
rw [β norm_pos_iff] at hx hy
have hxy : 0 < βxβ + βyβ := add_pos hx hy
have :=
combo_mem_ball_of_ne (inv_norm_smul_mem_closed_unit_ball x)
(inv_norm_smul_mem_closed_unit_ball y) hne (div_pos hx hxy) (div_pos hy hxy)
(by rw [β add_div, div_self hxy.ne'])
rwa [mem_ball_zero_iff, div_eq_inv_mul, div_eq_inv_mul, mul_smul, mul_smul, smul_inv_smulβ hx.ne',
smul_inv_smulβ hy.ne', β smul_add, norm_smul, Real.norm_of_nonneg (inv_pos.2 hxy).le, β
div_eq_inv_mul, div_lt_one hxy] at this
#align norm_add_lt_of_not_same_ray norm_add_lt_of_not_sameRay
theorem lt_norm_sub_of_not_sameRay (h : Β¬SameRay β x y) : βxβ - βyβ < βx - yβ := by
nth_rw 1 [β sub_add_cancel x y] at h β’
exact sub_lt_iff_lt_add.2 (norm_add_lt_of_not_sameRay fun H' => h <| H'.add_left SameRay.rfl)
#align lt_norm_sub_of_not_same_ray lt_norm_sub_of_not_sameRay
theorem abs_lt_norm_sub_of_not_sameRay (h : Β¬SameRay β x y) : |βxβ - βyβ| < βx - yβ := by
refine' abs_sub_lt_iff.2 β¨lt_norm_sub_of_not_sameRay h, _β©
|
rw [norm_sub_rev]
|
theorem abs_lt_norm_sub_of_not_sameRay (h : Β¬SameRay β x y) : |βxβ - βyβ| < βx - yβ := by
refine' abs_sub_lt_iff.2 β¨lt_norm_sub_of_not_sameRay h, _β©
|
Mathlib.Analysis.Convex.StrictConvexSpace.202_0.LKetms5NIkPrXf9
|
theorem abs_lt_norm_sub_of_not_sameRay (h : Β¬SameRay β x y) : |βxβ - βyβ| < βx - yβ
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instββ΄ : NormedLinearOrderedField π
instβΒ³ : NormedAddCommGroup E
instβΒ² : NormedSpace π E
instβΒΉ : NormedSpace β E
instβ : StrictConvexSpace β E
x y z : E
a b r : β
h : Β¬SameRay β x y
β’ βyβ - βxβ < βy - xβ
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
rw [mem_sphere_zero_iff_norm] at hx hy
exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ)
#align strict_convex_space.of_norm_add StrictConvexSpace.of_norm_add
variable [StrictConvexSpace β E] {x y z : E} {a b r : β}
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β· rw [closedBall_zero, mem_singleton_iff] at hx hy
exact (hne (hx.trans hy.symm)).elim
Β· simp only [β interior_closedBall _ hr] at hx hy β’
exact strictConvex_closedBall β z r hx hy hne ha hb hab
#align combo_mem_ball_of_ne combo_mem_ball_of_ne
/-- If `x β y` belong to the same closed ball, then the open segment with endpoints `x` and `y` is
included in the corresponding open ball. -/
theorem openSegment_subset_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r)
(hne : x β y) : openSegment β x y β ball z r :=
(openSegment_subset_iff _).2 fun _ _ => combo_mem_ball_of_ne hx hy hne
#align open_segment_subset_ball_of_ne openSegment_subset_ball_of_ne
/-- If `x` and `y` are two distinct vectors of norm at most `r`, then a convex combination of `x`
and `y` with positive coefficients has norm strictly less than `r`. -/
theorem norm_combo_lt_of_ne (hx : βxβ β€ r) (hy : βyβ β€ r) (hne : x β y) (ha : 0 < a) (hb : 0 < b)
(hab : a + b = 1) : βa β’ x + b β’ yβ < r := by
simp only [β mem_ball_zero_iff, β mem_closedBall_zero_iff] at hx hy β’
exact combo_mem_ball_of_ne hx hy hne ha hb hab
#align norm_combo_lt_of_ne norm_combo_lt_of_ne
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ := by
simp only [sameRay_iff_inv_norm_smul_eq, not_or, β Ne.def] at h
rcases h with β¨hx, hy, hneβ©
rw [β norm_pos_iff] at hx hy
have hxy : 0 < βxβ + βyβ := add_pos hx hy
have :=
combo_mem_ball_of_ne (inv_norm_smul_mem_closed_unit_ball x)
(inv_norm_smul_mem_closed_unit_ball y) hne (div_pos hx hxy) (div_pos hy hxy)
(by rw [β add_div, div_self hxy.ne'])
rwa [mem_ball_zero_iff, div_eq_inv_mul, div_eq_inv_mul, mul_smul, mul_smul, smul_inv_smulβ hx.ne',
smul_inv_smulβ hy.ne', β smul_add, norm_smul, Real.norm_of_nonneg (inv_pos.2 hxy).le, β
div_eq_inv_mul, div_lt_one hxy] at this
#align norm_add_lt_of_not_same_ray norm_add_lt_of_not_sameRay
theorem lt_norm_sub_of_not_sameRay (h : Β¬SameRay β x y) : βxβ - βyβ < βx - yβ := by
nth_rw 1 [β sub_add_cancel x y] at h β’
exact sub_lt_iff_lt_add.2 (norm_add_lt_of_not_sameRay fun H' => h <| H'.add_left SameRay.rfl)
#align lt_norm_sub_of_not_same_ray lt_norm_sub_of_not_sameRay
theorem abs_lt_norm_sub_of_not_sameRay (h : Β¬SameRay β x y) : |βxβ - βyβ| < βx - yβ := by
refine' abs_sub_lt_iff.2 β¨lt_norm_sub_of_not_sameRay h, _β©
rw [norm_sub_rev]
|
exact lt_norm_sub_of_not_sameRay (mt SameRay.symm h)
|
theorem abs_lt_norm_sub_of_not_sameRay (h : Β¬SameRay β x y) : |βxβ - βyβ| < βx - yβ := by
refine' abs_sub_lt_iff.2 β¨lt_norm_sub_of_not_sameRay h, _β©
rw [norm_sub_rev]
|
Mathlib.Analysis.Convex.StrictConvexSpace.202_0.LKetms5NIkPrXf9
|
theorem abs_lt_norm_sub_of_not_sameRay (h : Β¬SameRay β x y) : |βxβ - βyβ| < βx - yβ
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
π : Type u_1
E : Type u_2
instββ΄ : NormedLinearOrderedField π
instβΒ³ : NormedAddCommGroup E
instβΒ² : NormedSpace π E
instβΒΉ : NormedSpace β E
instβ : StrictConvexSpace β E
x y z : E
a b r : β
h : βxβ = βyβ
β’ β(1 / 2) β’ (x + y)β < βxβ β x β y
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies, Yury Kudryashov
-/
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.Convex.Strict
import Mathlib.Analysis.Normed.Order.Basic
import Mathlib.Analysis.NormedSpace.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.NormedSpace.AffineIsometry
#align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f"
/-!
# Strictly convex spaces
This file defines strictly convex spaces. A normed space is strictly convex if all closed balls are
strictly convex. This does **not** mean that the norm is strictly convex (in fact, it never is).
## Main definitions
`StrictConvexSpace`: a typeclass saying that a given normed space over a normed linear ordered
field (e.g., `β` or `β`) is strictly convex. The definition requires strict convexity of a closed
ball of positive radius with center at the origin; strict convexity of any other closed ball follows
from this assumption.
## Main results
In a strictly convex space, we prove
- `strictConvex_closedBall`: a closed ball is strictly convex.
- `combo_mem_ball_of_ne`, `openSegment_subset_ball_of_ne`, `norm_combo_lt_of_ne`:
a nontrivial convex combination of two points in a closed ball belong to the corresponding open
ball;
- `norm_add_lt_of_not_sameRay`, `sameRay_iff_norm_add`, `dist_add_dist_eq_iff`:
the triangle inequality `dist x y + dist y z β€ dist x z` is a strict inequality unless `y` belongs
to the segment `[x -[β] z]`.
- `Isometry.affineIsometryOfStrictConvexSpace`: an isometry of `NormedAddTorsor`s for real
normed spaces, strictly convex in the case of the codomain, is an affine isometry.
We also provide several lemmas that can be used as alternative constructors for `StrictConvex β E`:
- `StrictConvexSpace.of_strictConvex_closed_unit_ball`: if `closed_ball (0 : E) 1` is strictly
convex, then `E` is a strictly convex space;
- `StrictConvexSpace.of_norm_add`: if `βx + yβ = βxβ + βyβ` implies `SameRay β x y` for all
nonzero `x y : E`, then `E` is a strictly convex space.
## Implementation notes
While the definition is formulated for any normed linear ordered field, most of the lemmas are
formulated only for the case `π = β`.
## Tags
convex, strictly convex
-/
set_option autoImplicit true
open Set Metric
open Convex Pointwise
/-- A *strictly convex space* is a normed space where the closed balls are strictly convex. We only
require balls of positive radius with center at the origin to be strictly convex in the definition,
then prove that any closed ball is strictly convex in `strictConvex_closedBall` below.
See also `StrictConvexSpace.of_strictConvex_closed_unit_ball`. -/
class StrictConvexSpace (π E : Type*) [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E] : Prop where
strictConvex_closedBall : β r : β, 0 < r β StrictConvex π (closedBall (0 : E) r)
#align strict_convex_space StrictConvexSpace
variable (π : Type*) {E : Type*} [NormedLinearOrderedField π] [NormedAddCommGroup E]
[NormedSpace π E]
/-- A closed ball in a strictly convex space is strictly convex. -/
theorem strictConvex_closedBall [StrictConvexSpace π E] (x : E) (r : β) :
StrictConvex π (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr
Β· exact (subsingleton_closedBall x hr).strictConvex
rw [β vadd_closedBall_zero]
exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
#align strict_convex_closed_ball strictConvex_closedBall
variable [NormedSpace β E]
/-- A real normed vector space is strictly convex provided that the unit ball is strictly convex. -/
theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π β]
(h : StrictConvex π (closedBall (0 : E) 1)) : StrictConvexSpace π E :=
β¨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul rβ©
#align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
/-- Strict convexity is equivalent to `βa β’ x + b β’ yβ < 1` for all `x` and `y` of norm at most `1`
and all strictly positive `a` and `b` such that `a + b = 1`. This lemma shows that it suffices to
check this for points of norm one and some `a`, `b` such that `a + b = 1`. -/
theorem StrictConvexSpace.of_norm_combo_lt_one
(h : β x y : E, βxβ = 1 β βyβ = 1 β x β y β β a b : β, a + b = 1 β§ βa β’ x + b β’ yβ < 1) :
StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex' fun x hx y hy hne => _)
rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball,
mem_sphere_zero_iff_norm] at hx hy
rcases h x y hx hy hne with β¨a, b, hab, hltβ©
use b
rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff,
sub_eq_iff_eq_add.2 hab.symm]
#align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
theorem StrictConvexSpace.of_norm_combo_ne_one
(h :
β x y : E,
βxβ = 1 β βyβ = 1 β x β y β β a b : β, 0 β€ a β§ 0 β€ b β§ a + b = 1 β§ βa β’ x + b β’ yβ β 1) :
StrictConvexSpace β E := by
refine' StrictConvexSpace.of_strictConvex_closed_unit_ball β
((convex_closedBall _ _).strictConvex _)
simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise,
frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm]
intro x hx y hy hne
rcases h x y hx hy hne with β¨a, b, ha, hb, hab, hne'β©
exact β¨_, β¨a, b, ha, hb, hab, rflβ©, mt mem_sphere_zero_iff_norm.1 hne'β©
#align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
theorem StrictConvexSpace.of_norm_add_ne_two
(h : β β¦x y : Eβ¦, βxβ = 1 β βyβ = 1 β x β y β βx + yβ β 2) : StrictConvexSpace β E := by
refine'
StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne =>
β¨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, _β©
rw [β smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, β div_eq_inv_mul, Ne.def,
div_eq_one_iff_eq (two_ne_zero' β)]
exact h hx hy hne
#align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two
theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two
(h : (sphere (0 : E) 1).Pairwise fun x y => βx + yβ β 2) : StrictConvexSpace β E :=
StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy =>
h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy)
#align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
/-- If `βx + yβ = βxβ + βyβ` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
(h : β x y : E, βxβ = 1 β βyβ = 1 β βx + yβ = 2 β SameRay β x y) : StrictConvexSpace β E := by
refine' StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ => _
rw [mem_sphere_zero_iff_norm] at hx hy
exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ)
#align strict_convex_space.of_norm_add StrictConvexSpace.of_norm_add
variable [StrictConvexSpace β E] {x y z : E} {a b r : β}
/-- If `x β y` belong to the same closed ball, then a convex combination of `x` and `y` with
positive coefficients belongs to the corresponding open ball. -/
theorem combo_mem_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r) (hne : x β y)
(ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β’ x + b β’ y β ball z r := by
rcases eq_or_ne r 0 with (rfl | hr)
Β· rw [closedBall_zero, mem_singleton_iff] at hx hy
exact (hne (hx.trans hy.symm)).elim
Β· simp only [β interior_closedBall _ hr] at hx hy β’
exact strictConvex_closedBall β z r hx hy hne ha hb hab
#align combo_mem_ball_of_ne combo_mem_ball_of_ne
/-- If `x β y` belong to the same closed ball, then the open segment with endpoints `x` and `y` is
included in the corresponding open ball. -/
theorem openSegment_subset_ball_of_ne (hx : x β closedBall z r) (hy : y β closedBall z r)
(hne : x β y) : openSegment β x y β ball z r :=
(openSegment_subset_iff _).2 fun _ _ => combo_mem_ball_of_ne hx hy hne
#align open_segment_subset_ball_of_ne openSegment_subset_ball_of_ne
/-- If `x` and `y` are two distinct vectors of norm at most `r`, then a convex combination of `x`
and `y` with positive coefficients has norm strictly less than `r`. -/
theorem norm_combo_lt_of_ne (hx : βxβ β€ r) (hy : βyβ β€ r) (hne : x β y) (ha : 0 < a) (hb : 0 < b)
(hab : a + b = 1) : βa β’ x + b β’ yβ < r := by
simp only [β mem_ball_zero_iff, β mem_closedBall_zero_iff] at hx hy β’
exact combo_mem_ball_of_ne hx hy hne ha hb hab
#align norm_combo_lt_of_ne norm_combo_lt_of_ne
/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `βx + yβ < βxβ + βyβ`.
-/
theorem norm_add_lt_of_not_sameRay (h : Β¬SameRay β x y) : βx + yβ < βxβ + βyβ := by
simp only [sameRay_iff_inv_norm_smul_eq, not_or, β Ne.def] at h
rcases h with β¨hx, hy, hneβ©
rw [β norm_pos_iff] at hx hy
have hxy : 0 < βxβ + βyβ := add_pos hx hy
have :=
combo_mem_ball_of_ne (inv_norm_smul_mem_closed_unit_ball x)
(inv_norm_smul_mem_closed_unit_ball y) hne (div_pos hx hxy) (div_pos hy hxy)
(by rw [β add_div, div_self hxy.ne'])
rwa [mem_ball_zero_iff, div_eq_inv_mul, div_eq_inv_mul, mul_smul, mul_smul, smul_inv_smulβ hx.ne',
smul_inv_smulβ hy.ne', β smul_add, norm_smul, Real.norm_of_nonneg (inv_pos.2 hxy).le, β
div_eq_inv_mul, div_lt_one hxy] at this
#align norm_add_lt_of_not_same_ray norm_add_lt_of_not_sameRay
theorem lt_norm_sub_of_not_sameRay (h : Β¬SameRay β x y) : βxβ - βyβ < βx - yβ := by
nth_rw 1 [β sub_add_cancel x y] at h β’
exact sub_lt_iff_lt_add.2 (norm_add_lt_of_not_sameRay fun H' => h <| H'.add_left SameRay.rfl)
#align lt_norm_sub_of_not_same_ray lt_norm_sub_of_not_sameRay
theorem abs_lt_norm_sub_of_not_sameRay (h : Β¬SameRay β x y) : |βxβ - βyβ| < βx - yβ := by
refine' abs_sub_lt_iff.2 β¨lt_norm_sub_of_not_sameRay h, _β©
rw [norm_sub_rev]
exact lt_norm_sub_of_not_sameRay (mt SameRay.symm h)
#align abs_lt_norm_sub_of_not_same_ray abs_lt_norm_sub_of_not_sameRay
/-- In a strictly convex space, two vectors `x`, `y` are in the same ray if and only if the triangle
inequality for `x` and `y` becomes an equality. -/
theorem sameRay_iff_norm_add : SameRay β x y β βx + yβ = βxβ + βyβ :=
β¨SameRay.norm_add, fun h => Classical.not_not.1 fun h' => (norm_add_lt_of_not_sameRay h').ne hβ©
#align same_ray_iff_norm_add sameRay_iff_norm_add
/-- If `x` and `y` are two vectors in a strictly convex space have the same norm and the norm of
their sum is equal to the sum of their norms, then they are equal. -/
theorem eq_of_norm_eq_of_norm_add_eq (hβ : βxβ = βyβ) (hβ : βx + yβ = βxβ + βyβ) : x = y :=
(sameRay_iff_norm_add.mpr hβ).eq_of_norm_eq hβ
#align eq_of_norm_eq_of_norm_add_eq eq_of_norm_eq_of_norm_add_eq
/-- In a strictly convex space, two vectors `x`, `y` are not in the same ray if and only if the
triangle inequality for `x` and `y` is strict. -/
theorem not_sameRay_iff_norm_add_lt : Β¬SameRay β x y β βx + yβ < βxβ + βyβ :=
sameRay_iff_norm_add.not.trans (norm_add_le _ _).lt_iff_ne.symm
#align not_same_ray_iff_norm_add_lt not_sameRay_iff_norm_add_lt
theorem sameRay_iff_norm_sub : SameRay β x y β βx - yβ = |βxβ - βyβ| :=
β¨SameRay.norm_sub, fun h =>
Classical.not_not.1 fun h' => (abs_lt_norm_sub_of_not_sameRay h').ne' hβ©
#align same_ray_iff_norm_sub sameRay_iff_norm_sub
theorem not_sameRay_iff_abs_lt_norm_sub : Β¬SameRay β x y β |βxβ - βyβ| < βx - yβ :=
sameRay_iff_norm_sub.not.trans <| ne_comm.trans (abs_norm_sub_norm_le _ _).lt_iff_ne.symm
#align not_same_ray_iff_abs_lt_norm_sub not_sameRay_iff_abs_lt_norm_sub
theorem norm_midpoint_lt_iff (h : βxβ = βyβ) : β(1 / 2 : β) β’ (x + y)β < βxβ β x β y := by
|
rw [norm_smul, Real.norm_of_nonneg (one_div_nonneg.2 zero_le_two), β inv_eq_one_div, β
div_eq_inv_mul, div_lt_iff (zero_lt_two' β), mul_two, β not_sameRay_iff_of_norm_eq h,
not_sameRay_iff_norm_add_lt, h]
|
theorem norm_midpoint_lt_iff (h : βxβ = βyβ) : β(1 / 2 : β) β’ (x + y)β < βxβ β x β y := by
|
Mathlib.Analysis.Convex.StrictConvexSpace.235_0.LKetms5NIkPrXf9
|
theorem norm_midpoint_lt_iff (h : βxβ = βyβ) : β(1 / 2 : β) β’ (x + y)β < βxβ β x β y
|
Mathlib_Analysis_Convex_StrictConvexSpace
|
Ξ± : Type u_1
instβ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
s t : Finset Ξ±
a : Ξ±
n : β
h : t β s
hs : Shatters π s
u : Finset Ξ±
hu : u β t
β’ β u_1 β π, t β© u_1 = u
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
|
obtain β¨v, hv, rflβ© := hs (hu.trans h)
|
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
|
Mathlib.Combinatorics.SetFamily.Shatter.46_0.9SFN902fumqg7uv
|
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case intro.intro
Ξ± : Type u_1
instβ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
s t : Finset Ξ±
a : Ξ±
n : β
h : t β s
hs : Shatters π s
v : Finset Ξ±
hv : v β π
hu : s β© v β t
β’ β u β π, t β© u = s β© v
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h);
|
exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
|
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h);
|
Mathlib.Combinatorics.SetFamily.Shatter.46_0.9SFN902fumqg7uv
|
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t
|
Mathlib_Combinatorics_SetFamily_Shatter
|
Ξ± : Type u_1
instβ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
sβ tβ : Finset Ξ±
a : Ξ±
n : β
xβ : Finset.Nonempty π
t : Finset Ξ±
ht : t β β
s : Finset Ξ±
hs : s β π
β’ β
β© s = t
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by
|
rwa [empty_inter, eq_comm, β subset_empty]
|
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by
|
Mathlib.Combinatorics.SetFamily.Shatter.58_0.9SFN902fumqg7uv
|
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty
|
Mathlib_Combinatorics_SetFamily_Shatter
|
Ξ± : Type u_1
instβ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
s t : Finset Ξ±
a : Ξ±
n : β
h : Shatters π s
β’ (β u β π, s β© u = t) β t β s
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by
|
rintro β¨u, _, rflβ©
|
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by
|
Mathlib.Combinatorics.SetFamily.Shatter.61_0.9SFN902fumqg7uv
|
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case intro.intro
Ξ± : Type u_1
instβ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
s : Finset Ξ±
a : Ξ±
n : β
h : Shatters π s
u : Finset Ξ±
leftβ : u β π
β’ s β© u β s
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©;
|
exact inter_subset_left _ _
|
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©;
|
Mathlib.Combinatorics.SetFamily.Shatter.61_0.9SFN902fumqg7uv
|
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t
|
Mathlib_Combinatorics_SetFamily_Shatter
|
Ξ± : Type u_1
instβ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
s t : Finset Ξ±
a : Ξ±
n : β
h : Shatters π s
β’ image (fun t => s β© t) π = powerset s
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by
|
ext t
|
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by
|
Mathlib.Combinatorics.SetFamily.Shatter.64_0.9SFN902fumqg7uv
|
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case a
Ξ± : Type u_1
instβ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
s tβ : Finset Ξ±
a : Ξ±
n : β
h : Shatters π s
t : Finset Ξ±
β’ t β image (fun t => s β© t) π β t β powerset s
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t;
|
rw [mem_image, mem_powerset, h.subset_iff]
|
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t;
|
Mathlib.Combinatorics.SetFamily.Shatter.64_0.9SFN902fumqg7uv
|
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset
|
Mathlib_Combinatorics_SetFamily_Shatter
|
Ξ± : Type u_1
instβ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
s tβ : Finset Ξ±
a : Ξ±
n : β
h : image (fun t => s β© t) π = powerset s
t : Finset Ξ±
ht : t β s
β’ β u β π, s β© u = t
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by
|
rwa [β mem_powerset, β h, mem_image] at ht
|
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by
|
Mathlib.Combinatorics.SetFamily.Shatter.64_0.9SFN902fumqg7uv
|
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset
|
Mathlib_Combinatorics_SetFamily_Shatter
|
Ξ± : Type u_1
instβΒΉ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
s t : Finset Ξ±
a : Ξ±
n : β
instβ : Fintype Ξ±
β’ Shatters π univ β π = univ
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
|
rw [shatters_iff, powerset_univ]
|
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
|
Mathlib.Combinatorics.SetFamily.Shatter.71_0.9SFN902fumqg7uv
|
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ
|
Mathlib_Combinatorics_SetFamily_Shatter
|
Ξ± : Type u_1
instβΒΉ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
s t : Finset Ξ±
a : Ξ±
n : β
instβ : Fintype Ξ±
β’ image (fun t => univ β© t) π = univ β π = univ
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ];
|
simp_rw [univ_inter, image_id']
|
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ];
|
Mathlib.Combinatorics.SetFamily.Shatter.71_0.9SFN902fumqg7uv
|
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ
|
Mathlib_Combinatorics_SetFamily_Shatter
|
Ξ± : Type u_1
instβ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
s t : Finset Ξ±
a : Ξ±
n : β
β’ s β shatterer π β Shatters π s
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
|
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
|
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
|
Mathlib.Combinatorics.SetFamily.Shatter.77_0.9SFN902fumqg7uv
|
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s
|
Mathlib_Combinatorics_SetFamily_Shatter
|
Ξ± : Type u_1
instβ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
s t : Finset Ξ±
a : Ξ±
n : β
h : Shatters π s
β’ s β Finset.biUnion π powerset
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
|
simp_rw [mem_biUnion, mem_powerset]
|
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
|
Mathlib.Combinatorics.SetFamily.Shatter.77_0.9SFN902fumqg7uv
|
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s
|
Mathlib_Combinatorics_SetFamily_Shatter
|
Ξ± : Type u_1
instβ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
s t : Finset Ξ±
a : Ξ±
n : β
h : Shatters π s
β’ β a β π, s β a
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
|
exact h.exists_superset
|
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
|
Mathlib.Combinatorics.SetFamily.Shatter.77_0.9SFN902fumqg7uv
|
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s
|
Mathlib_Combinatorics_SetFamily_Shatter
|
Ξ± : Type u_1
instβ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
s t : Finset Ξ±
a : Ξ±
n : β
h : π β β¬
xβ : Finset Ξ±
β’ xβ β shatterer π β xβ β shatterer β¬
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by
|
simpa using Shatters.mono_left h
|
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by
|
Mathlib.Combinatorics.SetFamily.Shatter.82_0.9SFN902fumqg7uv
|
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer
|
Mathlib_Combinatorics_SetFamily_Shatter
|
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβ β¬ : Finset (Finset Ξ±)
sβ tβ : Finset Ξ±
a : Ξ±
n : β
π : Finset (Finset Ξ±)
s t : Finset Ξ±
β’ t β€ s β s β β(shatterer π) β t β β(shatterer π)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by
|
simpa using Shatters.mono_right
|
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by
|
Mathlib.Combinatorics.SetFamily.Shatter.88_0.9SFN902fumqg7uv
|
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±))
|
Mathlib_Combinatorics_SetFamily_Shatter
|
Ξ± : Type u_1
instβ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
s t : Finset Ξ±
a : Ξ±
n : β
β’ shatterer π = π β IsLowerSet βπ
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
|
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
|
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
|
Mathlib.Combinatorics.SetFamily.Shatter.91_0.9SFN902fumqg7uv
|
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±))
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_1
Ξ± : Type u_1
instβ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
s t : Finset Ξ±
a : Ξ±
n : β
h : shatterer π = π
β’ IsLowerSet βπ
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β·
|
rw [β h]
|
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β·
|
Mathlib.Combinatorics.SetFamily.Shatter.91_0.9SFN902fumqg7uv
|
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±))
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_1
Ξ± : Type u_1
instβ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
s t : Finset Ξ±
a : Ξ±
n : β
h : shatterer π = π
β’ IsLowerSet β(shatterer π)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
|
exact isLowerSet_shatterer _
|
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
|
Mathlib.Combinatorics.SetFamily.Shatter.91_0.9SFN902fumqg7uv
|
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±))
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_2
Ξ± : Type u_1
instβ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
sβ t : Finset Ξ±
a : Ξ±
n : β
h : IsLowerSet βπ
s : Finset Ξ±
hs : s β shatterer π
β’ s β π
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β·
|
obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
|
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β·
|
Mathlib.Combinatorics.SetFamily.Shatter.91_0.9SFN902fumqg7uv
|
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±))
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_2.intro.intro
Ξ± : Type u_1
instβ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
sβ tβ : Finset Ξ±
a : Ξ±
n : β
h : IsLowerSet βπ
s : Finset Ξ±
hs : s β shatterer π
t : Finset Ξ±
ht : t β π
hst : s β t
β’ s β π
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
|
exact h hst ht
|
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
|
Mathlib.Combinatorics.SetFamily.Shatter.91_0.9SFN902fumqg7uv
|
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±))
|
Mathlib_Combinatorics_SetFamily_Shatter
|
Ξ± : Type u_1
instβ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
s t : Finset Ξ±
a : Ξ±
n : β
β’ shatterer (shatterer π) = shatterer π
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by
|
simp
|
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by
|
Mathlib.Combinatorics.SetFamily.Shatter.98_0.9SFN902fumqg7uv
|
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer
|
Mathlib_Combinatorics_SetFamily_Shatter
|
Ξ± : Type u_1
instβ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
s t : Finset Ξ±
a : Ξ±
n : β
β’ Shatters (shatterer π) s β Shatters π s
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
|
simp_rw [β mem_shatterer, shatterer_idem]
|
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
|
Mathlib.Combinatorics.SetFamily.Shatter.100_0.9SFN902fumqg7uv
|
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s
|
Mathlib_Combinatorics_SetFamily_Shatter
|
Ξ± : Type u_1
instβ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
s t : Finset Ξ±
a : Ξ±
n : β
h : β t β π, a β t
ht : Shatters π t
β’ a β t
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
|
obtain β¨u, hu, htuβ© := ht.exists_superset
|
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
|
Mathlib.Combinatorics.SetFamily.Shatter.105_0.9SFN902fumqg7uv
|
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case intro.intro
Ξ± : Type u_1
instβ : DecidableEq Ξ±
π β¬ : Finset (Finset Ξ±)
s t : Finset Ξ±
a : Ξ±
n : β
h : β t β π, a β t
ht : Shatters π t
u : Finset Ξ±
hu : u β π
htu : t β u
β’ a β t
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset;
|
exact not_mem_mono htu <| h u hu
|
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset;
|
Mathlib.Combinatorics.SetFamily.Shatter.105_0.9SFN902fumqg7uv
|
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t
|
Mathlib_Combinatorics_SetFamily_Shatter
|
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβ β¬ : Finset (Finset Ξ±)
s t : Finset Ξ±
a : Ξ±
n : β
π : Finset (Finset Ξ±)
β’ card π β€ card (shatterer π)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
|
refine memberFamily_induction_on π ?_ ?_ ?_
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_1
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβ β¬ : Finset (Finset Ξ±)
s t : Finset Ξ±
a : Ξ±
n : β
π : Finset (Finset Ξ±)
β’ card β
β€ card (shatterer β
)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β·
|
simp
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β·
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_2
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβ β¬ : Finset (Finset Ξ±)
s t : Finset Ξ±
a : Ξ±
n : β
π : Finset (Finset Ξ±)
β’ card {β
} β€ card (shatterer {β
})
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β·
|
rfl
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β·
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβ β¬ : Finset (Finset Ξ±)
s t : Finset Ξ±
a : Ξ±
n : β
π : Finset (Finset Ξ±)
β’ β (a : Ξ±) β¦π : Finset (Finset Ξ±)β¦,
card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π)) β
card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π)) β card π β€ card (shatterer π)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
|
intros a π ihβ ihβ
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬ : Finset (Finset Ξ±)
s t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β’ card π β€ card (shatterer π)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
|
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
s t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
β’ card π β€ card (shatterer π)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
|
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case hβ¬
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
s t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
β’ card β¬ = card (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β·
|
refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β·
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case hβ¬
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
s t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
β’ β(shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π)) β {s | a β s}
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
|
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case hβ¬
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
s t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
β’ β (x : Finset Ξ±), Shatters (memberSubfamily a π) x β Shatters (nonMemberSubfamily a π) x β a β x
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
|
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
s t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
hβ¬ : card β¬ = card (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
β’ card π β€ card (shatterer π)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
|
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
s t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
hβ¬ : card β¬ = card (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
β’ card (memberSubfamily a π) + card (nonMemberSubfamily a π) β€ card (shatterer π)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
|
refine (add_le_add ihβ ihβ).trans ?_
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
s t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
hβ¬ : card β¬ = card (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
β’ card (shatterer (memberSubfamily a π)) + card (shatterer (nonMemberSubfamily a π)) β€ card (shatterer π)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
|
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
s t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
hβ¬ : card β¬ = card (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
β’ card (shatterer (memberSubfamily a π) βͺ shatterer (nonMemberSubfamily a π) βͺ β¬) β€ card (shatterer π)
case refine_3
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
s t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
hβ¬ : card β¬ = card (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
β’ Disjoint (shatterer (memberSubfamily a π) βͺ shatterer (nonMemberSubfamily a π)) β¬
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
|
swap
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
s t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
hβ¬ : card β¬ = card (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
β’ Disjoint (shatterer (memberSubfamily a π) βͺ shatterer (nonMemberSubfamily a π)) β¬
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β·
|
simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β·
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
s t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
hβ¬ : card β¬ = card (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
β’ β β¦a_1 : Finset Ξ±β¦,
Shatters (memberSubfamily a π) a_1 β¨ Shatters (nonMemberSubfamily a π) a_1 β
β x β shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π), Β¬insert a x = a_1
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
|
rintro _ (hs | hs) s - rfl
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3.inl
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
sβ t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
hβ¬ : card β¬ = card (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
s : Finset Ξ±
hs : Shatters (memberSubfamily a π) (insert a s)
β’ False
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β·
|
exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β·
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3.inr
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
sβ t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
hβ¬ : card β¬ = card (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
s : Finset Ξ±
hs : Shatters (nonMemberSubfamily a π) (insert a s)
β’ False
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β·
|
exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β·
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
s t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
hβ¬ : card β¬ = card (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
β’ card (shatterer (memberSubfamily a π) βͺ shatterer (nonMemberSubfamily a π) βͺ β¬) β€ card (shatterer π)
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
|
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3.refine_1
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
s t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
hβ¬ : card β¬ = card (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
β’ shatterer (memberSubfamily a π) β shatterer π
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
Β·
|
simp only [subset_iff, mem_shatterer]
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
Β·
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3.refine_1
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
s t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
hβ¬ : card β¬ = card (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
β’ β β¦x : Finset Ξ±β¦, Shatters (memberSubfamily a π) x β Shatters π x
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
Β· simp only [subset_iff, mem_shatterer]
|
rintro s hs t ht
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
Β· simp only [subset_iff, mem_shatterer]
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3.refine_1
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
sβ tβ : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
hβ¬ : card β¬ = card (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
s : Finset Ξ±
hs : Shatters (memberSubfamily a π) s
t : Finset Ξ±
ht : t β s
β’ β u β π, s β© u = t
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
Β· simp only [subset_iff, mem_shatterer]
rintro s hs t ht
|
obtain β¨u, hu, rflβ© := hs ht
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
Β· simp only [subset_iff, mem_shatterer]
rintro s hs t ht
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3.refine_1.intro.intro
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
sβ t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
hβ¬ : card β¬ = card (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
s : Finset Ξ±
hs : Shatters (memberSubfamily a π) s
u : Finset Ξ±
hu : u β memberSubfamily a π
ht : s β© u β s
β’ β u_1 β π, s β© u_1 = s β© u
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
Β· simp only [subset_iff, mem_shatterer]
rintro s hs t ht
obtain β¨u, hu, rflβ© := hs ht
|
rw [mem_memberSubfamily] at hu
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
Β· simp only [subset_iff, mem_shatterer]
rintro s hs t ht
obtain β¨u, hu, rflβ© := hs ht
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3.refine_1.intro.intro
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
sβ t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
hβ¬ : card β¬ = card (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
s : Finset Ξ±
hs : Shatters (memberSubfamily a π) s
u : Finset Ξ±
hu : insert a u β π β§ a β u
ht : s β© u β s
β’ β u_1 β π, s β© u_1 = s β© u
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
Β· simp only [subset_iff, mem_shatterer]
rintro s hs t ht
obtain β¨u, hu, rflβ© := hs ht
rw [mem_memberSubfamily] at hu
|
refine β¨insert a u, hu.1, inter_insert_of_not_mem fun ha β¦ ?_β©
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
Β· simp only [subset_iff, mem_shatterer]
rintro s hs t ht
obtain β¨u, hu, rflβ© := hs ht
rw [mem_memberSubfamily] at hu
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3.refine_1.intro.intro
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
sβ t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
hβ¬ : card β¬ = card (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
s : Finset Ξ±
hs : Shatters (memberSubfamily a π) s
u : Finset Ξ±
hu : insert a u β π β§ a β u
ht : s β© u β s
ha : a β s
β’ False
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
Β· simp only [subset_iff, mem_shatterer]
rintro s hs t ht
obtain β¨u, hu, rflβ© := hs ht
rw [mem_memberSubfamily] at hu
refine β¨insert a u, hu.1, inter_insert_of_not_mem fun ha β¦ ?_β©
|
obtain β¨v, hv, hsvβ© := hs.exists_inter_eq_singleton ha
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
Β· simp only [subset_iff, mem_shatterer]
rintro s hs t ht
obtain β¨u, hu, rflβ© := hs ht
rw [mem_memberSubfamily] at hu
refine β¨insert a u, hu.1, inter_insert_of_not_mem fun ha β¦ ?_β©
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3.refine_1.intro.intro.intro.intro
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
sβ t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
hβ¬ : card β¬ = card (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
s : Finset Ξ±
hs : Shatters (memberSubfamily a π) s
u : Finset Ξ±
hu : insert a u β π β§ a β u
ht : s β© u β s
ha : a β s
v : Finset Ξ±
hv : v β memberSubfamily a π
hsv : s β© v = {a}
β’ False
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
Β· simp only [subset_iff, mem_shatterer]
rintro s hs t ht
obtain β¨u, hu, rflβ© := hs ht
rw [mem_memberSubfamily] at hu
refine β¨insert a u, hu.1, inter_insert_of_not_mem fun ha β¦ ?_β©
obtain β¨v, hv, hsvβ© := hs.exists_inter_eq_singleton ha
|
rw [mem_memberSubfamily] at hv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
Β· simp only [subset_iff, mem_shatterer]
rintro s hs t ht
obtain β¨u, hu, rflβ© := hs ht
rw [mem_memberSubfamily] at hu
refine β¨insert a u, hu.1, inter_insert_of_not_mem fun ha β¦ ?_β©
obtain β¨v, hv, hsvβ© := hs.exists_inter_eq_singleton ha
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3.refine_1.intro.intro.intro.intro
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
sβ t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
hβ¬ : card β¬ = card (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
s : Finset Ξ±
hs : Shatters (memberSubfamily a π) s
u : Finset Ξ±
hu : insert a u β π β§ a β u
ht : s β© u β s
ha : a β s
v : Finset Ξ±
hv : insert a v β π β§ a β v
hsv : s β© v = {a}
β’ False
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
Β· simp only [subset_iff, mem_shatterer]
rintro s hs t ht
obtain β¨u, hu, rflβ© := hs ht
rw [mem_memberSubfamily] at hu
refine β¨insert a u, hu.1, inter_insert_of_not_mem fun ha β¦ ?_β©
obtain β¨v, hv, hsvβ© := hs.exists_inter_eq_singleton ha
rw [mem_memberSubfamily] at hv
|
rw [β singleton_subset_iff (a := a), β hsv] at hv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
Β· simp only [subset_iff, mem_shatterer]
rintro s hs t ht
obtain β¨u, hu, rflβ© := hs ht
rw [mem_memberSubfamily] at hu
refine β¨insert a u, hu.1, inter_insert_of_not_mem fun ha β¦ ?_β©
obtain β¨v, hv, hsvβ© := hs.exists_inter_eq_singleton ha
rw [mem_memberSubfamily] at hv
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3.refine_1.intro.intro.intro.intro
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
sβ t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
hβ¬ : card β¬ = card (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
s : Finset Ξ±
hs : Shatters (memberSubfamily a π) s
u : Finset Ξ±
hu : insert a u β π β§ a β u
ht : s β© u β s
ha : a β s
v : Finset Ξ±
hv : insert a v β π β§ Β¬s β© v β v
hsv : s β© v = {a}
β’ False
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
Β· simp only [subset_iff, mem_shatterer]
rintro s hs t ht
obtain β¨u, hu, rflβ© := hs ht
rw [mem_memberSubfamily] at hu
refine β¨insert a u, hu.1, inter_insert_of_not_mem fun ha β¦ ?_β©
obtain β¨v, hv, hsvβ© := hs.exists_inter_eq_singleton ha
rw [mem_memberSubfamily] at hv
rw [β singleton_subset_iff (a := a), β hsv] at hv
|
exact hv.2 <| inter_subset_right _ _
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
Β· simp only [subset_iff, mem_shatterer]
rintro s hs t ht
obtain β¨u, hu, rflβ© := hs ht
rw [mem_memberSubfamily] at hu
refine β¨insert a u, hu.1, inter_insert_of_not_mem fun ha β¦ ?_β©
obtain β¨v, hv, hsvβ© := hs.exists_inter_eq_singleton ha
rw [mem_memberSubfamily] at hv
rw [β singleton_subset_iff (a := a), β hsv] at hv
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3.refine_2
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
s t : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
hβ¬ : card β¬ = card (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
β’ β¬ β shatterer π
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
Β· simp only [subset_iff, mem_shatterer]
rintro s hs t ht
obtain β¨u, hu, rflβ© := hs ht
rw [mem_memberSubfamily] at hu
refine β¨insert a u, hu.1, inter_insert_of_not_mem fun ha β¦ ?_β©
obtain β¨v, hv, hsvβ© := hs.exists_inter_eq_singleton ha
rw [mem_memberSubfamily] at hv
rw [β singleton_subset_iff (a := a), β hsv] at hv
exact hv.2 <| inter_subset_right _ _
Β·
|
refine forall_image.2 fun s hs β¦ mem_shatterer.2 fun t ht β¦ ?_
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
Β· simp only [subset_iff, mem_shatterer]
rintro s hs t ht
obtain β¨u, hu, rflβ© := hs ht
rw [mem_memberSubfamily] at hu
refine β¨insert a u, hu.1, inter_insert_of_not_mem fun ha β¦ ?_β©
obtain β¨v, hv, hsvβ© := hs.exists_inter_eq_singleton ha
rw [mem_memberSubfamily] at hv
rw [β singleton_subset_iff (a := a), β hsv] at hv
exact hv.2 <| inter_subset_right _ _
Β·
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
case refine_3.refine_2
Ξ± : Type u_1
instβ : DecidableEq Ξ±
πβΒΉ β¬β : Finset (Finset Ξ±)
sβ tβ : Finset Ξ±
aβ : Ξ±
n : β
πβ : Finset (Finset Ξ±)
a : Ξ±
π : Finset (Finset Ξ±)
ihβ : card (nonMemberSubfamily a π) β€ card (shatterer (nonMemberSubfamily a π))
ihβ : card (memberSubfamily a π) β€ card (shatterer (memberSubfamily a π))
β¬ : Finset (Finset Ξ±) := image (insert a) (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
hβ¬ : card β¬ = card (shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π))
s : Finset Ξ±
hs : s β shatterer (memberSubfamily a π) β© shatterer (nonMemberSubfamily a π)
t : Finset Ξ±
ht : t β insert a s
β’ β u β π, insert a s β© u = t
|
/-
Copyright (c) 2022 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Nat.Interval
import Mathlib.Order.UpperLower.Basic
import Mathlib.Combinatorics.SetFamily.Compression.Down
/-!
# Shattering families
This file defines the shattering property and VC-dimension of set families.
## Main declarations
* `Finset.Shatters`: The shattering property.
* `Finset.shatterer`: The set family of sets shattered by a set family.
* `Finset.vcDim`: The Vapnik-Chervonenkis dimension.
## TODO
* Order-shattering
* Strong shattering
-/
open scoped BigOperators FinsetFamily
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] {π β¬ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {n : β}
/-- A set family `π` shatters a set `s` if all subsets of `s` can be obtained as the intersection
of `s` and some element of the set family, and we denote this `π.Shatters s`. We also say that `s`
is *traced* by `π`. -/
def Shatters (π : Finset (Finset Ξ±)) (s : Finset Ξ±) : Prop := β β¦tβ¦, t β s β β u β π, s β© u = t
instance : DecidablePred π.Shatters := fun _s β¦ decidableForallOfDecidableSubsets
lemma Shatters.exists_inter_eq_singleton (hs : Shatters π s) (ha : a β s) : β t β π, s β© t = {a} :=
hs <| singleton_subset_iff.2 ha
lemma Shatters.mono_left (h : π β β¬) (hπ : π.Shatters s) : β¬.Shatters s :=
fun _t ht β¦ let β¨u, hu, hutβ© := hπ ht; β¨u, h hu, hutβ©
lemma Shatters.mono_right (h : t β s) (hs : π.Shatters s) : π.Shatters t := fun u hu β¦ by
obtain β¨v, hv, rflβ© := hs (hu.trans h); exact β¨v, hv, inf_congr_right hu <| inf_le_of_left_le hβ©
lemma Shatters.exists_superset (h : π.Shatters s) : β t β π, s β t :=
let β¨t, ht, hstβ© := h Subset.rfl; β¨t, ht, inter_eq_left.1 hstβ©
lemma shatters_of_forall_subset (h : β t, t β s β t β π) : π.Shatters s :=
fun t ht β¦ β¨t, h _ ht, inter_eq_right.2 htβ©
protected lemma Shatters.nonempty (h : π.Shatters s) : π.Nonempty :=
let β¨t, ht, _β© := h Subset.rfl; β¨t, htβ©
@[simp] lemma shatters_empty : π.Shatters β
β π.Nonempty :=
β¨Shatters.nonempty, fun β¨s, hsβ© t ht β¦ β¨s, hs, by rwa [empty_inter, eq_comm, β subset_empty]β©β©
protected lemma Shatters.subset_iff (h : π.Shatters s) : t β s β β u β π, s β© u = t :=
β¨fun ht β¦ h ht, by rintro β¨u, _, rflβ©; exact inter_subset_left _ _β©
lemma shatters_iff : π.Shatters s β π.image (fun t β¦ s β© t) = s.powerset :=
β¨fun h β¦ by ext t; rw [mem_image, mem_powerset, h.subset_iff],
fun h t ht β¦ by rwa [β mem_powerset, β h, mem_image] at htβ©
lemma univ_shatters [Fintype Ξ±] : univ.Shatters s :=
shatters_of_forall_subset <| fun _ _ β¦ mem_univ _
@[simp] lemma shatters_univ [Fintype Ξ±] : π.Shatters univ β π = univ := by
rw [shatters_iff, powerset_univ]; simp_rw [univ_inter, image_id']
/-- The set family of sets that are shattered by `π`. -/
def shatterer (π : Finset (Finset Ξ±)) : Finset (Finset Ξ±) := (π.biUnion powerset).filter π.Shatters
@[simp] lemma mem_shatterer : s β π.shatterer β π.Shatters s := by
refine mem_filter.trans <| and_iff_right_of_imp <| fun h β¦ ?_
simp_rw [mem_biUnion, mem_powerset]
exact h.exists_superset
lemma shatterer_mono (h : π β β¬) : π.shatterer β β¬.shatterer :=
fun _ β¦ by simpa using Shatters.mono_left h
lemma subset_shatterer (h : IsLowerSet (π : Set (Finset Ξ±))) : π β π.shatterer :=
fun _s hs β¦ mem_shatterer.2 <| fun t ht β¦ β¨t, h ht hs, inter_eq_right.2 htβ©
@[simp] lemma isLowerSet_shatterer (π : Finset (Finset Ξ±)) :
IsLowerSet (π.shatterer : Set (Finset Ξ±)) := fun s t β¦ by simpa using Shatters.mono_right
@[simp] lemma shatterer_eq : π.shatterer = π β IsLowerSet (π : Set (Finset Ξ±)) := by
refine β¨fun h β¦ ?_, fun h β¦ Subset.antisymm (fun s hs β¦ ?_) <| subset_shatterer hβ©
Β· rw [β h]
exact isLowerSet_shatterer _
Β· obtain β¨t, ht, hstβ© := (mem_shatterer.1 hs).exists_superset
exact h hst ht
@[simp] lemma shatterer_idem : π.shatterer.shatterer = π.shatterer := by simp
@[simp] lemma shatters_shatterer : π.shatterer.Shatters s β π.Shatters s := by
simp_rw [β mem_shatterer, shatterer_idem]
protected alias β¨_, Shatters.shattererβ© := shatters_shatterer
private lemma aux (h : β t β π, a β t) (ht : π.Shatters t) : a β t := by
obtain β¨u, hu, htuβ© := ht.exists_superset; exact not_mem_mono htu <| h u hu
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
Β· simp only [subset_iff, mem_shatterer]
rintro s hs t ht
obtain β¨u, hu, rflβ© := hs ht
rw [mem_memberSubfamily] at hu
refine β¨insert a u, hu.1, inter_insert_of_not_mem fun ha β¦ ?_β©
obtain β¨v, hv, hsvβ© := hs.exists_inter_eq_singleton ha
rw [mem_memberSubfamily] at hv
rw [β singleton_subset_iff (a := a), β hsv] at hv
exact hv.2 <| inter_subset_right _ _
Β· refine forall_image.2 fun s hs β¦ mem_shatterer.2 fun t ht β¦ ?_
|
simp only [mem_inter, mem_shatterer] at hs
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card := by
refine memberFamily_induction_on π ?_ ?_ ?_
Β· simp
Β· rfl
intros a π ihβ ihβ
set β¬ : Finset (Finset Ξ±) :=
((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).image (insert a)
have h⬠:
β¬.card = ((memberSubfamily a π).shatterer β© (nonMemberSubfamily a π).shatterer).card
Β· refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
mem_shatterer]
exact fun s _ β¦ aux (fun t ht β¦ (mem_filter.1 ht).2)
rw [β card_memberSubfamily_add_card_nonMemberSubfamily a]
refine (add_le_add ihβ ihβ).trans ?_
rw [β card_union_add_card_inter, β hβ¬, β card_disjoint_union]
swap
Β· simp only [disjoint_left, mem_union, mem_shatterer, mem_image, not_exists, not_and]
rintro _ (hs | hs) s - rfl
Β· exact aux (fun t ht β¦ (mem_memberSubfamily.1 ht).2) hs <| mem_insert_self _ _
Β· exact aux (fun t ht β¦ (mem_nonMemberSubfamily.1 ht).2) hs <| mem_insert_self _ _
refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_
Β· simp only [subset_iff, mem_shatterer]
rintro s hs t ht
obtain β¨u, hu, rflβ© := hs ht
rw [mem_memberSubfamily] at hu
refine β¨insert a u, hu.1, inter_insert_of_not_mem fun ha β¦ ?_β©
obtain β¨v, hv, hsvβ© := hs.exists_inter_eq_singleton ha
rw [mem_memberSubfamily] at hv
rw [β singleton_subset_iff (a := a), β hsv] at hv
exact hv.2 <| inter_subset_right _ _
Β· refine forall_image.2 fun s hs β¦ mem_shatterer.2 fun t ht β¦ ?_
|
Mathlib.Combinatorics.SetFamily.Shatter.108_0.9SFN902fumqg7uv
|
/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (π : Finset (Finset Ξ±)) : π.card β€ π.shatterer.card
|
Mathlib_Combinatorics_SetFamily_Shatter
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.