l3lab/ntp-mathlib huggingface dataset:
/-- If a scalar action is central, then its right action is continuous when its left action is. -/
@[to_additive "If an additive action is central, then its right action is continuous when its left
action is."]
instance ContinuousSMul.op [SMul Mᵐᵒᵖ X] [IsCentralScalar M X] : ContinuousSMul Mᵐᵒᵖ X :=
  ⟨by
    suffices Continuous fun p : M × X => MulOpposite.op p.fst • p.snd from
      this.comp (MulOpposite.continuous_unop.prod_map continuous_id)
    

Proof state:
M : Type u_1
X : Type u_2
Y : Type u_3
α : Type u_4
inst✝⁶ : TopologicalSpace M
inst✝⁵ : TopologicalSpace X
inst✝⁴ : TopologicalSpace Y
inst✝³ : SMul M X
inst✝² : ContinuousSMul M X
f : Y → M
g : Y → X
b : Y
s : Set Y
inst✝¹ : SMul Mᵐᵒᵖ X
inst✝ : IsCentralScalar M X
⊢ Continuous fun p => MulOpposite.op p.1 • p.2

Next tactic:
simpa only [op_smul_eq_smul] using (continuous_smul : Continuous fun p : M × X => _)
@[to_additive]
lemma IsCompact.smul_set {k : Set M} {u : Set X} (hk : IsCompact k) (hu : IsCompact u) :
    IsCompact (k • u) := by
  

Proof state:
M : Type u_1
X : Type u_2
Y : Type u_3
α : Type u_4
inst✝⁴ : TopologicalSpace M
inst✝³ : TopologicalSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : SMul M X
inst✝ : ContinuousSMul M X
f : Y → M
g : Y → X
b : Y
s : Set Y
k : Set M
u : Set X
hk : IsCompact k
hu : IsCompact u
⊢ IsCompact (k • u)

Next tactic:
rw [← Set.image_smul_prod]
@[to_additive]
lemma IsCompact.smul_set {k : Set M} {u : Set X} (hk : IsCompact k) (hu : IsCompact u) :
    IsCompact (k • u) := by
  rw [← Set.image_smul_prod]
  

Proof state:
M : Type u_1
X : Type u_2
Y : Type u_3
α : Type u_4
inst✝⁴ : TopologicalSpace M
inst✝³ : TopologicalSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : SMul M X
inst✝ : ContinuousSMul M X
f : Y → M
g : Y → X
b : Y
s : Set Y
k : Set M
u : Set X
hk : IsCompact k
hu : IsCompact u
⊢ IsCompact ((fun x => x.1 • x.2) '' k ×ˢ u)

Next tactic:
exact IsCompact.image (hk.prod hu) continuous_smul
@[to_additive]
lemma smul_set_closure_subset (K : Set M) (L : Set X) :
    closure K • closure L ⊆ closure (K • L) := by
  

Proof state:
M : Type u_1
X : Type u_2
Y : Type u_3
α : Type u_4
inst✝⁴ : TopologicalSpace M
inst✝³ : TopologicalSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : SMul M X
inst✝ : ContinuousSMul M X
f : Y → M
g : Y → X
b : Y
s : Set Y
K : Set M
L : Set X
⊢ closure K • closure L ⊆ closure (K • L)

Next tactic:
rintro - ⟨x, y, hx, hy, rfl⟩
@[to_additive]
lemma smul_set_closure_subset (K : Set M) (L : Set X) :
    closure K • closure L ⊆ closure (K • L) := by
  rintro - ⟨x, y, hx, hy, rfl⟩
  

Proof state:
case intro.intro.intro.intro
M : Type u_1
X : Type u_2
Y : Type u_3
α : Type u_4
inst✝⁴ : TopologicalSpace M
inst✝³ : TopologicalSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : SMul M X
inst✝ : ContinuousSMul M X
f : Y → M
g : Y → X
b : Y
s : Set Y
K : Set M
L : Set X
x : M
y : X
hx : x ∈ closure K
hy : y ∈ closure L
⊢ (fun x x_1 => x • x_1) x y ∈ closure (K • L)

Next tactic:
apply mem_closure_iff_nhds.2 (fun u hu ↦ ?_)
@[to_additive]
lemma smul_set_closure_subset (K : Set M) (L : Set X) :
    closure K • closure L ⊆ closure (K • L) := by
  rintro - ⟨x, y, hx, hy, rfl⟩
  apply mem_closure_iff_nhds.2 (fun u hu ↦ ?_)
  

Proof state:
M : Type u_1
X : Type u_2
Y : Type u_3
α : Type u_4
inst✝⁴ : TopologicalSpace M
inst✝³ : TopologicalSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : SMul M X
inst✝ : ContinuousSMul M X
f : Y → M
g : Y → X
b : Y
s : Set Y
K : Set M
L : Set X
x : M
y : X
hx : x ∈ closure K
hy : y ∈ closure L
u : Set X
hu : u ∈ 𝓝 ((fun x x_1 => x • x_1) x y)
⊢ Set.Nonempty (u ∩ K • L)

Next tactic:
have A : (fun p ↦ p.fst • p.snd) ⁻¹' u ∈ 𝓝 (x, y) :=
    (continuous_smul.continuousAt (x := (x, y))).preimage_mem_nhds hu
@[to_additive]
lemma smul_set_closure_subset (K : Set M) (L : Set X) :
    closure K • closure L ⊆ closure (K • L) := by
  rintro - ⟨x, y, hx, hy, rfl⟩
  apply mem_closure_iff_nhds.2 (fun u hu ↦ ?_)
  have A : (fun p ↦ p.fst • p.snd) ⁻¹' u ∈ 𝓝 (x, y) :=
    (continuous_smul.continuousAt (x := (x, y))).preimage_mem_nhds hu
  

Proof state:
M : Type u_1
X : Type u_2
Y : Type u_3
α : Type u_4
inst✝⁴ : TopologicalSpace M
inst✝³ : TopologicalSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : SMul M X
inst✝ : ContinuousSMul M X
f : Y → M
g : Y → X
b : Y
s : Set Y
K : Set M
L : Set X
x : M
y : X
hx : x ∈ closure K
hy : y ∈ closure L
u : Set X
hu : u ∈ 𝓝 ((fun x x_1 => x • x_1) x y)
A : (fun p => p.1 • p.2) ⁻¹' u ∈ 𝓝 (x, y)
⊢ Set.Nonempty (u ∩ K • L)

Next tactic:
obtain ⟨a, ha, b, hb, hab⟩ :
    ∃ a, a ∈ 𝓝 x ∧ ∃ b, b ∈ 𝓝 y ∧ a ×ˢ b ⊆ (fun p ↦ p.fst • p.snd) ⁻¹' u :=
      mem_nhds_prod_iff.1 A
@[to_additive]
lemma smul_set_closure_subset (K : Set M) (L : Set X) :
    closure K • closure L ⊆ closure (K • L) := by
  rintro - ⟨x, y, hx, hy, rfl⟩
  apply mem_closure_iff_nhds.2 (fun u hu ↦ ?_)
  have A : (fun p ↦ p.fst • p.snd) ⁻¹' u ∈ 𝓝 (x, y) :=
    (continuous_smul.continuousAt (x := (x, y))).preimage_mem_nhds hu
  obtain ⟨a, ha, b, hb, hab⟩ :
    ∃ a, a ∈ 𝓝 x ∧ ∃ b, b ∈ 𝓝 y ∧ a ×ˢ b ⊆ (fun p ↦ p.fst • p.snd) ⁻¹' u :=
      mem_nhds_prod_iff.1 A
  

Proof state:
case intro.intro.intro.intro
M : Type u_1
X : Type u_2
Y : Type u_3
α : Type u_4
inst✝⁴ : TopologicalSpace M
inst✝³ : TopologicalSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : SMul M X
inst✝ : ContinuousSMul M X
f : Y → M
g : Y → X
b✝ : Y
s : Set Y
K : Set M
L : Set X
x : M
y : X
hx : x ∈ closure K
hy : y ∈ closure L
u : Set X
hu : u ∈ 𝓝 ((fun x x_1 => x • x_1) x y)
A : (fun p => p.1 • p.2) ⁻¹' u ∈ 𝓝 (x, y)
a : Set M
ha : a ∈ 𝓝 x
b : Set X
hb : b ∈ 𝓝 y
hab : a ×ˢ b ⊆ (fun p => p.1 • p.2) ⁻¹' u
⊢ Set.Nonempty (u ∩ K • L)

Next tactic:
obtain ⟨x', ⟨x'a, x'K⟩⟩ : Set.Nonempty (a ∩ K) := mem_closure_iff_nhds.1 hx a ha
@[to_additive]
lemma smul_set_closure_subset (K : Set M) (L : Set X) :
    closure K • closure L ⊆ closure (K • L) := by
  rintro - ⟨x, y, hx, hy, rfl⟩
  apply mem_closure_iff_nhds.2 (fun u hu ↦ ?_)
  have A : (fun p ↦ p.fst • p.snd) ⁻¹' u ∈ 𝓝 (x, y) :=
    (continuous_smul.continuousAt (x := (x, y))).preimage_mem_nhds hu
  obtain ⟨a, ha, b, hb, hab⟩ :
    ∃ a, a ∈ 𝓝 x ∧ ∃ b, b ∈ 𝓝 y ∧ a ×ˢ b ⊆ (fun p ↦ p.fst • p.snd) ⁻¹' u :=
      mem_nhds_prod_iff.1 A
  obtain ⟨x', ⟨x'a, x'K⟩⟩ : Set.Nonempty (a ∩ K) := mem_closure_iff_nhds.1 hx a ha
  

Proof state:
case intro.intro.intro.intro.intro.intro
M : Type u_1
X : Type u_2
Y : Type u_3
α : Type u_4
inst✝⁴ : TopologicalSpace M
inst✝³ : TopologicalSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : SMul M X
inst✝ : ContinuousSMul M X
f : Y → M
g : Y → X
b✝ : Y
s : Set Y
K : Set M
L : Set X
x : M
y : X
hx : x ∈ closure K
hy : y ∈ closure L
u : Set X
hu : u ∈ 𝓝 ((fun x x_1 => x • x_1) x y)
A : (fun p => p.1 • p.2) ⁻¹' u ∈ 𝓝 (x, y)
a : Set M
ha : a ∈ 𝓝 x
b : Set X
hb : b ∈ 𝓝 y
hab : a ×ˢ b ⊆ (fun p => p.1 • p.2) ⁻¹' u
x' : M
x'a : x' ∈ a
x'K : x' ∈ K
⊢ Set.Nonempty (u ∩ K • L)

Next tactic:
obtain ⟨y', ⟨y'b, y'L⟩⟩ : Set.Nonempty (b ∩ L) := mem_closure_iff_nhds.1 hy b hb
@[to_additive]
lemma smul_set_closure_subset (K : Set M) (L : Set X) :
    closure K • closure L ⊆ closure (K • L) := by
  rintro - ⟨x, y, hx, hy, rfl⟩
  apply mem_closure_iff_nhds.2 (fun u hu ↦ ?_)
  have A : (fun p ↦ p.fst • p.snd) ⁻¹' u ∈ 𝓝 (x, y) :=
    (continuous_smul.continuousAt (x := (x, y))).preimage_mem_nhds hu
  obtain ⟨a, ha, b, hb, hab⟩ :
    ∃ a, a ∈ 𝓝 x ∧ ∃ b, b ∈ 𝓝 y ∧ a ×ˢ b ⊆ (fun p ↦ p.fst • p.snd) ⁻¹' u :=
      mem_nhds_prod_iff.1 A
  obtain ⟨x', ⟨x'a, x'K⟩⟩ : Set.Nonempty (a ∩ K) := mem_closure_iff_nhds.1 hx a ha
  obtain ⟨y', ⟨y'b, y'L⟩⟩ : Set.Nonempty (b ∩ L) := mem_closure_iff_nhds.1 hy b hb
  

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro
M : Type u_1
X : Type u_2
Y : Type u_3
α : Type u_4
inst✝⁴ : TopologicalSpace M
inst✝³ : TopologicalSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : SMul M X
inst✝ : ContinuousSMul M X
f : Y → M
g : Y → X
b✝ : Y
s : Set Y
K : Set M
L : Set X
x : M
y : X
hx : x ∈ closure K
hy : y ∈ closure L
u : Set X
hu : u ∈ 𝓝 ((fun x x_1 => x • x_1) x y)
A : (fun p => p.1 • p.2) ⁻¹' u ∈ 𝓝 (x, y)
a : Set M
ha : a ∈ 𝓝 x
b : Set X
hb : b ∈ 𝓝 y
hab : a ×ˢ b ⊆ (fun p => p.1 • p.2) ⁻¹' u
x' : M
x'a : x' ∈ a
x'K : x' ∈ K
y' : X
y'b : y' ∈ b
y'L : y' ∈ L
⊢ Set.Nonempty (u ∩ K • L)

Next tactic:
exact ⟨x' • y', hab (Set.mk_mem_prod x'a y'b), Set.smul_mem_smul x'K y'L⟩
/-- If an action is continuous, then composing this action with a continuous homomorphism gives
again a continuous action. -/
@[to_additive]
theorem MulAction.continuousSMul_compHom
    {N : Type*} [TopologicalSpace N] [Monoid N] {f : N →* M} (hf : Continuous f) :
    letI : MulAction N X := MulAction.compHom _ f
    ContinuousSMul N X := by
  

Proof state:
M : Type u_1
X : Type u_2
Y : Type u_3
α : Type u_4
inst✝⁷ : TopologicalSpace M
inst✝⁶ : TopologicalSpace X
inst✝⁵ : TopologicalSpace Y
inst✝⁴ : Monoid M
inst✝³ : MulAction M X
inst✝² : ContinuousSMul M X
N : Type u_5
inst✝¹ : TopologicalSpace N
inst✝ : Monoid N
f : N →* M
hf : Continuous ⇑f
⊢ ContinuousSMul N X

Next tactic:
let _ : MulAction N X := MulAction.compHom _ f
/-- If an action is continuous, then composing this action with a continuous homomorphism gives
again a continuous action. -/
@[to_additive]
theorem MulAction.continuousSMul_compHom
    {N : Type*} [TopologicalSpace N] [Monoid N] {f : N →* M} (hf : Continuous f) :
    letI : MulAction N X := MulAction.compHom _ f
    ContinuousSMul N X := by
  let _ : MulAction N X := MulAction.compHom _ f
  

Proof state:
M : Type u_1
X : Type u_2
Y : Type u_3
α : Type u_4
inst✝⁷ : TopologicalSpace M
inst✝⁶ : TopologicalSpace X
inst✝⁵ : TopologicalSpace Y
inst✝⁴ : Monoid M
inst✝³ : MulAction M X
inst✝² : ContinuousSMul M X
N : Type u_5
inst✝¹ : TopologicalSpace N
inst✝ : Monoid N
f : N →* M
hf : Continuous ⇑f
x✝ : MulAction N X := compHom X f
⊢ ContinuousSMul N X

Next tactic:
exact ⟨(hf.comp continuous_fst).smul continuous_snd⟩
@[to_additive]
theorem continuousSMul_sInf {ts : Set (TopologicalSpace X)}
    (h : ∀ t ∈ ts, @ContinuousSMul M X _ _ t) : @ContinuousSMul M X _ _ (sInf ts) :=
  -- porting note: {} doesn't work because `sInf ts` isn't found by TC search. `(_)` finds it by
  -- unification instead.
  @ContinuousSMul.mk M X _ _ (_) <| by
      -- porting note: needs `( :)`
      

Proof state:
ι : Sort u_1
M : Type u_2
X : Type u_3
inst✝¹ : TopologicalSpace M
inst✝ : SMul M X
ts : Set (TopologicalSpace X)
h : ∀ t ∈ ts, ContinuousSMul M X
⊢ Continuous fun p => p.1 • p.2

Next tactic:
rw [← (@sInf_singleton _ _ ‹TopologicalSpace M›:)]
@[to_additive]
theorem continuousSMul_sInf {ts : Set (TopologicalSpace X)}
    (h : ∀ t ∈ ts, @ContinuousSMul M X _ _ t) : @ContinuousSMul M X _ _ (sInf ts) :=
  -- porting note: {} doesn't work because `sInf ts` isn't found by TC search. `(_)` finds it by
  -- unification instead.
  @ContinuousSMul.mk M X _ _ (_) <| by
      -- porting note: needs `( :)`
      rw [← (@sInf_singleton _ _ ‹TopologicalSpace M›:)]
      

Proof state:
ι : Sort u_1
M : Type u_2
X : Type u_3
inst✝¹ : TopologicalSpace M
inst✝ : SMul M X
ts : Set (TopologicalSpace X)
h : ∀ t ∈ ts, ContinuousSMul M X
⊢ Continuous fun p => p.1 • p.2

Next tactic:
exact
        continuous_sInf_rng.2 fun t ht =>
          continuous_sInf_dom₂ (Eq.refl _) ht
            (@ContinuousSMul.continuous_smul _ _ _ _ t (h t ht))
@[to_additive]
theorem continuousSMul_inf {t₁ t₂ : TopologicalSpace X} [@ContinuousSMul M X _ _ t₁]
    [@ContinuousSMul M X _ _ t₂] : @ContinuousSMul M X _ _ (t₁ ⊓ t₂) := by
  

Proof state:
ι : Sort u_1
M : Type u_2
X : Type u_3
inst✝³ : TopologicalSpace M
inst✝² : SMul M X
t₁ t₂ : TopologicalSpace X
inst✝¹ : ContinuousSMul M X
inst✝ : ContinuousSMul M X
⊢ ContinuousSMul M X

Next tactic:
rw [inf_eq_iInf]
@[to_additive]
theorem continuousSMul_inf {t₁ t₂ : TopologicalSpace X} [@ContinuousSMul M X _ _ t₁]
    [@ContinuousSMul M X _ _ t₂] : @ContinuousSMul M X _ _ (t₁ ⊓ t₂) := by
  rw [inf_eq_iInf]
  

Proof state:
ι : Sort u_1
M : Type u_2
X : Type u_3
inst✝³ : TopologicalSpace M
inst✝² : SMul M X
t₁ t₂ : TopologicalSpace X
inst✝¹ : ContinuousSMul M X
inst✝ : ContinuousSMul M X
⊢ ContinuousSMul M X

Next tactic:
refine' continuousSMul_iInf fun b => _
@[to_additive]
theorem continuousSMul_inf {t₁ t₂ : TopologicalSpace X} [@ContinuousSMul M X _ _ t₁]
    [@ContinuousSMul M X _ _ t₂] : @ContinuousSMul M X _ _ (t₁ ⊓ t₂) := by
  rw [inf_eq_iInf]
  refine' continuousSMul_iInf fun b => _
  

Proof state:
ι : Sort u_1
M : Type u_2
X : Type u_3
inst✝³ : TopologicalSpace M
inst✝² : SMul M X
t₁ t₂ : TopologicalSpace X
inst✝¹ : ContinuousSMul M X
inst✝ : ContinuousSMul M X
b : Bool
⊢ ContinuousSMul M X

Next tactic:
cases b
@[to_additive]
theorem continuousSMul_inf {t₁ t₂ : TopologicalSpace X} [@ContinuousSMul M X _ _ t₁]
    [@ContinuousSMul M X _ _ t₂] : @ContinuousSMul M X _ _ (t₁ ⊓ t₂) := by
  rw [inf_eq_iInf]
  refine' continuousSMul_iInf fun b => _
  cases b <;> 

Proof state:
case false
ι : Sort u_1
M : Type u_2
X : Type u_3
inst✝³ : TopologicalSpace M
inst✝² : SMul M X
t₁ t₂ : TopologicalSpace X
inst✝¹ : ContinuousSMul M X
inst✝ : ContinuousSMul M X
⊢ ContinuousSMul M X

Next tactic:
assumption
@[to_additive]
theorem continuousSMul_inf {t₁ t₂ : TopologicalSpace X} [@ContinuousSMul M X _ _ t₁]
    [@ContinuousSMul M X _ _ t₂] : @ContinuousSMul M X _ _ (t₁ ⊓ t₂) := by
  rw [inf_eq_iInf]
  refine' continuousSMul_iInf fun b => _
  cases b <;> 

Proof state:
case true
ι : Sort u_1
M : Type u_2
X : Type u_3
inst✝³ : TopologicalSpace M
inst✝² : SMul M X
t₁ t₂ : TopologicalSpace X
inst✝¹ : ContinuousSMul M X
inst✝ : ContinuousSMul M X
⊢ ContinuousSMul M X

Next tactic:
assumption
/-- An `AddTorsor` for a connected space is a connected space. This is not an instance because
it loops for a group as a torsor over itself. -/
protected theorem AddTorsor.connectedSpace : ConnectedSpace P :=
  { isPreconnected_univ := by
      

Proof state:
G : Type u_1
P : Type u_2
inst✝⁵ : AddGroup G
inst✝⁴ : AddTorsor G P
inst✝³ : TopologicalSpace G
inst✝² : PreconnectedSpace G
inst✝¹ : TopologicalSpace P
inst✝ : ContinuousVAdd G P
⊢ IsPreconnected Set.univ

Next tactic:
convert
        isPreconnected_univ.image (Equiv.vaddConst (Classical.arbitrary P) : G → P)
          (continuous_id.vadd continuous_const).continuousOn
/-- An `AddTorsor` for a connected space is a connected space. This is not an instance because
it loops for a group as a torsor over itself. -/
protected theorem AddTorsor.connectedSpace : ConnectedSpace P :=
  { isPreconnected_univ := by
      convert
        isPreconnected_univ.image (Equiv.vaddConst (Classical.arbitrary P) : G → P)
          (continuous_id.vadd continuous_const).continuousOn
      

Proof state:
case h.e'_3
G : Type u_1
P : Type u_2
inst✝⁵ : AddGroup G
inst✝⁴ : AddTorsor G P
inst✝³ : TopologicalSpace G
inst✝² : PreconnectedSpace G
inst✝¹ : TopologicalSpace P
inst✝ : ContinuousVAdd G P
⊢ Set.univ = ⇑(Equiv.vaddConst (Classical.arbitrary P)) '' Set.univ

Next tactic:
rw [Set.image_univ, Equiv.range_eq_univ]
/-- If a set `s` is a neighborhood of `x`, then there exists a smooth function `f` taking
values in `[0, 1]`, supported in `s` and with `f x = 1`. -/
theorem exists_smooth_tsupport_subset {s : Set E} {x : E} (hs : s ∈ 𝓝 x) :
    ∃ f : E → ℝ,
      tsupport f ⊆ s ∧ HasCompactSupport f ∧ ContDiff ℝ ⊤ f ∧ range f ⊆ Icc 0 1 ∧ f x = 1 := by
  

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : FiniteDimensional ℝ E
s : Set E
x : E
hs : s ∈ 𝓝 x
⊢ ∃ f, tsupport f ⊆ s ∧ HasCompactSupport f ∧ ContDiff ℝ ⊤ f ∧ range f ⊆ Icc 0 1 ∧ f x = 1

Next tactic:
obtain ⟨d : ℝ, d_pos : 0 < d, hd : Euclidean.closedBall x d ⊆ s⟩ :=
    Euclidean.nhds_basis_closedBall.mem_iff.1 hs
/-- If a set `s` is a neighborhood of `x`, then there exists a smooth function `f` taking
values in `[0, 1]`, supported in `s` and with `f x = 1`. -/
theorem exists_smooth_tsupport_subset {s : Set E} {x : E} (hs : s ∈ 𝓝 x) :
    ∃ f : E → ℝ,
      tsupport f ⊆ s ∧ HasCompactSupport f ∧ ContDiff ℝ ⊤ f ∧ range f ⊆ Icc 0 1 ∧ f x = 1 := by
  obtain ⟨d : ℝ, d_pos : 0 < d, hd : Euclidean.closedBall x d ⊆ s⟩ :=
    Euclidean.nhds_basis_closedBall.mem_iff.1 hs
  

Proof state:
case intro.intro
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : FiniteDimensional ℝ E
s : Set E
x : E
hs : s ∈ 𝓝 x
d : ℝ
d_pos : 0 < d
hd : Euclidean.closedBall x d ⊆ s
⊢ ∃ f, tsupport f ⊆ s ∧ HasCompactSupport f ∧ ContDiff ℝ ⊤ f ∧ range f ⊆ Icc 0 1 ∧ f x = 1

Next tactic:
let c : ContDiffBump (toEuclidean x) :=
    { rIn := d / 2
      rOut := d
      rIn_pos := half_pos d_pos
      rIn_lt_rOut := half_lt_self d_pos }
/-- If a set `s` is a neighborhood of `x`, then there exists a smooth function `f` taking
values in `[0, 1]`, supported in `s` and with `f x = 1`. -/
theorem exists_smooth_tsupport_subset {s : Set E} {x : E} (hs : s ∈ 𝓝 x) :
    ∃ f : E → ℝ,
      tsupport f ⊆ s ∧ HasCompactSupport f ∧ ContDiff ℝ ⊤ f ∧ range f ⊆ Icc 0 1 ∧ f x = 1 := by
  obtain ⟨d : ℝ, d_pos : 0 < d, hd : Euclidean.closedBall x d ⊆ s⟩ :=
    Euclidean.nhds_basis_closedBall.mem_iff.1 hs
  let c : ContDiffBump (toEuclidean x) :=
    { rIn := d / 2
      rOut := d
      rIn_pos := half_pos d_pos
      rIn_lt_rOut := half_lt_self d_pos }
  

Proof state:
case intro.intro
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : FiniteDimensional ℝ E
s : Set E
x : E
hs : s ∈ 𝓝 x
d : ℝ
d_pos : 0 < d
hd : Euclidean.closedBall x d ⊆ s
c : ContDiffBump (toEuclidean x) :=
  { rIn := d / 2, rOut := d, rIn_pos := (_ : 0 < d / 2), rIn_lt_rOut := (_ : d / 2 < d) }
⊢ ∃ f, tsupport f ⊆ s ∧ HasCompactSupport f ∧ ContDiff ℝ ⊤ f ∧ range f ⊆ Icc 0 1 ∧ f x = 1

Next tactic:
let f : E → ℝ := c ∘ toEuclidean
/-- If a set `s` is a neighborhood of `x`, then there exists a smooth function `f` taking
values in `[0, 1]`, supported in `s` and with `f x = 1`. -/
theorem exists_smooth_tsupport_subset {s : Set E} {x : E} (hs : s ∈ 𝓝 x) :
    ∃ f : E → ℝ,
      tsupport f ⊆ s ∧ HasCompactSupport f ∧ ContDiff ℝ ⊤ f ∧ range f ⊆ Icc 0 1 ∧ f x = 1 := by
  obtain ⟨d : ℝ, d_pos : 0 < d, hd : Euclidean.closedBall x d ⊆ s⟩ :=
    Euclidean.nhds_basis_closedBall.mem_iff.1 hs
  let c : ContDiffBump (toEuclidean x) :=
    { rIn := d / 2
      rOut := d
      rIn_pos := half_pos d_pos
      rIn_lt_rOut := half_lt_self d_pos }
  let f : E → ℝ := c ∘ toEuclidean
  

Proof state:
case intro.intro
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : FiniteDimensional ℝ E
s : Set E
x : E
hs : s ∈ 𝓝 x
d : ℝ
d_pos : 0 < d
hd : Euclidean.closedBall x d ⊆ s
c : ContDiffBump (toEuclidean x) :=
  { rIn := d / 2, rOut := d, rIn_pos := (_ : 0 < d / 2), rIn_lt_rOut := (_ : d / 2 < d) }
f : E → ℝ := ↑c ∘ ⇑toEuclidean
⊢ ∃ f, tsupport f ⊆ s ∧ HasCompactSupport f ∧ ContDiff ℝ ⊤ f ∧ range f ⊆ Icc 0 1 ∧ f x = 1

Next tactic:
have f_supp : f.support ⊆ Euclidean.ball x d := by
    intro y hy
    have : toEuclidean y ∈ Function.support c := by
      simpa only [Function.mem_support, Function.comp_apply, Ne.def] using hy
    rwa [c.support_eq] at this
/-- If a set `s` is a neighborhood of `x`, then there exists a smooth function `f` taking
values in `[0, 1]`, supported in `s` and with `f x = 1`. -/
theorem exists_smooth_tsupport_subset {s : Set E} {x : E} (hs : s ∈ 𝓝 x) :
    ∃ f : E → ℝ,
      tsupport f ⊆ s ∧ HasCompactSupport f ∧ ContDiff ℝ ⊤ f ∧ range f ⊆ Icc 0 1 ∧ f x = 1 := by
  obtain ⟨d : ℝ, d_pos : 0 < d, hd : Euclidean.closedBall x d ⊆ s⟩ :=
    Euclidean.nhds_basis_closedBall.mem_iff.1 hs
  let c : ContDiffBump (toEuclidean x) :=
    { rIn := d / 2
      rOut := d
      rIn_pos := half_pos d_pos
      rIn_lt_rOut := half_lt_self d_pos }
  let f : E → ℝ := c ∘ toEuclidean
  have f_supp : f.support ⊆ Euclidean.ball x d := by
    

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : FiniteDimensional ℝ E
s : Set E
x : E
hs : s ∈ 𝓝 x
d : ℝ
d_pos : 0 < d
hd : Euclidean.closedBall x d ⊆ s
c : ContDiffBump (toEuclidean x) :=
  { rIn := d / 2, rOut := d, rIn_pos := (_ : 0 < d / 2), rIn_lt_rOut := (_ : d / 2 < d) }
f : E → ℝ := ↑c ∘ ⇑toEuclidean
⊢ support f ⊆ Euclidean.ball x d

Next tactic:
intro y hy
/-- If a set `s` is a neighborhood of `x`, then there exists a smooth function `f` taking
values in `[0, 1]`, supported in `s` and with `f x = 1`. -/
theorem exists_smooth_tsupport_subset {s : Set E} {x : E} (hs : s ∈ 𝓝 x) :
    ∃ f : E → ℝ,
      tsupport f ⊆ s ∧ HasCompactSupport f ∧ ContDiff ℝ ⊤ f ∧ range f ⊆ Icc 0 1 ∧ f x = 1 := by
  obtain ⟨d : ℝ, d_pos : 0 < d, hd : Euclidean.closedBall x d ⊆ s⟩ :=
    Euclidean.nhds_basis_closedBall.mem_iff.1 hs
  let c : ContDiffBump (toEuclidean x) :=
    { rIn := d / 2
      rOut := d
      rIn_pos := half_pos d_pos
      rIn_lt_rOut := half_lt_self d_pos }
  let f : E → ℝ := c ∘ toEuclidean
  have f_supp : f.support ⊆ Euclidean.ball x d := by
    intro y hy
    

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : FiniteDimensional ℝ E
s : Set E
x : E
hs : s ∈ 𝓝 x
d : ℝ
d_pos : 0 < d
hd : Euclidean.closedBall x d ⊆ s
c : ContDiffBump (toEuclidean x) :=
  { rIn := d / 2, rOut := d, rIn_pos := (_ : 0 < d / 2), rIn_lt_rOut := (_ : d / 2 < d) }
f : E → ℝ := ↑c ∘ ⇑toEuclidean
y : E
hy : y ∈ support f
⊢ y ∈ Euclidean.ball x d

Next tactic:
have : toEuclidean y ∈ Function.support c := by
      simpa only [Function.mem_support, Function.comp_apply, Ne.def] using hy
/-- If a set `s` is a neighborhood of `x`, then there exists a smooth function `f` taking
values in `[0, 1]`, supported in `s` and with `f x = 1`. -/
theorem exists_smooth_tsupport_subset {s : Set E} {x : E} (hs : s ∈ 𝓝 x) :
    ∃ f : E → ℝ,
      tsupport f ⊆ s ∧ HasCompactSupport f ∧ ContDiff ℝ ⊤ f ∧ range f ⊆ Icc 0 1 ∧ f x = 1 := by
  obtain ⟨d : ℝ, d_pos : 0 < d, hd : Euclidean.closedBall x d ⊆ s⟩ :=
    Euclidean.nhds_basis_closedBall.mem_iff.1 hs
  let c : ContDiffBump (toEuclidean x) :=
    { rIn := d / 2
      rOut := d
      rIn_pos := half_pos d_pos
      rIn_lt_rOut := half_lt_self d_pos }
  let f : E → ℝ := c ∘ toEuclidean
  have f_supp : f.support ⊆ Euclidean.ball x d := by
    intro y hy
    have : toEuclidean y ∈ Function.support c := by
      

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : FiniteDimensional ℝ E
s : Set E
x : E
hs : s ∈ 𝓝 x
d : ℝ
d_pos : 0 < d
hd : Euclidean.closedBall x d ⊆ s
c : ContDiffBump (toEuclidean x) :=
  { rIn := d / 2, rOut := d, rIn_pos := (_ : 0 < d / 2), rIn_lt_rOut := (_ : d / 2 < d) }
f : E → ℝ := ↑c ∘ ⇑toEuclidean
y : E
hy : y ∈ support f
⊢ toEuclidean y ∈ support ↑c

Next tactic:
simpa only [Function.mem_support, Function.comp_apply, Ne.def] using hy
/-- If a set `s` is a neighborhood of `x`, then there exists a smooth function `f` taking
values in `[0, 1]`, supported in `s` and with `f x = 1`. -/
theorem exists_smooth_tsupport_subset {s : Set E} {x : E} (hs : s ∈ 𝓝 x) :
    ∃ f : E → ℝ,
      tsupport f ⊆ s ∧ HasCompactSupport f ∧ ContDiff ℝ ⊤ f ∧ range f ⊆ Icc 0 1 ∧ f x = 1 := by
  obtain ⟨d : ℝ, d_pos : 0 < d, hd : Euclidean.closedBall x d ⊆ s⟩ :=
    Euclidean.nhds_basis_closedBall.mem_iff.1 hs
  let c : ContDiffBump (toEuclidean x) :=
    { rIn := d / 2
      rOut := d
      rIn_pos := half_pos d_pos
      rIn_lt_rOut := half_lt_self d_pos }
  let f : E → ℝ := c ∘ toEuclidean
  have f_supp : f.support ⊆ Euclidean.ball x d := by
    intro y hy
    have : toEuclidean y ∈ Function.support c := by
      simpa only [Function.mem_support, Function.comp_apply, Ne.def] using hy
    

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : FiniteDimensional ℝ E
s : Set E
x : E
hs : s ∈ 𝓝 x
d : ℝ
d_pos : 0 < d
hd : Euclidean.closedBall x d ⊆ s
c : ContDiffBump (toEuclidean x) :=
  { rIn := d / 2, rOut := d, rIn_pos := (_ : 0 < d / 2), rIn_lt_rOut := (_ : d / 2 < d) }
f : E → ℝ := ↑c ∘ ⇑toEuclidean
y : E
hy : y ∈ support f
this : toEuclidean y ∈ support ↑c
⊢ y ∈ Euclidean.ball x d

Next tactic:
rwa [c.support_eq] at this