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 U.op)
p : { x // x ∈ V.op.unop }
⊢ ↑(↑(comap (RingHom.id R) U V (_ : ∀ (p : ↑(PrimeSpectrum.Top R)), p ∈ V.carrier → p ∈ ↑U)) s) 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 U.op)
p : { x // x ∈ V.op.unop }
⊢ ↑(Localization.localRingHom (↑(PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal (↑p).asIdeal (RingHom.id R)
          (_ : (↑(PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal = (↑(PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal))
      (↑s { val := ↑(PrimeSpectrum.comap (RingHom.id R)) ↑p, property := (_ : ↑p ∈ ↑U) }) =
    ↑(↑((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 U.op)
p : { x // x ∈ V.op.unop }
W : Opens ↑(PrimeSpectrum.Top R)
hpW : ↑((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U) }) p) ∈ W
iWU : W ⟶ U.op.unop
h :
  PrelocalPredicate.pred (isFractionPrelocal R) fun x =>
    ↑s ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.op.unop) }) x)
⊢ ↑(Localization.localRingHom (↑(PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal (↑p).asIdeal (RingHom.id R)
          (_ : (↑(PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal = (↑(PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal))
      (↑s { val := ↑(PrimeSpectrum.comap (RingHom.id R)) ↑p, property := (_ : ↑p ∈ ↑U) }) =
    ↑(↑((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 U.op)
p : { x // x ∈ V.op.unop }
W : Opens ↑(PrimeSpectrum.Top R)
hpW : ↑((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U) }) p) ∈ W
iWU : W ⟶ U.op.unop
h :
  PrelocalPredicate.pred (isFractionPrelocal R) fun x =>
    ↑s ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.op.unop) }) x)
a b : R
h' :
  ∀ (x : { x // x ∈ W }),
    ∃ hs,
      (fun x => ↑s ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.op.unop) }) x)) x =
        IsLocalization.mk' (Localization.AtPrime (↑x).asIdeal) a { val := b, property := hs }
⊢ ↑(Localization.localRingHom (↑(PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal (↑p).asIdeal (RingHom.id R)
          (_ : (↑(PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal = (↑(PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal))
      (↑s { val := ↑(PrimeSpectrum.comap (RingHom.id R)) ↑p, property := (_ : ↑p ∈ ↑U) }) =
    ↑(↑((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 U.op)
p : { x // x ∈ V.op.unop }
W : Opens ↑(PrimeSpectrum.Top R)
hpW : ↑((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U) }) p) ∈ W
iWU : W ⟶ U.op.unop
h :
  PrelocalPredicate.pred (isFractionPrelocal R) fun x =>
    ↑s ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.op.unop) }) x)
a b : R
h' :
  ∀ (x : { x // x ∈ W }),
    ∃ hs,
      (fun x => ↑s ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.op.unop) }) x)) x =
        IsLocalization.mk' (Localization.AtPrime (↑x).asIdeal) a { val := b, property := hs }
hb₁ : ¬b ∈ (↑{ val := ↑p, property := hpW }).asIdeal
s_eq₁ :
  (fun x => ↑s ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.op.unop) }) x)) { val := ↑p, property := hpW } =
    IsLocalization.mk' (Localization.AtPrime (↑{ val := ↑p, property := hpW }).asIdeal) a { val := b, property := hb₁ }
⊢ ↑(Localization.localRingHom (↑(PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal (↑p).asIdeal (RingHom.id R)
          (_ : (↑(PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal = (↑(PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal))
      (↑s { val := ↑(PrimeSpectrum.comap (RingHom.id R)) ↑p, property := (_ : ↑p ∈ ↑U) }) =
    ↑(↑((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 U.op)
p : { x // x ∈ V.op.unop }
W : Opens ↑(PrimeSpectrum.Top R)
hpW : ↑((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U) }) p) ∈ W
iWU : W ⟶ U.op.unop
h :
  PrelocalPredicate.pred (isFractionPrelocal R) fun x =>
    ↑s ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.op.unop) }) x)
a b : R
h' :
  ∀ (x : { x // x ∈ W }),
    ∃ hs,
      (fun x => ↑s ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.op.unop) }) x)) x =
        IsLocalization.mk' (Localization.AtPrime (↑x).asIdeal) a { val := b, property := hs }
hb₁ : ¬b ∈ (↑{ val := ↑p, property := hpW }).asIdeal
s_eq₁ :
  (fun x => ↑s ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.op.unop) }) x)) { val := ↑p, property := hpW } =
    IsLocalization.mk' (Localization.AtPrime (↑{ val := ↑p, property := hpW }).asIdeal) a { val := b, property := hb₁ }
hb₂ : ¬b ∈ (↑{ val := ↑(PrimeSpectrum.comap (RingHom.id R)) ↑p, property := hpW }).asIdeal
s_eq₂ :
  (fun x => ↑s ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.op.unop) }) x))
      { val := ↑(PrimeSpectrum.comap (RingHom.id R)) ↑p, property := hpW } =
    IsLocalization.mk'
      (Localization.AtPrime (↑{ val := ↑(PrimeSpectrum.comap (RingHom.id R)) ↑p, property := hpW }).asIdeal) a
      { val := b, property := hb₂ }
⊢ ↑(Localization.localRingHom (↑(PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal (↑p).asIdeal (RingHom.id R)
          (_ : (↑(PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal = (↑(PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal))
      (↑s { val := ↑(PrimeSpectrum.comap (RingHom.id R)) ↑p, property := (_ : ↑p ∈ ↑U) }) =
    ↑(↑((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 U.op)
p : { x // x ∈ V.op.unop }
W : Opens ↑(PrimeSpectrum.Top R)
hpW : ↑((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U) }) p) ∈ W
iWU : W ⟶ U.op.unop
h :
  PrelocalPredicate.pred (isFractionPrelocal R) fun x =>
    ↑s ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.op.unop) }) x)
a b : R
h' :
  ∀ (x : { x // x ∈ W }),
    ∃ hs,
      (fun x => ↑s ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.op.unop) }) x)) x =
        IsLocalization.mk' (Localization.AtPrime (↑x).asIdeal) a { val := b, property := hs }
hb₁ : ¬b ∈ (↑{ val := ↑p, property := hpW }).asIdeal
s_eq₁ :
  ↑s { val := ↑p, property := (_ : ↑{ val := ↑p, property := hpW } ∈ ↑U.op.unop) } =
    IsLocalization.mk' (Localization.AtPrime (↑p).asIdeal) a { val := b, property := hb₁ }
hb₂ : ¬b ∈ (↑{ val := ↑(PrimeSpectrum.comap (RingHom.id R)) ↑p, property := hpW }).asIdeal
s_eq₂ :
  ↑s
      { val := ↑(PrimeSpectrum.comap (RingHom.id R)) ↑p,
        property := (_ : ↑{ val := ↑(PrimeSpectrum.comap (RingHom.id R)) ↑p, property := hpW } ∈ ↑U.op.unop) } =
    IsLocalization.mk' (Localization.AtPrime (↑(PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal) a
      { val := b, property := hb₂ }
⊢ ↑(Localization.localRingHom (↑(PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal (↑p).asIdeal (RingHom.id R)
          (_ : (↑(PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal = (↑(PrimeSpectrum.comap (RingHom.id R)) ↑p).asIdeal))
      (↑s { val := ↑(PrimeSpectrum.comap (RingHom.id R)) ↑p, property := (_ : ↑p ∈ ↑U) }) =
    ↑(↑((structureSheaf R).val.map iVU.op) s) p