-- Mathlib/RingTheory/Localization/Defs.lean
theorem sec_fst_ne_zero [Nontrivial R] [NoZeroDivisors S] (hM : M ≤ nonZeroDivisors R) {x : S}
    (hx : x ≠ 0) : (sec M x).fst ≠ 0

Proof state:
R : Type u_1
inst✝⁵ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommRing S
inst✝³ : Algebra R S
inst✝² : IsLocalization M S
inst✝¹ : Nontrivial R
inst✝ : NoZeroDivisors S
hM : M ≤ nonZeroDivisors R
x : S
hx : x ≠ 0
hsec : x * (algebraMap R S) ↑(sec M x).2 = (algebraMap R S) (sec M x).1
⊢ (sec M x).1 ≠ 0

Tactic:
intro hfst

Result:
R : Type u_1
inst✝⁵ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommRing S
inst✝³ : Algebra R S
inst✝² : IsLocalization M S
inst✝¹ : Nontrivial R
inst✝ : NoZeroDivisors S
hM : M ≤ nonZeroDivisors R
x : S
hx : x ≠ 0
hsec : x * (algebraMap R S) ↑(sec M x).2 = (algebraMap R S) (sec M x).1
hfst : (sec M x).1 = 0
⊢ False

Proof state:
R : Type u_1
inst✝⁵ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommRing S
inst✝³ : Algebra R S
inst✝² : IsLocalization M S
inst✝¹ : Nontrivial R
inst✝ : NoZeroDivisors S
hM : M ≤ nonZeroDivisors R
x : S
hx : x ≠ 0
hsec : x = 0 ∨ ↑(sec M x).2 = 0
hfst : (sec M x).1 = 0
⊢ False

Tactic:
exact Or.elim hsec hx (sec_snd_ne_zero hM x)

Result:
no goals

Proof state:
R : Type u_1
inst✝⁵ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommRing S
inst✝³ : Algebra R S
inst✝² : IsLocalization M S
inst✝¹ : Nontrivial R
inst✝ : NoZeroDivisors S
hM : M ≤ nonZeroDivisors R
x : S
hx : x ≠ 0
hsec : x * (algebraMap R S) ↑(sec M x).2 = (algebraMap R S) (sec M x).1
hfst : (sec M x).1 = 0
⊢ False

Tactic:
rw [hfst, map_zero, mul_eq_zero, _root_.map_eq_zero_iff] at hsec

Result:
R : Type u_1
inst✝⁵ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommRing S
inst✝³ : Algebra R S
inst✝² : IsLocalization M S
inst✝¹ : Nontrivial R
inst✝ : NoZeroDivisors S
hM : M ≤ nonZeroDivisors R
x : S
hx : x ≠ 0
hsec : x = 0 ∨ ↑(sec M x).2 = 0
hfst : (sec M x).1 = 0
⊢ False

case hf
R : Type u_1
inst✝⁵ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommRing S
inst✝³ : Algebra R S
inst✝² : IsLocalization M S
inst✝¹ : Nontrivial R
inst✝ : NoZeroDivisors S
hM : M ≤ nonZeroDivisors R
x : S
hx : x ≠ 0
hsec : x = 0 ∨ (algebraMap R S) ↑(sec M x).2 = 0
hfst : (sec M x).1 = 0
⊢ Injective ⇑(algebraMap R S)

Proof state:
R : Type u_1
inst✝⁵ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommRing S
inst✝³ : Algebra R S
inst✝² : IsLocalization M S
inst✝¹ : Nontrivial R
inst✝ : NoZeroDivisors S
hM : M ≤ nonZeroDivisors R
x : S
hx : x ≠ 0
⊢ (sec M x).1 ≠ 0

Tactic:
have hsec := sec_spec M x

Result:
R : Type u_1
inst✝⁵ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommRing S
inst✝³ : Algebra R S
inst✝² : IsLocalization M S
inst✝¹ : Nontrivial R
inst✝ : NoZeroDivisors S
hM : M ≤ nonZeroDivisors R
x : S
hx : x ≠ 0
hsec : x * (algebraMap R S) ↑(sec M x).2 = (algebraMap R S) (sec M x).1
⊢ (sec M x).1 ≠ 0

Proof state:
case hf
R : Type u_1
inst✝⁵ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommRing S
inst✝³ : Algebra R S
inst✝² : IsLocalization M S
inst✝¹ : Nontrivial R
inst✝ : NoZeroDivisors S
hM : M ≤ nonZeroDivisors R
x : S
hx : x ≠ 0
hsec : x = 0 ∨ (algebraMap R S) ↑(sec M x).2 = 0
hfst : (sec M x).1 = 0
⊢ Injective ⇑(algebraMap R S)

Tactic:
exact IsLocalization.injective S hM

Result:
no goals