Theorem: AlgebraicGeometry.StructureSheaf.comap_id_eq_map
File: Mathlib/AlgebraicGeometry/StructureSheaf.lean

tactic: rw [comap_apply]
state_before: R : Type u
inst✝² : CommRing R
S : Type u
inst✝¹ : CommRing S
P : Type u
inst✝ : CommRing P
U V : Opens ↑(PrimeSpectrum.Top R)
iVU : V ⟶ U
s : ↑((structureSheaf R).val.obj { unop := U })
p : ↥{ unop := V }.unop
⊢ ↑((comap (RingHom.id R) U V ⋯) s) p = ↑(((structureSheaf R).val.map iVU.op) s) p
state_after: R : Type u
inst✝² : CommRing R
S : Type u
inst✝¹ : CommRing S
P : Type u
inst✝ : CommRing P
U V : Opens ↑(PrimeSpectrum.Top R)
iVU : V ⟶ U
s : ↑((structureSheaf R).val.obj { unop := U })
p : ↥{ unop := V }.unop
⊢ (Localization.localRingHom ((PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal (↑p).asIdeal (RingHom.id R) ⋯)
      (↑s ⟨(PrimeSpectrum.comap (RingHom.id R)) ↑p, ⋯⟩) =
    ↑(((structureSheaf R).val.map iVU.op) s) p

tactic: obtain ⟨W, hpW, iWU, h⟩ := s.2 (iVU p)
state_before: R : Type u
inst✝² : CommRing R
S : Type u
inst✝¹ : CommRing S
P : Type u
inst✝ : CommRing P
U V : Opens ↑(PrimeSpectrum.Top R)
iVU : V ⟶ U
s : ↑((structureSheaf R).val.obj { unop := U })
p : ↥{ unop := V }.unop
⊢ (Localization.localRingHom ((PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal (↑p).asIdeal (RingHom.id R) ⋯)
      (↑s ⟨(PrimeSpectrum.comap (RingHom.id R)) ↑p, ⋯⟩) =
    ↑(((structureSheaf R).val.map iVU.op) s) p
state_after: case intro.intro.intro
R : Type u
inst✝² : CommRing R
S : Type u
inst✝¹ : CommRing S
P : Type u
inst✝ : CommRing P
U V : Opens ↑(PrimeSpectrum.Top R)
iVU : V ⟶ U
s : ↑((structureSheaf R).val.obj { unop := U })
p : ↥{ unop := V }.unop
W : Opens ↑(PrimeSpectrum.Top R)
hpW : ↑((fun x => ⟨↑x, ⋯⟩) p) ∈ W
iWU : W ⟶ { unop := U }.unop
h : (isFractionPrelocal R).pred fun x => ↑s ((fun x => ⟨↑x, ⋯⟩) x)
⊢ (Localization.localRingHom ((PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal (↑p).asIdeal (RingHom.id R) ⋯)
      (↑s ⟨(PrimeSpectrum.comap (RingHom.id R)) ↑p, ⋯⟩) =
    ↑(((structureSheaf R).val.map iVU.op) s) p

tactic: obtain ⟨a, b, h'⟩ := h.eq_mk'
state_before: case intro.intro.intro
R : Type u
inst✝² : CommRing R
S : Type u
inst✝¹ : CommRing S
P : Type u
inst✝ : CommRing P
U V : Opens ↑(PrimeSpectrum.Top R)
iVU : V ⟶ U
s : ↑((structureSheaf R).val.obj { unop := U })
p : ↥{ unop := V }.unop
W : Opens ↑(PrimeSpectrum.Top R)
hpW : ↑((fun x => ⟨↑x, ⋯⟩) p) ∈ W
iWU : W ⟶ { unop := U }.unop
h : (isFractionPrelocal R).pred fun x => ↑s ((fun x => ⟨↑x, ⋯⟩) x)
⊢ (Localization.localRingHom ((PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal (↑p).asIdeal (RingHom.id R) ⋯)
      (↑s ⟨(PrimeSpectrum.comap (RingHom.id R)) ↑p, ⋯⟩) =
    ↑(((structureSheaf R).val.map iVU.op) s) p
state_after: case intro.intro.intro.intro.intro
R : Type u
inst✝² : CommRing R
S : Type u
inst✝¹ : CommRing S
P : Type u
inst✝ : CommRing P
U V : Opens ↑(PrimeSpectrum.Top R)
iVU : V ⟶ U
s : ↑((structureSheaf R).val.obj { unop := U })
p : ↥{ unop := V }.unop
W : Opens ↑(PrimeSpectrum.Top R)
hpW : ↑((fun x => ⟨↑x, ⋯⟩) p) ∈ W
iWU : W ⟶ { unop := U }.unop
h : (isFractionPrelocal R).pred fun x => ↑s ((fun x => ⟨↑x, ⋯⟩) x)
a b : R
h' :
  ∀ (x : ↥W),
    ∃ (hs : b ∉ (↑x).asIdeal),
      ↑s ((fun x => ⟨↑x, ⋯⟩) x) = IsLocalization.mk' (Localization.AtPrime (↑x).asIdeal) a ⟨b, hs⟩
⊢ (Localization.localRingHom ((PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal (↑p).asIdeal (RingHom.id R) ⋯)
      (↑s ⟨(PrimeSpectrum.comap (RingHom.id R)) ↑p, ⋯⟩) =
    ↑(((structureSheaf R).val.map iVU.op) s) p

tactic: obtain ⟨hb₁, s_eq₁⟩ := h' ⟨p, hpW⟩
state_before: case intro.intro.intro.intro.intro
R : Type u
inst✝² : CommRing R
S : Type u
inst✝¹ : CommRing S
P : Type u
inst✝ : CommRing P
U V : Opens ↑(PrimeSpectrum.Top R)
iVU : V ⟶ U
s : ↑((structureSheaf R).val.obj { unop := U })
p : ↥{ unop := V }.unop
W : Opens ↑(PrimeSpectrum.Top R)
hpW : ↑((fun x => ⟨↑x, ⋯⟩) p) ∈ W
iWU : W ⟶ { unop := U }.unop
h : (isFractionPrelocal R).pred fun x => ↑s ((fun x => ⟨↑x, ⋯⟩) x)
a b : R
h' :
  ∀ (x : ↥W),
    ∃ (hs : b ∉ (↑x).asIdeal),
      ↑s ((fun x => ⟨↑x, ⋯⟩) x) = IsLocalization.mk' (Localization.AtPrime (↑x).asIdeal) a ⟨b, hs⟩
⊢ (Localization.localRingHom ((PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal (↑p).asIdeal (RingHom.id R) ⋯)
      (↑s ⟨(PrimeSpectrum.comap (RingHom.id R)) ↑p, ⋯⟩) =
    ↑(((structureSheaf R).val.map iVU.op) s) p
state_after: case intro.intro.intro.intro.intro.intro
R : Type u
inst✝² : CommRing R
S : Type u
inst✝¹ : CommRing S
P : Type u
inst✝ : CommRing P
U V : Opens ↑(PrimeSpectrum.Top R)
iVU : V ⟶ U
s : ↑((structureSheaf R).val.obj { unop := U })
p : ↥{ unop := V }.unop
W : Opens ↑(PrimeSpectrum.Top R)
hpW : ↑((fun x => ⟨↑x, ⋯⟩) p) ∈ W
iWU : W ⟶ { unop := U }.unop
h : (isFractionPrelocal R).pred fun x => ↑s ((fun x => ⟨↑x, ⋯⟩) x)
a b : R
h' :
  ∀ (x : ↥W),
    ∃ (hs : b ∉ (↑x).asIdeal),
      ↑s ((fun x => ⟨↑x, ⋯⟩) x) = IsLocalization.mk' (Localization.AtPrime (↑x).asIdeal) a ⟨b, hs⟩
hb₁ : b ∉ (↑⟨↑p, hpW⟩).asIdeal
s_eq₁ : ↑s ((fun x => ⟨↑x, ⋯⟩) ⟨↑p, hpW⟩) = IsLocalization.mk' (Localization.AtPrime (↑⟨↑p, hpW⟩).asIdeal) a ⟨b, hb₁⟩
⊢ (Localization.localRingHom ((PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal (↑p).asIdeal (RingHom.id R) ⋯)
      (↑s ⟨(PrimeSpectrum.comap (RingHom.id R)) ↑p, ⋯⟩) =
    ↑(((structureSheaf R).val.map iVU.op) s) p

tactic: obtain ⟨hb₂, s_eq₂⟩ :=
  h' ⟨PrimeSpectrum.comap (RingHom.id _) p.1, hpW⟩
state_before: case intro.intro.intro.intro.intro.intro
R : Type u
inst✝² : CommRing R
S : Type u
inst✝¹ : CommRing S
P : Type u
inst✝ : CommRing P
U V : Opens ↑(PrimeSpectrum.Top R)
iVU : V ⟶ U
s : ↑((structureSheaf R).val.obj { unop := U })
p : ↥{ unop := V }.unop
W : Opens ↑(PrimeSpectrum.Top R)
hpW : ↑((fun x => ⟨↑x, ⋯⟩) p) ∈ W
iWU : W ⟶ { unop := U }.unop
h : (isFractionPrelocal R).pred fun x => ↑s ((fun x => ⟨↑x, ⋯⟩) x)
a b : R
h' :
  ∀ (x : ↥W),
    ∃ (hs : b ∉ (↑x).asIdeal),
      ↑s ((fun x => ⟨↑x, ⋯⟩) x) = IsLocalization.mk' (Localization.AtPrime (↑x).asIdeal) a ⟨b, hs⟩
hb₁ : b ∉ (↑⟨↑p, hpW⟩).asIdeal
s_eq₁ : ↑s ((fun x => ⟨↑x, ⋯⟩) ⟨↑p, hpW⟩) = IsLocalization.mk' (Localization.AtPrime (↑⟨↑p, hpW⟩).asIdeal) a ⟨b, hb₁⟩
⊢ (Localization.localRingHom ((PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal (↑p).asIdeal (RingHom.id R) ⋯)
      (↑s ⟨(PrimeSpectrum.comap (RingHom.id R)) ↑p, ⋯⟩) =
    ↑(((structureSheaf R).val.map iVU.op) s) p
state_after: case intro.intro.intro.intro.intro.intro.intro
R : Type u
inst✝² : CommRing R
S : Type u
inst✝¹ : CommRing S
P : Type u
inst✝ : CommRing P
U V : Opens ↑(PrimeSpectrum.Top R)
iVU : V ⟶ U
s : ↑((structureSheaf R).val.obj { unop := U })
p : ↥{ unop := V }.unop
W : Opens ↑(PrimeSpectrum.Top R)
hpW : ↑((fun x => ⟨↑x, ⋯⟩) p) ∈ W
iWU : W ⟶ { unop := U }.unop
h : (isFractionPrelocal R).pred fun x => ↑s ((fun x => ⟨↑x, ⋯⟩) x)
a b : R
h' :
  ∀ (x : ↥W),
    ∃ (hs : b ∉ (↑x).asIdeal),
      ↑s ((fun x => ⟨↑x, ⋯⟩) x) = IsLocalization.mk' (Localization.AtPrime (↑x).asIdeal) a ⟨b, hs⟩
hb₁ : b ∉ (↑⟨↑p, hpW⟩).asIdeal
s_eq₁ : ↑s ((fun x => ⟨↑x, ⋯⟩) ⟨↑p, hpW⟩) = IsLocalization.mk' (Localization.AtPrime (↑⟨↑p, hpW⟩).asIdeal) a ⟨b, hb₁⟩
hb₂ : b ∉ (↑⟨(PrimeSpectrum.comap (RingHom.id R)) ↑p, hpW⟩).asIdeal
s_eq₂ :
  ↑s ((fun x => ⟨↑x, ⋯⟩) ⟨(PrimeSpectrum.comap (RingHom.id R)) ↑p, hpW⟩) =
    IsLocalization.mk' (Localization.AtPrime (↑⟨(PrimeSpectrum.comap (RingHom.id R)) ↑p, hpW⟩).asIdeal) a ⟨b, hb₂⟩
⊢ (Localization.localRingHom ((PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal (↑p).asIdeal (RingHom.id R) ⋯)
      (↑s ⟨(PrimeSpectrum.comap (RingHom.id R)) ↑p, ⋯⟩) =
    ↑(((structureSheaf R).val.map iVU.op) s) p

tactic: dsimp only at s_eq₁ s_eq₂
state_before: case intro.intro.intro.intro.intro.intro.intro
R : Type u
inst✝² : CommRing R
S : Type u
inst✝¹ : CommRing S
P : Type u
inst✝ : CommRing P
U V : Opens ↑(PrimeSpectrum.Top R)
iVU : V ⟶ U
s : ↑((structureSheaf R).val.obj { unop := U })
p : ↥{ unop := V }.unop
W : Opens ↑(PrimeSpectrum.Top R)
hpW : ↑((fun x => ⟨↑x, ⋯⟩) p) ∈ W
iWU : W ⟶ { unop := U }.unop
h : (isFractionPrelocal R).pred fun x => ↑s ((fun x => ⟨↑x, ⋯⟩) x)
a b : R
h' :
  ∀ (x : ↥W),
    ∃ (hs : b ∉ (↑x).asIdeal),
      ↑s ((fun x => ⟨↑x, ⋯⟩) x) = IsLocalization.mk' (Localization.AtPrime (↑x).asIdeal) a ⟨b, hs⟩
hb₁ : b ∉ (↑⟨↑p, hpW⟩).asIdeal
s_eq₁ : ↑s ((fun x => ⟨↑x, ⋯⟩) ⟨↑p, hpW⟩) = IsLocalization.mk' (Localization.AtPrime (↑⟨↑p, hpW⟩).asIdeal) a ⟨b, hb₁⟩
hb₂ : b ∉ (↑⟨(PrimeSpectrum.comap (RingHom.id R)) ↑p, hpW⟩).asIdeal
s_eq₂ :
  ↑s ((fun x => ⟨↑x, ⋯⟩) ⟨(PrimeSpectrum.comap (RingHom.id R)) ↑p, hpW⟩) =
    IsLocalization.mk' (Localization.AtPrime (↑⟨(PrimeSpectrum.comap (RingHom.id R)) ↑p, hpW⟩).asIdeal) a ⟨b, hb₂⟩
⊢ (Localization.localRingHom ((PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal (↑p).asIdeal (RingHom.id R) ⋯)
      (↑s ⟨(PrimeSpectrum.comap (RingHom.id R)) ↑p, ⋯⟩) =
    ↑(((structureSheaf R).val.map iVU.op) s) p
state_after: case intro.intro.intro.intro.intro.intro.intro
R : Type u
inst✝² : CommRing R
S : Type u
inst✝¹ : CommRing S
P : Type u
inst✝ : CommRing P
U V : Opens ↑(PrimeSpectrum.Top R)
iVU : V ⟶ U
s : ↑((structureSheaf R).val.obj { unop := U })
p : ↥{ unop := V }.unop
W : Opens ↑(PrimeSpectrum.Top R)
hpW : ↑((fun x => ⟨↑x, ⋯⟩) p) ∈ W
iWU : W ⟶ { unop := U }.unop
h : (isFractionPrelocal R).pred fun x => ↑s ((fun x => ⟨↑x, ⋯⟩) x)
a b : R
h' :
  ∀ (x : ↥W),
    ∃ (hs : b ∉ (↑x).asIdeal),
      ↑s ((fun x => ⟨↑x, ⋯⟩) x) = IsLocalization.mk' (Localization.AtPrime (↑x).asIdeal) a ⟨b, hs⟩
hb₁ : b ∉ (↑⟨↑p, hpW⟩).asIdeal
s_eq₁ : ↑s ⟨↑p, ⋯⟩ = IsLocalization.mk' (Localization.AtPrime (↑p).asIdeal) a ⟨b, hb₁⟩
hb₂ : b ∉ (↑⟨(PrimeSpectrum.comap (RingHom.id R)) ↑p, hpW⟩).asIdeal
s_eq₂ :
  ↑s ⟨(PrimeSpectrum.comap (RingHom.id R)) ↑p, ⋯⟩ =
    IsLocalization.mk' (Localization.AtPrime ((PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal) a ⟨b, hb₂⟩
⊢ (Localization.localRingHom ((PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal (↑p).asIdeal (RingHom.id R) ⋯)
      (↑s ⟨(PrimeSpectrum.comap (RingHom.id R)) ↑p, ⋯⟩) =
    ↑(((structureSheaf R).val.map iVU.op) s) p

tactic: erw [s_eq₂, Localization.localRingHom_mk', ← s_eq₁, ← res_apply _ _ _ iVU]
state_before: case intro.intro.intro.intro.intro.intro.intro
R : Type u
inst✝² : CommRing R
S : Type u
inst✝¹ : CommRing S
P : Type u
inst✝ : CommRing P
U V : Opens ↑(PrimeSpectrum.Top R)
iVU : V ⟶ U
s : ↑((structureSheaf R).val.obj { unop := U })
p : ↥{ unop := V }.unop
W : Opens ↑(PrimeSpectrum.Top R)
hpW : ↑((fun x => ⟨↑x, ⋯⟩) p) ∈ W
iWU : W ⟶ { unop := U }.unop
h : (isFractionPrelocal R).pred fun x => ↑s ((fun x => ⟨↑x, ⋯⟩) x)
a b : R
h' :
  ∀ (x : ↥W),
    ∃ (hs : b ∉ (↑x).asIdeal),
      ↑s ((fun x => ⟨↑x, ⋯⟩) x) = IsLocalization.mk' (Localization.AtPrime (↑x).asIdeal) a ⟨b, hs⟩
hb₁ : b ∉ (↑⟨↑p, hpW⟩).asIdeal
s_eq₁ : ↑s ⟨↑p, ⋯⟩ = IsLocalization.mk' (Localization.AtPrime (↑p).asIdeal) a ⟨b, hb₁⟩
hb₂ : b ∉ (↑⟨(PrimeSpectrum.comap (RingHom.id R)) ↑p, hpW⟩).asIdeal
s_eq₂ :
  ↑s ⟨(PrimeSpectrum.comap (RingHom.id R)) ↑p, ⋯⟩ =
    IsLocalization.mk' (Localization.AtPrime ((PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal) a ⟨b, hb₂⟩
⊢ (Localization.localRingHom ((PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal (↑p).asIdeal (RingHom.id R) ⋯)
      (↑s ⟨(PrimeSpectrum.comap (RingHom.id R)) ↑p, ⋯⟩) =
    ↑(((structureSheaf R).val.map iVU.op) s) p
state_after: no goals