l3lab/ntp-mathlib huggingface dataset:
theorem map_nhds_eq_of_surj [CompleteSpace E] [CompleteSpace F] {f : E → F} {f' : E →L[𝕜] F} {a : E}
    (hf : HasStrictFDerivAt f (f' : E →L[𝕜] F) a) (h : LinearMap.range f' = ⊤) :
    map f (𝓝 a) = 𝓝 (f a) := by
  let f'symm := f'.nonlinearRightInverseOfSurjective h
  set c : ℝ≥0 := f'symm.nnnorm⁻¹ / 2 with hc
  

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
F : Type u_3
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
G : Type u_4
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedSpace 𝕜 G
G' : Type u_5
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace 𝕜 G'
ε : ℝ
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
f : E → F
f' : E →L[𝕜] F
a : E
hf : HasStrictFDerivAt f f' a
h : LinearMap.range f' = ⊤
f'symm : ContinuousLinearMap.NonlinearRightInverse f' := ContinuousLinearMap.nonlinearRightInverseOfSurjective f' h
c : ℝ≥0 := f'symm.nnnorm⁻¹ / 2
hc : c = f'symm.nnnorm⁻¹ / 2
⊢ map f (𝓝 a) = 𝓝 (f a)

Next tactic:
have f'symm_pos : 0 < f'symm.nnnorm := f'.nonlinearRightInverseOfSurjective_nnnorm_pos h
theorem map_nhds_eq_of_surj [CompleteSpace E] [CompleteSpace F] {f : E → F} {f' : E →L[𝕜] F} {a : E}
    (hf : HasStrictFDerivAt f (f' : E →L[𝕜] F) a) (h : LinearMap.range f' = ⊤) :
    map f (𝓝 a) = 𝓝 (f a) := by
  let f'symm := f'.nonlinearRightInverseOfSurjective h
  set c : ℝ≥0 := f'symm.nnnorm⁻¹ / 2 with hc
  have f'symm_pos : 0 < f'symm.nnnorm := f'.nonlinearRightInverseOfSurjective_nnnorm_pos h
  

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
F : Type u_3
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
G : Type u_4
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedSpace 𝕜 G
G' : Type u_5
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace 𝕜 G'
ε : ℝ
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
f : E → F
f' : E →L[𝕜] F
a : E
hf : HasStrictFDerivAt f f' a
h : LinearMap.range f' = ⊤
f'symm : ContinuousLinearMap.NonlinearRightInverse f' := ContinuousLinearMap.nonlinearRightInverseOfSurjective f' h
c : ℝ≥0 := f'symm.nnnorm⁻¹ / 2
hc : c = f'symm.nnnorm⁻¹ / 2
f'symm_pos : 0 < f'symm.nnnorm
⊢ map f (𝓝 a) = 𝓝 (f a)

Next tactic:
have cpos : 0 < c := by simp [hc, half_pos, inv_pos, f'symm_pos]
theorem map_nhds_eq_of_surj [CompleteSpace E] [CompleteSpace F] {f : E → F} {f' : E →L[𝕜] F} {a : E}
    (hf : HasStrictFDerivAt f (f' : E →L[𝕜] F) a) (h : LinearMap.range f' = ⊤) :
    map f (𝓝 a) = 𝓝 (f a) := by
  let f'symm := f'.nonlinearRightInverseOfSurjective h
  set c : ℝ≥0 := f'symm.nnnorm⁻¹ / 2 with hc
  have f'symm_pos : 0 < f'symm.nnnorm := f'.nonlinearRightInverseOfSurjective_nnnorm_pos h
  have cpos : 0 < c := by 

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
F : Type u_3
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
G : Type u_4
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedSpace 𝕜 G
G' : Type u_5
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace 𝕜 G'
ε : ℝ
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
f : E → F
f' : E →L[𝕜] F
a : E
hf : HasStrictFDerivAt f f' a
h : LinearMap.range f' = ⊤
f'symm : ContinuousLinearMap.NonlinearRightInverse f' := ContinuousLinearMap.nonlinearRightInverseOfSurjective f' h
c : ℝ≥0 := f'symm.nnnorm⁻¹ / 2
hc : c = f'symm.nnnorm⁻¹ / 2
f'symm_pos : 0 < f'symm.nnnorm
⊢ 0 < c

Next tactic:
simp [hc, half_pos, inv_pos, f'symm_pos]
theorem map_nhds_eq_of_surj [CompleteSpace E] [CompleteSpace F] {f : E → F} {f' : E →L[𝕜] F} {a : E}
    (hf : HasStrictFDerivAt f (f' : E →L[𝕜] F) a) (h : LinearMap.range f' = ⊤) :
    map f (𝓝 a) = 𝓝 (f a) := by
  let f'symm := f'.nonlinearRightInverseOfSurjective h
  set c : ℝ≥0 := f'symm.nnnorm⁻¹ / 2 with hc
  have f'symm_pos : 0 < f'symm.nnnorm := f'.nonlinearRightInverseOfSurjective_nnnorm_pos h
  have cpos : 0 < c := by simp [hc, half_pos, inv_pos, f'symm_pos]
  

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
F : Type u_3
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
G : Type u_4
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedSpace 𝕜 G
G' : Type u_5
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace 𝕜 G'
ε : ℝ
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
f : E → F
f' : E →L[𝕜] F
a : E
hf : HasStrictFDerivAt f f' a
h : LinearMap.range f' = ⊤
f'symm : ContinuousLinearMap.NonlinearRightInverse f' := ContinuousLinearMap.nonlinearRightInverseOfSurjective f' h
c : ℝ≥0 := f'symm.nnnorm⁻¹ / 2
hc : c = f'symm.nnnorm⁻¹ / 2
f'symm_pos : 0 < f'symm.nnnorm
cpos : 0 < c
⊢ map f (𝓝 a) = 𝓝 (f a)

Next tactic:
obtain ⟨s, s_nhds, hs⟩ : ∃ s ∈ 𝓝 a, ApproximatesLinearOn f f' s c :=
    hf.approximates_deriv_on_nhds (Or.inr cpos)
theorem map_nhds_eq_of_surj [CompleteSpace E] [CompleteSpace F] {f : E → F} {f' : E →L[𝕜] F} {a : E}
    (hf : HasStrictFDerivAt f (f' : E →L[𝕜] F) a) (h : LinearMap.range f' = ⊤) :
    map f (𝓝 a) = 𝓝 (f a) := by
  let f'symm := f'.nonlinearRightInverseOfSurjective h
  set c : ℝ≥0 := f'symm.nnnorm⁻¹ / 2 with hc
  have f'symm_pos : 0 < f'symm.nnnorm := f'.nonlinearRightInverseOfSurjective_nnnorm_pos h
  have cpos : 0 < c := by simp [hc, half_pos, inv_pos, f'symm_pos]
  obtain ⟨s, s_nhds, hs⟩ : ∃ s ∈ 𝓝 a, ApproximatesLinearOn f f' s c :=
    hf.approximates_deriv_on_nhds (Or.inr cpos)
  

Proof state:
case intro.intro
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
F : Type u_3
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
G : Type u_4
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedSpace 𝕜 G
G' : Type u_5
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace 𝕜 G'
ε : ℝ
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
f : E → F
f' : E →L[𝕜] F
a : E
hf : HasStrictFDerivAt f f' a
h : LinearMap.range f' = ⊤
f'symm : ContinuousLinearMap.NonlinearRightInverse f' := ContinuousLinearMap.nonlinearRightInverseOfSurjective f' h
c : ℝ≥0 := f'symm.nnnorm⁻¹ / 2
hc : c = f'symm.nnnorm⁻¹ / 2
f'symm_pos : 0 < f'symm.nnnorm
cpos : 0 < c
s : Set E
s_nhds : s ∈ 𝓝 a
hs : ApproximatesLinearOn f f' s c
⊢ map f (𝓝 a) = 𝓝 (f a)

Next tactic:
apply hs.map_nhds_eq f'symm s_nhds (Or.inr (NNReal.half_lt_self _))
theorem map_nhds_eq_of_surj [CompleteSpace E] [CompleteSpace F] {f : E → F} {f' : E →L[𝕜] F} {a : E}
    (hf : HasStrictFDerivAt f (f' : E →L[𝕜] F) a) (h : LinearMap.range f' = ⊤) :
    map f (𝓝 a) = 𝓝 (f a) := by
  let f'symm := f'.nonlinearRightInverseOfSurjective h
  set c : ℝ≥0 := f'symm.nnnorm⁻¹ / 2 with hc
  have f'symm_pos : 0 < f'symm.nnnorm := f'.nonlinearRightInverseOfSurjective_nnnorm_pos h
  have cpos : 0 < c := by simp [hc, half_pos, inv_pos, f'symm_pos]
  obtain ⟨s, s_nhds, hs⟩ : ∃ s ∈ 𝓝 a, ApproximatesLinearOn f f' s c :=
    hf.approximates_deriv_on_nhds (Or.inr cpos)
  apply hs.map_nhds_eq f'symm s_nhds (Or.inr (NNReal.half_lt_self _))
  

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
F : Type u_3
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
G : Type u_4
inst✝⁵ : NormedAddCommGroup G
inst✝⁴ : NormedSpace 𝕜 G
G' : Type u_5
inst✝³ : NormedAddCommGroup G'
inst✝² : NormedSpace 𝕜 G'
ε : ℝ
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
f : E → F
f' : E →L[𝕜] F
a : E
hf : HasStrictFDerivAt f f' a
h : LinearMap.range f' = ⊤
f'symm : ContinuousLinearMap.NonlinearRightInverse f' := ContinuousLinearMap.nonlinearRightInverseOfSurjective f' h
c : ℝ≥0 := f'symm.nnnorm⁻¹ / 2
hc : c = f'symm.nnnorm⁻¹ / 2
f'symm_pos : 0 < f'symm.nnnorm
cpos : 0 < c
s : Set E
s_nhds : s ∈ 𝓝 a
hs : ApproximatesLinearOn f f' s c
⊢ f'symm.nnnorm⁻¹ ≠ 0

Next tactic:
simp [ne_of_gt f'symm_pos]
theorem approximates_deriv_on_open_nhds (hf : HasStrictFDerivAt f (f' : E →L[𝕜] F) a) :
    ∃ s : Set E, a ∈ s ∧ IsOpen s ∧
      ApproximatesLinearOn f (f' : E →L[𝕜] F) s (‖(f'.symm : F →L[𝕜] E)‖₊⁻¹ / 2) := by
  

Proof state:
𝕜 : Type u_1
inst✝⁹ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace 𝕜 E
F : Type u_3
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜 F
G : Type u_4
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedSpace 𝕜 G
G' : Type u_5
inst✝² : NormedAddCommGroup G'
inst✝¹ : NormedSpace 𝕜 G'
ε : ℝ
inst✝ : CompleteSpace E
f : E → F
f' : E ≃L[𝕜] F
a : E
hf : HasStrictFDerivAt f (↑f') a
⊢ ∃ s, a ∈ s ∧ IsOpen s ∧ ApproximatesLinearOn f (↑f') s (‖↑(ContinuousLinearEquiv.symm f')‖₊⁻¹ / 2)

Next tactic:
simp only [← and_assoc]
theorem approximates_deriv_on_open_nhds (hf : HasStrictFDerivAt f (f' : E →L[𝕜] F) a) :
    ∃ s : Set E, a ∈ s ∧ IsOpen s ∧
      ApproximatesLinearOn f (f' : E →L[𝕜] F) s (‖(f'.symm : F →L[𝕜] E)‖₊⁻¹ / 2) := by
  simp only [← and_assoc]
  

Proof state:
𝕜 : Type u_1
inst✝⁹ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace 𝕜 E
F : Type u_3
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜 F
G : Type u_4
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedSpace 𝕜 G
G' : Type u_5
inst✝² : NormedAddCommGroup G'
inst✝¹ : NormedSpace 𝕜 G'
ε : ℝ
inst✝ : CompleteSpace E
f : E → F
f' : E ≃L[𝕜] F
a : E
hf : HasStrictFDerivAt f (↑f') a
⊢ ∃ s, (a ∈ s ∧ IsOpen s) ∧ ApproximatesLinearOn f (↑f') s (‖↑(ContinuousLinearEquiv.symm f')‖₊⁻¹ / 2)

Next tactic:
refine ((nhds_basis_opens a).exists_iff fun s t => ApproximatesLinearOn.mono_set).1 ?_
theorem approximates_deriv_on_open_nhds (hf : HasStrictFDerivAt f (f' : E →L[𝕜] F) a) :
    ∃ s : Set E, a ∈ s ∧ IsOpen s ∧
      ApproximatesLinearOn f (f' : E →L[𝕜] F) s (‖(f'.symm : F →L[𝕜] E)‖₊⁻¹ / 2) := by
  simp only [← and_assoc]
  refine ((nhds_basis_opens a).exists_iff fun s t => ApproximatesLinearOn.mono_set).1 ?_
  

Proof state:
𝕜 : Type u_1
inst✝⁹ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace 𝕜 E
F : Type u_3
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜 F
G : Type u_4
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedSpace 𝕜 G
G' : Type u_5
inst✝² : NormedAddCommGroup G'
inst✝¹ : NormedSpace 𝕜 G'
ε : ℝ
inst✝ : CompleteSpace E
f : E → F
f' : E ≃L[𝕜] F
a : E
hf : HasStrictFDerivAt f (↑f') a
⊢ ∃ s ∈ 𝓝 a, ApproximatesLinearOn f (↑f') s (‖↑(ContinuousLinearEquiv.symm f')‖₊⁻¹ / 2)

Next tactic:
exact
    hf.approximates_deriv_on_nhds <|
      f'.subsingleton_or_nnnorm_symm_pos.imp id fun hf' => half_pos <| inv_pos.2 hf'
/-- If `f` has an invertible derivative `f'` at `a` in the sense of strict differentiability `(hf)`,
then the inverse function `hf.localInverse f` has derivative `f'.symm` at `f a`. -/
theorem to_localInverse (hf : HasStrictFDerivAt f (f' : E →L[𝕜] F) a) :
    HasStrictFDerivAt (hf.localInverse f f' a) (f'.symm : F →L[𝕜] E) (f a) :=
  (hf.toPartialHomeomorph f).hasStrictFDerivAt_symm hf.image_mem_toPartialHomeomorph_target <| by
    

Proof state:
𝕜 : Type u_1
inst✝⁹ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace 𝕜 E
F : Type u_3
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜 F
G : Type u_4
inst✝⁴ : NormedAddCommGroup G
inst✝³ : NormedSpace 𝕜 G
G' : Type u_5
inst✝² : NormedAddCommGroup G'
inst✝¹ : NormedSpace 𝕜 G'
ε : ℝ
inst✝ : CompleteSpace E
f : E → F
f' : E ≃L[𝕜] F
a : E
hf : HasStrictFDerivAt f (↑f') a
⊢ HasStrictFDerivAt (↑(toPartialHomeomorph f hf)) (↑f') (↑(PartialHomeomorph.symm (toPartialHomeomorph f hf)) (f a))

Next tactic:
simpa [← localInverse_def] using hf
@[ext]
theorem Hom.ext {X Y : PresheafedSpace C} (α β : Hom X Y) (w : α.base = β.base)
    (h : α.c ≫ whiskerRight (eqToHom (by 

Proof state:
C : Type u_1
inst✝ : Category.{?u.4198, u_1} C
X Y : PresheafedSpace C
α β : Hom X Y
w : α.base = β.base
⊢ (Opens.map α.base).op = (Opens.map β.base).op

Next tactic:
rw [w]
@[ext]
theorem Hom.ext {X Y : PresheafedSpace C} (α β : Hom X Y) (w : α.base = β.base)
    (h : α.c ≫ whiskerRight (eqToHom (by rw [w])) _ = β.c) : α = β := by
  

Proof state:
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
α β : Hom X Y
w : α.base = β.base
h : α.c ≫ whiskerRight (eqToHom (_ : (Opens.map α.base).op = (Opens.map β.base).op)) X.presheaf = β.c
⊢ α = β

Next tactic:
rcases α with ⟨base, c⟩
@[ext]
theorem Hom.ext {X Y : PresheafedSpace C} (α β : Hom X Y) (w : α.base = β.base)
    (h : α.c ≫ whiskerRight (eqToHom (by rw [w])) _ = β.c) : α = β := by
  rcases α with ⟨base, c⟩
  

Proof state:
case mk
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
β : Hom X Y
base : ↑X ⟶ ↑Y
c : Y.presheaf ⟶ base _* X.presheaf
w : { base := base, c := c }.base = β.base
h :
  { base := base, c := c }.c ≫
      whiskerRight (eqToHom (_ : (Opens.map { base := base, c := c }.base).op = (Opens.map β.base).op)) X.presheaf =
    β.c
⊢ { base := base, c := c } = β

Next tactic:
rcases β with ⟨base', c'⟩
@[ext]
theorem Hom.ext {X Y : PresheafedSpace C} (α β : Hom X Y) (w : α.base = β.base)
    (h : α.c ≫ whiskerRight (eqToHom (by rw [w])) _ = β.c) : α = β := by
  rcases α with ⟨base, c⟩
  rcases β with ⟨base', c'⟩
  

Proof state:
case mk.mk
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
base : ↑X ⟶ ↑Y
c : Y.presheaf ⟶ base _* X.presheaf
base' : ↑X ⟶ ↑Y
c' : Y.presheaf ⟶ base' _* X.presheaf
w : { base := base, c := c }.base = { base := base', c := c' }.base
h :
  { base := base, c := c }.c ≫
      whiskerRight
        (eqToHom (_ : (Opens.map { base := base, c := c }.base).op = (Opens.map { base := base', c := c' }.base).op))
        X.presheaf =
    { base := base', c := c' }.c
⊢ { base := base, c := c } = { base := base', c := c' }

Next tactic:
dsimp at w
@[ext]
theorem Hom.ext {X Y : PresheafedSpace C} (α β : Hom X Y) (w : α.base = β.base)
    (h : α.c ≫ whiskerRight (eqToHom (by rw [w])) _ = β.c) : α = β := by
  rcases α with ⟨base, c⟩
  rcases β with ⟨base', c'⟩
  dsimp at w
  

Proof state:
case mk.mk
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
base : ↑X ⟶ ↑Y
c : Y.presheaf ⟶ base _* X.presheaf
base' : ↑X ⟶ ↑Y
c' : Y.presheaf ⟶ base' _* X.presheaf
w : base = base'
h :
  { base := base, c := c }.c ≫
      whiskerRight
        (eqToHom (_ : (Opens.map { base := base, c := c }.base).op = (Opens.map { base := base', c := c' }.base).op))
        X.presheaf =
    { base := base', c := c' }.c
⊢ { base := base, c := c } = { base := base', c := c' }

Next tactic:
subst w
@[ext]
theorem Hom.ext {X Y : PresheafedSpace C} (α β : Hom X Y) (w : α.base = β.base)
    (h : α.c ≫ whiskerRight (eqToHom (by rw [w])) _ = β.c) : α = β := by
  rcases α with ⟨base, c⟩
  rcases β with ⟨base', c'⟩
  dsimp at w
  subst w
  

Proof state:
case mk.mk
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
base : ↑X ⟶ ↑Y
c c' : Y.presheaf ⟶ base _* X.presheaf
h :
  { base := base, c := c }.c ≫
      whiskerRight
        (eqToHom (_ : (Opens.map { base := base, c := c }.base).op = (Opens.map { base := base, c := c' }.base).op))
        X.presheaf =
    { base := base, c := c' }.c
⊢ { base := base, c := c } = { base := base, c := c' }

Next tactic:
dsimp at h
@[ext]
theorem Hom.ext {X Y : PresheafedSpace C} (α β : Hom X Y) (w : α.base = β.base)
    (h : α.c ≫ whiskerRight (eqToHom (by rw [w])) _ = β.c) : α = β := by
  rcases α with ⟨base, c⟩
  rcases β with ⟨base', c'⟩
  dsimp at w
  subst w
  dsimp at h
  

Proof state:
case mk.mk
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
base : ↑X ⟶ ↑Y
c c' : Y.presheaf ⟶ base _* X.presheaf
h : c ≫ whiskerRight (𝟙 (Opens.map base).op) X.presheaf = c'
⊢ { base := base, c := c } = { base := base, c := c' }

Next tactic:
erw [whiskerRight_id', comp_id] at h
@[ext]
theorem Hom.ext {X Y : PresheafedSpace C} (α β : Hom X Y) (w : α.base = β.base)
    (h : α.c ≫ whiskerRight (eqToHom (by rw [w])) _ = β.c) : α = β := by
  rcases α with ⟨base, c⟩
  rcases β with ⟨base', c'⟩
  dsimp at w
  subst w
  dsimp at h
  erw [whiskerRight_id', comp_id] at h
  

Proof state:
case mk.mk
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
base : ↑X ⟶ ↑Y
c c' : Y.presheaf ⟶ base _* X.presheaf
h : c = c'
⊢ { base := base, c := c } = { base := base, c := c' }

Next tactic:
subst h
@[ext]
theorem Hom.ext {X Y : PresheafedSpace C} (α β : Hom X Y) (w : α.base = β.base)
    (h : α.c ≫ whiskerRight (eqToHom (by rw [w])) _ = β.c) : α = β := by
  rcases α with ⟨base, c⟩
  rcases β with ⟨base', c'⟩
  dsimp at w
  subst w
  dsimp at h
  erw [whiskerRight_id', comp_id] at h
  subst h
  

Proof state:
case mk.mk
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
base : ↑X ⟶ ↑Y
c : Y.presheaf ⟶ base _* X.presheaf
⊢ { base := base, c := c } = { base := base, c := c }

Next tactic:
rfl
theorem hext {X Y : PresheafedSpace C} (α β : Hom X Y) (w : α.base = β.base) (h : HEq α.c β.c) :
    α = β := by
  

Proof state:
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
α β : Hom X Y
w : α.base = β.base
h : HEq α.c β.c
⊢ α = β

Next tactic:
cases α
theorem hext {X Y : PresheafedSpace C} (α β : Hom X Y) (w : α.base = β.base) (h : HEq α.c β.c) :
    α = β := by
  cases α
  

Proof state:
case mk
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
β : Hom X Y
base✝ : ↑X ⟶ ↑Y
c✝ : Y.presheaf ⟶ base✝ _* X.presheaf
w : { base := base✝, c := c✝ }.base = β.base
h : HEq { base := base✝, c := c✝ }.c β.c
⊢ { base := base✝, c := c✝ } = β

Next tactic:
cases β
theorem hext {X Y : PresheafedSpace C} (α β : Hom X Y) (w : α.base = β.base) (h : HEq α.c β.c) :
    α = β := by
  cases α
  cases β
  

Proof state:
case mk.mk
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
base✝¹ : ↑X ⟶ ↑Y
c✝¹ : Y.presheaf ⟶ base✝¹ _* X.presheaf
base✝ : ↑X ⟶ ↑Y
c✝ : Y.presheaf ⟶ base✝ _* X.presheaf
w : { base := base✝¹, c := c✝¹ }.base = { base := base✝, c := c✝ }.base
h : HEq { base := base✝¹, c := c✝¹ }.c { base := base✝, c := c✝ }.c
⊢ { base := base✝¹, c := c✝¹ } = { base := base✝, c := c✝ }

Next tactic:
congr
/-- The category of PresheafedSpaces. Morphisms are pairs, a continuous map and a presheaf map
    from the presheaf on the target to the pushforward of the presheaf on the source. -/
instance categoryOfPresheafedSpaces : Category (PresheafedSpace C) where
  Hom := Hom
  id := id
  comp := comp
  id_comp _ := by
    

Proof state:
C : Type u_1
inst✝ : Category.{?u.70858, u_1} C
X✝ Y✝ : PresheafedSpace C
x✝ : X✝ ⟶ Y✝
⊢ 𝟙 X✝ ≫ x✝ = x✝

Next tactic:
dsimp
/-- The category of PresheafedSpaces. Morphisms are pairs, a continuous map and a presheaf map
    from the presheaf on the target to the pushforward of the presheaf on the source. -/
instance categoryOfPresheafedSpaces : Category (PresheafedSpace C) where
  Hom := Hom
  id := id
  comp := comp
  id_comp _ := by
    dsimp
    

Proof state:
C : Type u_1
inst✝ : Category.{?u.70858, u_1} C
X✝ Y✝ : PresheafedSpace C
x✝ : X✝ ⟶ Y✝
⊢ { base := 𝟙 ↑X✝ ≫ x✝.base, c := x✝.c ≫ (Presheaf.pushforward C x✝.base).map (𝟙 X✝.presheaf) } = x✝

Next tactic:
ext
/-- The category of PresheafedSpaces. Morphisms are pairs, a continuous map and a presheaf map
    from the presheaf on the target to the pushforward of the presheaf on the source. -/
instance categoryOfPresheafedSpaces : Category (PresheafedSpace C) where
  Hom := Hom
  id := id
  comp := comp
  id_comp _ := by
    dsimp
    ext
    · 

Proof state:
case w.w
C : Type u_1
inst✝ : Category.{?u.70858, u_1} C
X✝ Y✝ : PresheafedSpace C
x✝¹ : X✝ ⟶ Y✝
x✝ : (forget TopCat).obj ↑X✝
⊢ { base := 𝟙 ↑X✝ ≫ x✝¹.base, c := x✝¹.c ≫ (Presheaf.pushforward C x✝¹.base).map (𝟙 X✝.presheaf) }.base x✝ = x✝¹.base x✝

Next tactic:
dsimp
/-- The category of PresheafedSpaces. Morphisms are pairs, a continuous map and a presheaf map
    from the presheaf on the target to the pushforward of the presheaf on the source. -/
instance categoryOfPresheafedSpaces : Category (PresheafedSpace C) where
  Hom := Hom
  id := id
  comp := comp
  id_comp _ := by
    dsimp
    ext
    · dsimp
      

Proof state:
case w.w
C : Type u_1
inst✝ : Category.{?u.70858, u_1} C
X✝ Y✝ : PresheafedSpace C
x✝¹ : X✝ ⟶ Y✝
x✝ : (forget TopCat).obj ↑X✝
⊢ (𝟙 ↑X✝ ≫ x✝¹.base) x✝ = x✝¹.base x✝

Next tactic:
simp
/-- The category of PresheafedSpaces. Morphisms are pairs, a continuous map and a presheaf map
    from the presheaf on the target to the pushforward of the presheaf on the source. -/
instance categoryOfPresheafedSpaces : Category (PresheafedSpace C) where
  Hom := Hom
  id := id
  comp := comp
  id_comp _ := by
    dsimp
    ext
    · dsimp
      simp
    · 

Proof state:
case h.w
C : Type u_1
inst✝ : Category.{?u.70858, u_1} C
X✝ Y✝ : PresheafedSpace C
x✝ : X✝ ⟶ Y✝
U✝ : Opens ↑↑Y✝
⊢ ({ base := 𝟙 ↑X✝ ≫ x✝.base, c := x✝.c ≫ (Presheaf.pushforward C x✝.base).map (𝟙 X✝.presheaf) }.c ≫
          whiskerRight
            (eqToHom
              (_ :
                (Opens.map
                      { base := 𝟙 ↑X✝ ≫ x✝.base,
                          c := x✝.c ≫ (Presheaf.pushforward C x✝.base).map (𝟙 X✝.presheaf) }.base).op =
                  (Opens.map x✝.base).op))
            X✝.presheaf).app
      (op U✝) =
    x✝.c.app (op U✝)

Next tactic:
dsimp
/-- The category of PresheafedSpaces. Morphisms are pairs, a continuous map and a presheaf map
    from the presheaf on the target to the pushforward of the presheaf on the source. -/
instance categoryOfPresheafedSpaces : Category (PresheafedSpace C) where
  Hom := Hom
  id := id
  comp := comp
  id_comp _ := by
    dsimp
    ext
    · dsimp
      simp
    · dsimp
      

Proof state:
case h.w
C : Type u_1
inst✝ : Category.{?u.70858, u_1} C
X✝ Y✝ : PresheafedSpace C
x✝ : X✝ ⟶ Y✝
U✝ : Opens ↑↑Y✝
⊢ ((x✝.c ≫ (Presheaf.pushforward C x✝.base).map (𝟙 X✝.presheaf)) ≫
          whiskerRight (𝟙 (Opens.map (𝟙 ↑X✝ ≫ x✝.base)).op) X✝.presheaf).app
      (op U✝) =
    x✝.c.app (op U✝)

Next tactic:
simp only [map_id, whiskerRight_id', assoc]
/-- The category of PresheafedSpaces. Morphisms are pairs, a continuous map and a presheaf map
    from the presheaf on the target to the pushforward of the presheaf on the source. -/
instance categoryOfPresheafedSpaces : Category (PresheafedSpace C) where
  Hom := Hom
  id := id
  comp := comp
  id_comp _ := by
    dsimp
    ext
    · dsimp
      simp
    · dsimp
      simp only [map_id, whiskerRight_id', assoc]
      

Proof state:
case h.w
C : Type u_1
inst✝ : Category.{?u.70858, u_1} C
X✝ Y✝ : PresheafedSpace C
x✝ : X✝ ⟶ Y✝
U✝ : Opens ↑↑Y✝
⊢ (x✝.c ≫ 𝟙 ((Presheaf.pushforward C x✝.base).obj X✝.presheaf) ≫ 𝟙 ((Opens.map (𝟙 ↑X✝ ≫ x✝.base)).op ⋙ X✝.presheaf)).app
      (op U✝) =
    x✝.c.app (op U✝)

Next tactic:
erw [comp_id, comp_id]
@[ext]
theorem ext {X Y : PresheafedSpace C} (α β : X ⟶ Y) (w : α.base = β.base)
    (h : α.c ≫ whiskerRight (eqToHom (by 

Proof state:
C : Type u_1
inst✝ : Category.{?u.78981, u_1} C
X Y : PresheafedSpace C
α β : X ⟶ Y
w : α.base = β.base
⊢ (Opens.map α.base).op = (Opens.map β.base).op

Next tactic:
rw [w]
@[simp]
theorem id_c_app (X : PresheafedSpace C) (U) :
    (𝟙 X : X ⟶ X).c.app U = X.presheaf.map (𝟙 U) := by
  

Proof state:
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X : PresheafedSpace C
U : (Opens ↑↑X)ᵒᵖ
⊢ (𝟙 X).c.app U = X.presheaf.map (𝟙 U)

Next tactic:
rw [id_c, map_id]
@[simp]
theorem id_c_app (X : PresheafedSpace C) (U) :
    (𝟙 X : X ⟶ X).c.app U = X.presheaf.map (𝟙 U) := by
  rw [id_c, map_id]
  

Proof state:
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X : PresheafedSpace C
U : (Opens ↑↑X)ᵒᵖ
⊢ (𝟙 X.presheaf).app U = 𝟙 (X.presheaf.obj U)

Next tactic:
rfl
theorem congr_app {X Y : PresheafedSpace C} {α β : X ⟶ Y} (h : α = β) (U) :
    α.c.app U = β.c.app U ≫ X.presheaf.map (eqToHom (by 

Proof state:
C : Type u_1
inst✝ : Category.{?u.146828, u_1} C
X Y : PresheafedSpace C
α β : X ⟶ Y
h : α = β
U : (Opens ↑↑Y)ᵒᵖ
⊢ (Opens.map β.base).op.obj U = (Opens.map α.base).op.obj U

Next tactic:
subst h
theorem congr_app {X Y : PresheafedSpace C} {α β : X ⟶ Y} (h : α = β) (U) :
    α.c.app U = β.c.app U ≫ X.presheaf.map (eqToHom (by subst h; 

Proof state:
C : Type u_1
inst✝ : Category.{?u.146828, u_1} C
X Y : PresheafedSpace C
α : X ⟶ Y
U : (Opens ↑↑Y)ᵒᵖ
⊢ (Opens.map α.base).op.obj U = (Opens.map α.base).op.obj U

Next tactic:
rfl