l3lab/ntp-mathlib huggingface dataset:
theorem ofRestrict_top_c (X : PresheafedSpace C) :
    (X.ofRestrict (Opens.openEmbedding ⊤)).c =
      eqToHom
        (by
          rw [restrict_top_presheaf, ← Presheaf.Pushforward.comp_eq]
          erw [Iso.inv_hom_id]
          rw [Presheaf.Pushforward.id_eq]) := by
  /- another approach would be to prove the left hand side
       is a natural isomorphism, but I encountered a universe
       issue when `apply NatIso.isIso_of_isIso_app`. -/
  ext
  dsimp [ofRestrict]
  erw [eqToHom_map, eqToHom_app]
  

Proof state:
case w.p
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X : PresheafedSpace C
U✝ : Opens ↑↑X
⊢ op U✝ = op ((IsOpenMap.functor (_ : IsOpenMap ⇑(Opens.inclusion ⊤))).obj ((Opens.map (Opens.inclusion ⊤)).obj U✝))
case w.p
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X : PresheafedSpace C
U✝ : Opens ↑↑X
⊢ op U✝ = op ((IsOpenMap.functor (_ : IsOpenMap ⇑(Opens.inclusion ⊤))).obj ((Opens.map (Opens.inclusion ⊤)).obj U✝))

Next tactic:
simp
/-- The isomorphism from the restriction to the top subspace.
-/
@[simps]
def restrictTopIso (X : PresheafedSpace C) : X.restrict (Opens.openEmbedding ⊤) ≅ X where
  hom := X.ofRestrict _
  inv := X.toRestrictTop
  hom_inv_id := by
    

Proof state:
C : Type u_1
inst✝ : Category.{?u.279806, u_1} C
X : PresheafedSpace C
⊢ ofRestrict X (_ : OpenEmbedding ⇑(Opens.inclusion ⊤)) ≫ toRestrictTop X =
    𝟙 (restrict X (_ : OpenEmbedding ⇑(Opens.inclusion ⊤)))

Next tactic:
ext
/-- The isomorphism from the restriction to the top subspace.
-/
@[simps]
def restrictTopIso (X : PresheafedSpace C) : X.restrict (Opens.openEmbedding ⊤) ≅ X where
  hom := X.ofRestrict _
  inv := X.toRestrictTop
  hom_inv_id := by
    ext
    · 

Proof state:
case w.w
C : Type u_1
inst✝ : Category.{?u.279806, u_1} C
X : PresheafedSpace C
x✝ : (CategoryTheory.forget TopCat).obj ↑(restrict X (_ : OpenEmbedding ⇑(Opens.inclusion ⊤)))
⊢ (ofRestrict X (_ : OpenEmbedding ⇑(Opens.inclusion ⊤)) ≫ toRestrictTop X).base x✝ =
    (𝟙 (restrict X (_ : OpenEmbedding ⇑(Opens.inclusion ⊤)))).base x✝

Next tactic:
rfl
/-- The isomorphism from the restriction to the top subspace.
-/
@[simps]
def restrictTopIso (X : PresheafedSpace C) : X.restrict (Opens.openEmbedding ⊤) ≅ X where
  hom := X.ofRestrict _
  inv := X.toRestrictTop
  hom_inv_id := by
    ext
    · rfl
    · 

Proof state:
case h.w
C : Type u_1
inst✝ : Category.{?u.279806, u_1} C
X : PresheafedSpace C
U✝ : Opens ↑↑(restrict X (_ : OpenEmbedding ⇑(Opens.inclusion ⊤)))
⊢ ((ofRestrict X (_ : OpenEmbedding ⇑(Opens.inclusion ⊤)) ≫ toRestrictTop X).c ≫
          whiskerRight
            (eqToHom
              (_ :
                (Opens.map (ofRestrict X (_ : OpenEmbedding ⇑(Opens.inclusion ⊤)) ≫ toRestrictTop X).base).op =
                  (Opens.map (𝟙 (restrict X (_ : OpenEmbedding ⇑(Opens.inclusion ⊤)))).base).op))
            (restrict X (_ : OpenEmbedding ⇑(Opens.inclusion ⊤))).presheaf).app
      (op U✝) =
    (𝟙 (restrict X (_ : OpenEmbedding ⇑(Opens.inclusion ⊤)))).c.app (op U✝)

Next tactic:
dsimp
/-- The isomorphism from the restriction to the top subspace.
-/
@[simps]
def restrictTopIso (X : PresheafedSpace C) : X.restrict (Opens.openEmbedding ⊤) ≅ X where
  hom := X.ofRestrict _
  inv := X.toRestrictTop
  hom_inv_id := by
    ext
    · rfl
    · dsimp
      

Proof state:
case h.w
C : Type u_1
inst✝ : Category.{?u.279806, u_1} C
X : PresheafedSpace C
U✝ : Opens ↑↑(restrict X (_ : OpenEmbedding ⇑(Opens.inclusion ⊤)))
⊢ ((ofRestrict X (_ : OpenEmbedding ⇑(Opens.inclusion ⊤)) ≫ toRestrictTop X).c ≫
          whiskerRight (𝟙 (Opens.map (Opens.inclusion ⊤ ≫ (Opens.inclusionTopIso ↑X).inv)).op)
            ((IsOpenMap.functor (_ : IsOpenMap ⇑(Opens.inclusion ⊤))).op ⋙ X.presheaf)).app
      (op U✝) =
    (𝟙 (restrict X (_ : OpenEmbedding ⇑(Opens.inclusion ⊤)))).c.app (op U✝)

Next tactic:
erw [comp_c, toRestrictTop_c, whiskerRight_id',
        comp_id, ofRestrict_top_c, eqToHom_map, eqToHom_trans, eqToHom_refl]
/-- The isomorphism from the restriction to the top subspace.
-/
@[simps]
def restrictTopIso (X : PresheafedSpace C) : X.restrict (Opens.openEmbedding ⊤) ≅ X where
  hom := X.ofRestrict _
  inv := X.toRestrictTop
  hom_inv_id := by
    ext
    · rfl
    · dsimp
      erw [comp_c, toRestrictTop_c, whiskerRight_id',
        comp_id, ofRestrict_top_c, eqToHom_map, eqToHom_trans, eqToHom_refl]
      

Proof state:
case h.w
C : Type u_1
inst✝ : Category.{?u.279806, u_1} C
X : PresheafedSpace C
U✝ : Opens ↑↑(restrict X (_ : OpenEmbedding ⇑(Opens.inclusion ⊤)))
⊢ (𝟙 (restrict X (_ : OpenEmbedding ⇑(Opens.inclusion ⊤))).presheaf).app (op U✝) =
    (𝟙 (restrict X (_ : OpenEmbedding ⇑(Opens.inclusion ⊤)))).c.app (op U✝)

Next tactic:
rfl
/-- The isomorphism from the restriction to the top subspace.
-/
@[simps]
def restrictTopIso (X : PresheafedSpace C) : X.restrict (Opens.openEmbedding ⊤) ≅ X where
  hom := X.ofRestrict _
  inv := X.toRestrictTop
  hom_inv_id := by
    ext
    · rfl
    · dsimp
      erw [comp_c, toRestrictTop_c, whiskerRight_id',
        comp_id, ofRestrict_top_c, eqToHom_map, eqToHom_trans, eqToHom_refl]
      rfl
  inv_hom_id := by
    

Proof state:
C : Type u_1
inst✝ : Category.{?u.279806, u_1} C
X : PresheafedSpace C
⊢ toRestrictTop X ≫ ofRestrict X (_ : OpenEmbedding ⇑(Opens.inclusion ⊤)) = 𝟙 X

Next tactic:
ext
/-- The isomorphism from the restriction to the top subspace.
-/
@[simps]
def restrictTopIso (X : PresheafedSpace C) : X.restrict (Opens.openEmbedding ⊤) ≅ X where
  hom := X.ofRestrict _
  inv := X.toRestrictTop
  hom_inv_id := by
    ext
    · rfl
    · dsimp
      erw [comp_c, toRestrictTop_c, whiskerRight_id',
        comp_id, ofRestrict_top_c, eqToHom_map, eqToHom_trans, eqToHom_refl]
      rfl
  inv_hom_id := by
    ext
    · 

Proof state:
case w.w
C : Type u_1
inst✝ : Category.{?u.279806, u_1} C
X : PresheafedSpace C
x✝ : (CategoryTheory.forget TopCat).obj ↑X
⊢ (toRestrictTop X ≫ ofRestrict X (_ : OpenEmbedding ⇑(Opens.inclusion ⊤))).base x✝ = (𝟙 X).base x✝

Next tactic:
rfl
/-- The isomorphism from the restriction to the top subspace.
-/
@[simps]
def restrictTopIso (X : PresheafedSpace C) : X.restrict (Opens.openEmbedding ⊤) ≅ X where
  hom := X.ofRestrict _
  inv := X.toRestrictTop
  hom_inv_id := by
    ext
    · rfl
    · dsimp
      erw [comp_c, toRestrictTop_c, whiskerRight_id',
        comp_id, ofRestrict_top_c, eqToHom_map, eqToHom_trans, eqToHom_refl]
      rfl
  inv_hom_id := by
    ext
    · rfl
    · 

Proof state:
case h.w
C : Type u_1
inst✝ : Category.{?u.279806, u_1} C
X : PresheafedSpace C
U✝ : Opens ↑↑X
⊢ ((toRestrictTop X ≫ ofRestrict X (_ : OpenEmbedding ⇑(Opens.inclusion ⊤))).c ≫
          whiskerRight
            (eqToHom
              (_ :
                (Opens.map (toRestrictTop X ≫ ofRestrict X (_ : OpenEmbedding ⇑(Opens.inclusion ⊤))).base).op =
                  (Opens.map (𝟙 X).base).op))
            X.presheaf).app
      (op U✝) =
    (𝟙 X).c.app (op U✝)

Next tactic:
dsimp
/-- The isomorphism from the restriction to the top subspace.
-/
@[simps]
def restrictTopIso (X : PresheafedSpace C) : X.restrict (Opens.openEmbedding ⊤) ≅ X where
  hom := X.ofRestrict _
  inv := X.toRestrictTop
  hom_inv_id := by
    ext
    · rfl
    · dsimp
      erw [comp_c, toRestrictTop_c, whiskerRight_id',
        comp_id, ofRestrict_top_c, eqToHom_map, eqToHom_trans, eqToHom_refl]
      rfl
  inv_hom_id := by
    ext
    · rfl
    · dsimp
      

Proof state:
case h.w
C : Type u_1
inst✝ : Category.{?u.279806, u_1} C
X : PresheafedSpace C
U✝ : Opens ↑↑X
⊢ ((toRestrictTop X ≫ ofRestrict X (_ : OpenEmbedding ⇑(Opens.inclusion ⊤))).c ≫
          whiskerRight (𝟙 (Opens.map ((Opens.inclusionTopIso ↑X).inv ≫ Opens.inclusion ⊤)).op) X.presheaf).app
      (op U✝) =
    (𝟙 X).c.app (op U✝)

Next tactic:
erw [comp_c, ofRestrict_top_c, toRestrictTop_c, eqToHom_map, whiskerRight_id', comp_id,
        eqToHom_trans, eqToHom_refl]
/-- The isomorphism from the restriction to the top subspace.
-/
@[simps]
def restrictTopIso (X : PresheafedSpace C) : X.restrict (Opens.openEmbedding ⊤) ≅ X where
  hom := X.ofRestrict _
  inv := X.toRestrictTop
  hom_inv_id := by
    ext
    · rfl
    · dsimp
      erw [comp_c, toRestrictTop_c, whiskerRight_id',
        comp_id, ofRestrict_top_c, eqToHom_map, eqToHom_trans, eqToHom_refl]
      rfl
  inv_hom_id := by
    ext
    · rfl
    · dsimp
      erw [comp_c, ofRestrict_top_c, toRestrictTop_c, eqToHom_map, whiskerRight_id', comp_id,
        eqToHom_trans, eqToHom_refl]
      

Proof state:
case h.w
C : Type u_1
inst✝ : Category.{?u.279806, u_1} C
X : PresheafedSpace C
U✝ : Opens ↑↑X
⊢ (𝟙 X.presheaf).app (op U✝) = (𝟙 X).c.app (op U✝)

Next tactic:
rfl
/-- We can apply a functor `F : C ⥤ D` to the values of the presheaf in any `PresheafedSpace C`,
    giving a functor `PresheafedSpace C ⥤ PresheafedSpace D` -/
def mapPresheaf (F : C ⥤ D) : PresheafedSpace C ⥤ PresheafedSpace D where
  obj X :=
    { carrier := X.carrier
      presheaf := X.presheaf ⋙ F }
  map f :=
    { base := f.base
      c := whiskerRight f.c F }
  -- porting note: these proofs were automatic in mathlib3
  map_id X := by
    

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.299389, u_1} C
D : Type u_2
inst✝ : Category.{?u.299396, u_2} D
F : C ⥤ D
X : PresheafedSpace C
⊢ { obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
          map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.map
      (𝟙 X) =
    𝟙
      ({ obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
            map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.obj
        X)

Next tactic:
ext U
/-- We can apply a functor `F : C ⥤ D` to the values of the presheaf in any `PresheafedSpace C`,
    giving a functor `PresheafedSpace C ⥤ PresheafedSpace D` -/
def mapPresheaf (F : C ⥤ D) : PresheafedSpace C ⥤ PresheafedSpace D where
  obj X :=
    { carrier := X.carrier
      presheaf := X.presheaf ⋙ F }
  map f :=
    { base := f.base
      c := whiskerRight f.c F }
  -- porting note: these proofs were automatic in mathlib3
  map_id X := by
    ext U
    

Proof state:
case w.w
C : Type u_1
inst✝¹ : Category.{?u.299389, u_1} C
D : Type u_2
inst✝ : Category.{?u.299396, u_2} D
F : C ⥤ D
X : PresheafedSpace C
U :
  (forget TopCat).obj
    ↑({ obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
            map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.obj
        X)
⊢ ({ obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
              map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.map
          (𝟙 X)).base
      U =
    (𝟙
          ({ obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
                map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.obj
            X)).base
      U
case h.w
C : Type u_1
inst✝¹ : Category.{?u.299389, u_1} C
D : Type u_2
inst✝ : Category.{?u.299396, u_2} D
F : C ⥤ D
X : PresheafedSpace C
U :
  Opens
    ↑↑({ obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
              map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.obj
          X)
⊢ (({ obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
                  map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.map
              (𝟙 X)).c ≫
          whiskerRight
            (eqToHom
              (_ :
                (Opens.map
                      ({ obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
                              map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.map
                          (𝟙 X)).base).op =
                  (Opens.map
                      (𝟙
                          ({ obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
                                map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.obj
                            X)).base).op))
            ({ obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
                    map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.obj
                X).presheaf).app
      (op U) =
    (𝟙
            ({ obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
                  map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.obj
              X)).c.app
      (op U)

Next tactic:
rfl
/-- We can apply a functor `F : C ⥤ D` to the values of the presheaf in any `PresheafedSpace C`,
    giving a functor `PresheafedSpace C ⥤ PresheafedSpace D` -/
def mapPresheaf (F : C ⥤ D) : PresheafedSpace C ⥤ PresheafedSpace D where
  obj X :=
    { carrier := X.carrier
      presheaf := X.presheaf ⋙ F }
  map f :=
    { base := f.base
      c := whiskerRight f.c F }
  -- porting note: these proofs were automatic in mathlib3
  map_id X := by
    ext U
    rfl
    

Proof state:
case h.w
C : Type u_1
inst✝¹ : Category.{?u.299389, u_1} C
D : Type u_2
inst✝ : Category.{?u.299396, u_2} D
F : C ⥤ D
X : PresheafedSpace C
U :
  Opens
    ↑↑({ obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
              map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.obj
          X)
⊢ (({ obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
                  map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.map
              (𝟙 X)).c ≫
          whiskerRight
            (eqToHom
              (_ :
                (Opens.map
                      ({ obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
                              map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.map
                          (𝟙 X)).base).op =
                  (Opens.map
                      (𝟙
                          ({ obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
                                map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.obj
                            X)).base).op))
            ({ obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
                    map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.obj
                X).presheaf).app
      (op U) =
    (𝟙
            ({ obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
                  map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.obj
              X)).c.app
      (op U)

Next tactic:
simp
/-- We can apply a functor `F : C ⥤ D` to the values of the presheaf in any `PresheafedSpace C`,
    giving a functor `PresheafedSpace C ⥤ PresheafedSpace D` -/
def mapPresheaf (F : C ⥤ D) : PresheafedSpace C ⥤ PresheafedSpace D where
  obj X :=
    { carrier := X.carrier
      presheaf := X.presheaf ⋙ F }
  map f :=
    { base := f.base
      c := whiskerRight f.c F }
  -- porting note: these proofs were automatic in mathlib3
  map_id X := by
    ext U
    rfl
    simp
  map_comp f g := by
    

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.299389, u_1} C
D : Type u_2
inst✝ : Category.{?u.299396, u_2} D
F : C ⥤ D
X✝ Y✝ Z✝ : PresheafedSpace C
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
⊢ { obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
          map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.map
      (f ≫ g) =
    { obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
            map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.map
        f ≫
      { obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
            map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.map
        g

Next tactic:
ext U
/-- We can apply a functor `F : C ⥤ D` to the values of the presheaf in any `PresheafedSpace C`,
    giving a functor `PresheafedSpace C ⥤ PresheafedSpace D` -/
def mapPresheaf (F : C ⥤ D) : PresheafedSpace C ⥤ PresheafedSpace D where
  obj X :=
    { carrier := X.carrier
      presheaf := X.presheaf ⋙ F }
  map f :=
    { base := f.base
      c := whiskerRight f.c F }
  -- porting note: these proofs were automatic in mathlib3
  map_id X := by
    ext U
    rfl
    simp
  map_comp f g := by
    ext U
    rfl
    

Proof state:
case h.w
C : Type u_1
inst✝¹ : Category.{?u.299389, u_1} C
D : Type u_2
inst✝ : Category.{?u.299396, u_2} D
F : C ⥤ D
X✝ Y✝ Z✝ : PresheafedSpace C
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
U :
  Opens
    ↑↑({ obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
              map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.obj
          Z✝)
⊢ (({ obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
                  map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.map
              (f ≫ g)).c ≫
          whiskerRight
            (eqToHom
              (_ :
                (Opens.map
                      ({ obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
                              map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.map
                          (f ≫ g)).base).op =
                  (Opens.map
                      ({ obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
                                map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.map
                            f ≫
                          { obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
                                map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.map
                            g).base).op))
            ({ obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
                    map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.obj
                X✝).presheaf).app
      (op U) =
    ({ obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
                  map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.map
              f ≫
            { obj := fun X => { carrier := ↑X, presheaf := X.presheaf ⋙ F },
                  map := fun {X Y} f => { base := f.base, c := whiskerRight f.c F } }.map
              g).c.app
      (op U)

Next tactic:
simp
theorem mem_balancedCore_iff : x ∈ balancedCore 𝕜 s ↔ ∃ t, Balanced 𝕜 t ∧ t ⊆ s ∧ x ∈ t := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝¹ : SeminormedRing 𝕜
inst✝ : SMul 𝕜 E
s t : Set E
x : E
⊢ x ∈ balancedCore 𝕜 s ↔ ∃ t, Balanced 𝕜 t ∧ t ⊆ s ∧ x ∈ t

Next tactic:
simp_rw [balancedCore, mem_sUnion, mem_setOf_eq, and_assoc]
theorem smul_balancedCore_subset (s : Set E) {a : 𝕜} (ha : ‖a‖ ≤ 1) :
    a • balancedCore 𝕜 s ⊆ balancedCore 𝕜 s := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝¹ : SeminormedRing 𝕜
inst✝ : SMul 𝕜 E
s✝ t : Set E
x : E
s : Set E
a : 𝕜
ha : ‖a‖ ≤ 1
⊢ a • balancedCore 𝕜 s ⊆ balancedCore 𝕜 s

Next tactic:
rintro x ⟨y, hy, rfl⟩
theorem smul_balancedCore_subset (s : Set E) {a : 𝕜} (ha : ‖a‖ ≤ 1) :
    a • balancedCore 𝕜 s ⊆ balancedCore 𝕜 s := by
  rintro x ⟨y, hy, rfl⟩
  

Proof state:
case intro.intro
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝¹ : SeminormedRing 𝕜
inst✝ : SMul 𝕜 E
s✝ t : Set E
x : E
s : Set E
a : 𝕜
ha : ‖a‖ ≤ 1
y : E
hy : y ∈ balancedCore 𝕜 s
⊢ (fun x => a • x) y ∈ balancedCore 𝕜 s

Next tactic:
rw [mem_balancedCore_iff] at hy
theorem smul_balancedCore_subset (s : Set E) {a : 𝕜} (ha : ‖a‖ ≤ 1) :
    a • balancedCore 𝕜 s ⊆ balancedCore 𝕜 s := by
  rintro x ⟨y, hy, rfl⟩
  rw [mem_balancedCore_iff] at hy
  

Proof state:
case intro.intro
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝¹ : SeminormedRing 𝕜
inst✝ : SMul 𝕜 E
s✝ t : Set E
x : E
s : Set E
a : 𝕜
ha : ‖a‖ ≤ 1
y : E
hy : ∃ t, Balanced 𝕜 t ∧ t ⊆ s ∧ y ∈ t
⊢ (fun x => a • x) y ∈ balancedCore 𝕜 s

Next tactic:
rcases hy with ⟨t, ht1, ht2, hy⟩
theorem smul_balancedCore_subset (s : Set E) {a : 𝕜} (ha : ‖a‖ ≤ 1) :
    a • balancedCore 𝕜 s ⊆ balancedCore 𝕜 s := by
  rintro x ⟨y, hy, rfl⟩
  rw [mem_balancedCore_iff] at hy
  rcases hy with ⟨t, ht1, ht2, hy⟩
  

Proof state:
case intro.intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝¹ : SeminormedRing 𝕜
inst✝ : SMul 𝕜 E
s✝ t✝ : Set E
x : E
s : Set E
a : 𝕜
ha : ‖a‖ ≤ 1
y : E
t : Set E
ht1 : Balanced 𝕜 t
ht2 : t ⊆ s
hy : y ∈ t
⊢ (fun x => a • x) y ∈ balancedCore 𝕜 s

Next tactic:
exact ⟨t, ⟨ht1, ht2⟩, ht1 a ha (smul_mem_smul_set hy)⟩
theorem mem_balancedHull_iff : x ∈ balancedHull 𝕜 s ↔ ∃ r : 𝕜, ‖r‖ ≤ 1 ∧ x ∈ r • s := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝¹ : SeminormedRing 𝕜
inst✝ : SMul 𝕜 E
s t : Set E
x : E
⊢ x ∈ balancedHull 𝕜 s ↔ ∃ r, ‖r‖ ≤ 1 ∧ x ∈ r • s

Next tactic:
simp [balancedHull]
/-- The balanced hull of `s` is minimal in the sense that it is contained in any balanced superset
`t` of `s`. -/
theorem Balanced.balancedHull_subset_of_subset (ht : Balanced 𝕜 t) (h : s ⊆ t) :
    balancedHull 𝕜 s ⊆ t := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝¹ : SeminormedRing 𝕜
inst✝ : SMul 𝕜 E
s t : Set E
x : E
ht : Balanced 𝕜 t
h : s ⊆ t
⊢ balancedHull 𝕜 s ⊆ t

Next tactic:
intros x hx
/-- The balanced hull of `s` is minimal in the sense that it is contained in any balanced superset
`t` of `s`. -/
theorem Balanced.balancedHull_subset_of_subset (ht : Balanced 𝕜 t) (h : s ⊆ t) :
    balancedHull 𝕜 s ⊆ t := by
  intros x hx
  

Proof state:
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝¹ : SeminormedRing 𝕜
inst✝ : SMul 𝕜 E
s t : Set E
x✝ : E
ht : Balanced 𝕜 t
h : s ⊆ t
x : E
hx : x ∈ balancedHull 𝕜 s
⊢ x ∈ t

Next tactic:
obtain ⟨r, hr, y, hy, rfl⟩ := mem_balancedHull_iff.1 hx
/-- The balanced hull of `s` is minimal in the sense that it is contained in any balanced superset
`t` of `s`. -/
theorem Balanced.balancedHull_subset_of_subset (ht : Balanced 𝕜 t) (h : s ⊆ t) :
    balancedHull 𝕜 s ⊆ t := by
  intros x hx
  obtain ⟨r, hr, y, hy, rfl⟩ := mem_balancedHull_iff.1 hx
  

Proof state:
case intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝¹ : SeminormedRing 𝕜
inst✝ : SMul 𝕜 E
s t : Set E
x : E
ht : Balanced 𝕜 t
h : s ⊆ t
r : 𝕜
hr : ‖r‖ ≤ 1
y : E
hy : y ∈ s
hx : (fun x => r • x) y ∈ balancedHull 𝕜 s
⊢ (fun x => r • x) y ∈ t

Next tactic:
exact ht.smul_mem hr (h hy)
theorem balancedHull.balanced (s : Set E) : Balanced 𝕜 (balancedHull 𝕜 s) := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : SeminormedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s✝ s : Set E
⊢ Balanced 𝕜 (balancedHull 𝕜 s)

Next tactic:
intro a ha
theorem balancedHull.balanced (s : Set E) : Balanced 𝕜 (balancedHull 𝕜 s) := by
  intro a ha
  

Proof state:
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : SeminormedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s✝ s : Set E
a : 𝕜
ha : ‖a‖ ≤ 1
⊢ a • balancedHull 𝕜 s ⊆ balancedHull 𝕜 s

Next tactic:
simp_rw [balancedHull, smul_set_iUnion₂, subset_def, mem_iUnion₂]
theorem balancedHull.balanced (s : Set E) : Balanced 𝕜 (balancedHull 𝕜 s) := by
  intro a ha
  simp_rw [balancedHull, smul_set_iUnion₂, subset_def, mem_iUnion₂]
  

Proof state:
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : SeminormedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s✝ s : Set E
a : 𝕜
ha : ‖a‖ ≤ 1
⊢ ∀ (x : E), (∃ i, ∃ (_ : ‖i‖ ≤ 1), x ∈ a • i • s) → ∃ i, ∃ (_ : ‖i‖ ≤ 1), x ∈ i • s

Next tactic:
rintro x ⟨r, hr, hx⟩
theorem balancedHull.balanced (s : Set E) : Balanced 𝕜 (balancedHull 𝕜 s) := by
  intro a ha
  simp_rw [balancedHull, smul_set_iUnion₂, subset_def, mem_iUnion₂]
  rintro x ⟨r, hr, hx⟩
  

Proof state:
case intro.intro
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : SeminormedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s✝ s : Set E
a : 𝕜
ha : ‖a‖ ≤ 1
x : E
r : 𝕜
hr : ‖r‖ ≤ 1
hx : x ∈ a • r • s
⊢ ∃ i, ∃ (_ : ‖i‖ ≤ 1), x ∈ i • s

Next tactic:
rw [← smul_assoc] at hx
theorem balancedHull.balanced (s : Set E) : Balanced 𝕜 (balancedHull 𝕜 s) := by
  intro a ha
  simp_rw [balancedHull, smul_set_iUnion₂, subset_def, mem_iUnion₂]
  rintro x ⟨r, hr, hx⟩
  rw [← smul_assoc] at hx
  

Proof state:
case intro.intro
𝕜 : Type u_1
E : Type u_2
ι : Type u_3
inst✝² : SeminormedRing 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s✝ s : Set E
a : 𝕜
ha : ‖a‖ ≤ 1
x : E
r : 𝕜
hr : ‖r‖ ≤ 1
hx : x ∈ (a • r) • s
⊢ ∃ i, ∃ (_ : ‖i‖ ≤ 1), x ∈ i • s

Next tactic:
exact ⟨a • r, (SeminormedRing.norm_mul _ _).trans (mul_le_one ha (norm_nonneg r) hr), hx⟩