Theorem: AlgebraicGeometry.IsClosedImmersion.of_comp
File: Mathlib/AlgebraicGeometry/Morphisms/ClosedImmersion.lean

tactic: have h := closedEmbedding (f ≫ g)
state_before: X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
inst✝¹ : IsClosedImmersion g
inst✝ : IsClosedImmersion (f ≫ g)
⊢ ClosedEmbedding ⇑f.val.base
state_after: X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
inst✝¹ : IsClosedImmersion g
inst✝ : IsClosedImmersion (f ≫ g)
h : ClosedEmbedding ⇑(f ≫ g).val.base
⊢ ClosedEmbedding ⇑f.val.base

tactic: rw [Scheme.comp_val_base] at h
state_before: X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
inst✝¹ : IsClosedImmersion g
inst✝ : IsClosedImmersion (f ≫ g)
h : ClosedEmbedding ⇑(f ≫ g).val.base
⊢ ClosedEmbedding ⇑f.val.base
state_after: X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
inst✝¹ : IsClosedImmersion g
inst✝ : IsClosedImmersion (f ≫ g)
h : ClosedEmbedding ⇑(f.val.base ≫ g.val.base)
⊢ ClosedEmbedding ⇑f.val.base

tactic: apply closedEmbedding_of_continuous_injective_closed (Scheme.Hom.continuous f)
state_before: X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
inst✝¹ : IsClosedImmersion g
inst✝ : IsClosedImmersion (f ≫ g)
h : ClosedEmbedding ⇑(f.val.base ≫ g.val.base)
⊢ ClosedEmbedding ⇑f.val.base
state_after: case h₂
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
inst✝¹ : IsClosedImmersion g
inst✝ : IsClosedImmersion (f ≫ g)
h : ClosedEmbedding ⇑(f.val.base ≫ g.val.base)
⊢ Function.Injective ⇑f.val.base

case h₃
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
inst✝¹ : IsClosedImmersion g
inst✝ : IsClosedImmersion (f ≫ g)
h : ClosedEmbedding ⇑(f.val.base ≫ g.val.base)
⊢ IsClosedMap ⇑f.val.base

tactic: exact Function.Injective.of_comp h.inj
state_before: case h₂
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
inst✝¹ : IsClosedImmersion g
inst✝ : IsClosedImmersion (f ≫ g)
h : ClosedEmbedding ⇑(f.val.base ≫ g.val.base)
⊢ Function.Injective ⇑f.val.base
state_after: no goals

tactic: intro Z hZ
state_before: case h₃
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
inst✝¹ : IsClosedImmersion g
inst✝ : IsClosedImmersion (f ≫ g)
h : ClosedEmbedding ⇑(f.val.base ≫ g.val.base)
⊢ IsClosedMap ⇑f.val.base
state_after: case h₃
X Y Z✝ : Scheme
f : X ⟶ Y
g : Y ⟶ Z✝
inst✝¹ : IsClosedImmersion g
inst✝ : IsClosedImmersion (f ≫ g)
h : ClosedEmbedding ⇑(f.val.base ≫ g.val.base)
Z : Set ↑↑X.toPresheafedSpace
hZ : IsClosed Z
⊢ IsClosed (⇑f.val.base '' Z)

tactic: rw [ClosedEmbedding.closed_iff_image_closed (closedEmbedding g),
  ← Set.image_comp]
state_before: case h₃
X Y Z✝ : Scheme
f : X ⟶ Y
g : Y ⟶ Z✝
inst✝¹ : IsClosedImmersion g
inst✝ : IsClosedImmersion (f ≫ g)
h : ClosedEmbedding ⇑(f.val.base ≫ g.val.base)
Z : Set ↑↑X.toPresheafedSpace
hZ : IsClosed Z
⊢ IsClosed (⇑f.val.base '' Z)
state_after: case h₃
X Y Z✝ : Scheme
f : X ⟶ Y
g : Y ⟶ Z✝
inst✝¹ : IsClosedImmersion g
inst✝ : IsClosedImmersion (f ≫ g)
h : ClosedEmbedding ⇑(f.val.base ≫ g.val.base)
Z : Set ↑↑X.toPresheafedSpace
hZ : IsClosed Z
⊢ IsClosed (⇑g.val.base ∘ ⇑f.val.base '' Z)

tactic: exact ClosedEmbedding.isClosedMap h _ hZ
state_before: case h₃
X Y Z✝ : Scheme
f : X ⟶ Y
g : Y ⟶ Z✝
inst✝¹ : IsClosedImmersion g
inst✝ : IsClosedImmersion (f ≫ g)
h : ClosedEmbedding ⇑(f.val.base ≫ g.val.base)
Z : Set ↑↑X.toPresheafedSpace
hZ : IsClosed Z
⊢ IsClosed (⇑g.val.base ∘ ⇑f.val.base '' Z)
state_after: no goals

tactic: have h := surjective_stalkMap (f ≫ g) x
state_before: X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
inst✝¹ : IsClosedImmersion g
inst✝ : IsClosedImmersion (f ≫ g)
x : ↑↑X.toPresheafedSpace
⊢ Function.Surjective ⇑(PresheafedSpace.stalkMap f.val x)
state_after: X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
inst✝¹ : IsClosedImmersion g
inst✝ : IsClosedImmersion (f ≫ g)
x : ↑↑X.toPresheafedSpace
h : Function.Surjective ⇑(PresheafedSpace.stalkMap (f ≫ g).val x)
⊢ Function.Surjective ⇑(PresheafedSpace.stalkMap f.val x)

tactic: erw [Scheme.comp_val, PresheafedSpace.stalkMap.comp] at h
state_before: X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
inst✝¹ : IsClosedImmersion g
inst✝ : IsClosedImmersion (f ≫ g)
x : ↑↑X.toPresheafedSpace
h : Function.Surjective ⇑(PresheafedSpace.stalkMap (f ≫ g).val x)
⊢ Function.Surjective ⇑(PresheafedSpace.stalkMap f.val x)
state_after: X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
inst✝¹ : IsClosedImmersion g
inst✝ : IsClosedImmersion (f ≫ g)
x : ↑↑X.toPresheafedSpace
h : Function.Surjective ⇑(PresheafedSpace.stalkMap g.val (f.val.base x) ≫ PresheafedSpace.stalkMap f.val x)
⊢ Function.Surjective ⇑(PresheafedSpace.stalkMap f.val x)

tactic: exact Function.Surjective.of_comp h
state_before: X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
inst✝¹ : IsClosedImmersion g
inst✝ : IsClosedImmersion (f ≫ g)
x : ↑↑X.toPresheafedSpace
h : Function.Surjective ⇑(PresheafedSpace.stalkMap g.val (f.val.base x) ≫ PresheafedSpace.stalkMap f.val x)
⊢ Function.Surjective ⇑(PresheafedSpace.stalkMap f.val x)
state_after: no goals