Theorem: AlgebraicGeometry.isIntegral_of_irreducibleSpace_of_isReduced
File: Mathlib/AlgebraicGeometry/Properties.lean

tactic: constructor
state_before: X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
⊢ IsIntegral X
state_after: case nonempty
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
⊢ autoParam (Nonempty ↑↑X.toPresheafedSpace) _auto✝

case component_integral
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
⊢ autoParam (∀ (U : Opens ↑↑X.toPresheafedSpace) [inst : Nonempty ↥U], IsDomain ↑Γ(X, U)) _auto✝

tactic: intro U hU
state_before: case component_integral
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
⊢ autoParam (∀ (U : Opens ↑↑X.toPresheafedSpace) [inst : Nonempty ↥U], IsDomain ↑Γ(X, U)) _auto✝
state_after: case component_integral
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
⊢ IsDomain ↑Γ(X, U)

tactic: haveI := (@LocallyRingedSpace.component_nontrivial X.toLocallyRingedSpace U hU).1
state_before: case component_integral
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
⊢ IsDomain ↑Γ(X, U)
state_after: case component_integral
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
⊢ IsDomain ↑Γ(X, U)

tactic: have : NoZeroDivisors
    (X.toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.obj (op U)) := by
  refine ⟨fun {a b} e => ?_⟩
  simp_rw [← basicOpen_eq_bot_iff, ← Opens.not_nonempty_iff_eq_bot]
  by_contra! h
  obtain ⟨_, ⟨x, hx₁, rfl⟩, ⟨x, hx₂, e'⟩⟩ :=
    nonempty_preirreducible_inter (X.basicOpen a).2 (X.basicOpen b).2 h.1 h.2
  replace e' := Subtype.eq e'
  subst e'
  replace e := congr_arg (X.presheaf.germ x) e
  rw [RingHom.map_mul, RingHom.map_zero] at e
  refine zero_ne_one' (X.presheaf.stalk x.1) (isUnit_zero_iff.1 ?_)
  convert hx₁.mul hx₂
  exact e.symm
state_before: case component_integral
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
⊢ IsDomain ↑Γ(X, U)
state_after: case component_integral
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this✝ : ∃ x y, x ≠ y
this : NoZeroDivisors ↑Γ(X, U)
⊢ IsDomain ↑Γ(X, U)

tactic: exact NoZeroDivisors.to_isDomain _
state_before: case component_integral
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this✝ : ∃ x y, x ≠ y
this : NoZeroDivisors ↑Γ(X, U)
⊢ IsDomain ↑Γ(X, U)
state_after: no goals

tactic: infer_instance
state_before: case nonempty
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
⊢ autoParam (Nonempty ↑↑X.toPresheafedSpace) _auto✝
state_after: no goals

tactic: refine ⟨fun {a b} e => ?_⟩
state_before: X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
⊢ NoZeroDivisors ↑Γ(X, U)
state_after: X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
a b : ↑Γ(X, U)
e : a * b = 0
⊢ a = 0 ∨ b = 0

tactic: simp_rw [← basicOpen_eq_bot_iff, ← Opens.not_nonempty_iff_eq_bot]
state_before: X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
a b : ↑Γ(X, U)
e : a * b = 0
⊢ a = 0 ∨ b = 0
state_after: X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
a b : ↑Γ(X, U)
e : a * b = 0
⊢ ¬(↑(X.basicOpen a)).Nonempty ∨ ¬(↑(X.basicOpen b)).Nonempty

tactic: by_contra! h
state_before: X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
a b : ↑Γ(X, U)
e : a * b = 0
⊢ ¬(↑(X.basicOpen a)).Nonempty ∨ ¬(↑(X.basicOpen b)).Nonempty
state_after: X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
a b : ↑Γ(X, U)
e : a * b = 0
h : (↑(X.basicOpen a)).Nonempty ∧ (↑(X.basicOpen b)).Nonempty
⊢ False

tactic: obtain ⟨_, ⟨x, hx₁, rfl⟩, ⟨x, hx₂, e'⟩⟩ :=
  nonempty_preirreducible_inter (X.basicOpen a).2 (X.basicOpen b).2 h.1 h.2
state_before: X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
a b : ↑Γ(X, U)
e : a * b = 0
h : (↑(X.basicOpen a)).Nonempty ∧ (↑(X.basicOpen b)).Nonempty
⊢ False
state_after: case intro.intro.intro.intro.intro.intro
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
a b : ↑Γ(X, U)
e : a * b = 0
h : (↑(X.basicOpen a)).Nonempty ∧ (↑(X.basicOpen b)).Nonempty
x✝ : ↥U
hx₁ : x✝ ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) a)}
x : ↥U
hx₂ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) b)}
e' : ↑x = ↑x✝
⊢ False

tactic: replace e' := Subtype.eq e'
state_before: case intro.intro.intro.intro.intro.intro
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
a b : ↑Γ(X, U)
e : a * b = 0
h : (↑(X.basicOpen a)).Nonempty ∧ (↑(X.basicOpen b)).Nonempty
x✝ : ↥U
hx₁ : x✝ ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) a)}
x : ↥U
hx₂ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) b)}
e' : ↑x = ↑x✝
⊢ False
state_after: case intro.intro.intro.intro.intro.intro
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
a b : ↑Γ(X, U)
e : a * b = 0
h : (↑(X.basicOpen a)).Nonempty ∧ (↑(X.basicOpen b)).Nonempty
x✝ : ↥U
hx₁ : x✝ ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) a)}
x : ↥U
hx₂ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) b)}
e' : x = x✝
⊢ False

tactic: subst e'
state_before: case intro.intro.intro.intro.intro.intro
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
a b : ↑Γ(X, U)
e : a * b = 0
h : (↑(X.basicOpen a)).Nonempty ∧ (↑(X.basicOpen b)).Nonempty
x✝ : ↥U
hx₁ : x✝ ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) a)}
x : ↥U
hx₂ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) b)}
e' : x = x✝
⊢ False
state_after: case intro.intro.intro.intro.intro.intro
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
a b : ↑Γ(X, U)
e : a * b = 0
h : (↑(X.basicOpen a)).Nonempty ∧ (↑(X.basicOpen b)).Nonempty
x : ↥U
hx₂ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) b)}
hx₁ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) a)}
⊢ False

tactic: replace e := congr_arg (X.presheaf.germ x) e
state_before: case intro.intro.intro.intro.intro.intro
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
a b : ↑Γ(X, U)
e : a * b = 0
h : (↑(X.basicOpen a)).Nonempty ∧ (↑(X.basicOpen b)).Nonempty
x : ↥U
hx₂ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) b)}
hx₁ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) a)}
⊢ False
state_after: case intro.intro.intro.intro.intro.intro
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
a b : ↑Γ(X, U)
h : (↑(X.basicOpen a)).Nonempty ∧ (↑(X.basicOpen b)).Nonempty
x : ↥U
hx₂ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) b)}
hx₁ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) a)}
e : (X.presheaf.germ x) (a * b) = (X.presheaf.germ x) 0
⊢ False

tactic: rw [RingHom.map_mul, RingHom.map_zero] at e
state_before: case intro.intro.intro.intro.intro.intro
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
a b : ↑Γ(X, U)
h : (↑(X.basicOpen a)).Nonempty ∧ (↑(X.basicOpen b)).Nonempty
x : ↥U
hx₂ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) b)}
hx₁ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) a)}
e : (X.presheaf.germ x) (a * b) = (X.presheaf.germ x) 0
⊢ False
state_after: case intro.intro.intro.intro.intro.intro
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
a b : ↑Γ(X, U)
h : (↑(X.basicOpen a)).Nonempty ∧ (↑(X.basicOpen b)).Nonempty
x : ↥U
hx₂ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) b)}
hx₁ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) a)}
e : (X.presheaf.germ x) a * (X.presheaf.germ x) b = 0
⊢ False

tactic: refine zero_ne_one' (X.presheaf.stalk x.1) (isUnit_zero_iff.1 ?_)
state_before: case intro.intro.intro.intro.intro.intro
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
a b : ↑Γ(X, U)
h : (↑(X.basicOpen a)).Nonempty ∧ (↑(X.basicOpen b)).Nonempty
x : ↥U
hx₂ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) b)}
hx₁ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) a)}
e : (X.presheaf.germ x) a * (X.presheaf.germ x) b = 0
⊢ False
state_after: case intro.intro.intro.intro.intro.intro
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
a b : ↑Γ(X, U)
h : (↑(X.basicOpen a)).Nonempty ∧ (↑(X.basicOpen b)).Nonempty
x : ↥U
hx₂ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) b)}
hx₁ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) a)}
e : (X.presheaf.germ x) a * (X.presheaf.germ x) b = 0
⊢ IsUnit 0

tactic: convert hx₁.mul hx₂
state_before: case intro.intro.intro.intro.intro.intro
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
a b : ↑Γ(X, U)
h : (↑(X.basicOpen a)).Nonempty ∧ (↑(X.basicOpen b)).Nonempty
x : ↥U
hx₂ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) b)}
hx₁ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) a)}
e : (X.presheaf.germ x) a * (X.presheaf.germ x) b = 0
⊢ IsUnit 0
state_after: case h.e'_3.h
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
a b : ↑Γ(X, U)
h : (↑(X.basicOpen a)).Nonempty ∧ (↑(X.basicOpen b)).Nonempty
x : ↥U
hx₂ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) b)}
hx₁ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) a)}
e : (X.presheaf.germ x) a * (X.presheaf.germ x) b = 0
e_1✝ : ↑(X.presheaf.stalk ↑x) = ↑(X.toRingedSpace.presheaf.stalk ↑x)
⊢ 0 = (X.toRingedSpace.presheaf.germ x) a * (X.toRingedSpace.presheaf.germ x) b

tactic: exact e.symm
state_before: case h.e'_3.h
X : Scheme
inst✝ : IsReduced X
H : IrreducibleSpace ↑↑X.toPresheafedSpace
U : Opens ↑↑X.toPresheafedSpace
hU : Nonempty ↥U
this : ∃ x y, x ≠ y
a b : ↑Γ(X, U)
h : (↑(X.basicOpen a)).Nonempty ∧ (↑(X.basicOpen b)).Nonempty
x : ↥U
hx₂ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) b)}
hx₁ : x ∈ {x | IsUnit ((X.toRingedSpace.presheaf.germ x) a)}
e : (X.presheaf.germ x) a * (X.presheaf.germ x) b = 0
e_1✝ : ↑(X.presheaf.stalk ↑x) = ↑(X.toRingedSpace.presheaf.stalk ↑x)
⊢ 0 = (X.toRingedSpace.presheaf.germ x) a * (X.toRingedSpace.presheaf.germ x) b
state_after: no goals