l3lab/ntp-mathlib huggingface dataset:
theorem spanSingleton_mul_inv {x : K} (hx : x ≠ 0) :
    spanSingleton R₁⁰ x * (spanSingleton R₁⁰ x)⁻¹ = 1 := by
  

Proof state:
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : Field K
inst✝⁷ : IsDomain A
R₁ : Type u_4
inst✝⁶ : CommRing R₁
inst✝⁵ : IsDomain R₁
inst✝⁴ : Algebra R₁ K
inst✝³ : IsFractionRing R₁ K
I J : FractionalIdeal R₁⁰ K
K' : Type u_5
inst✝² : Field K'
inst✝¹ : Algebra R₁ K'
inst✝ : IsFractionRing R₁ K'
x : K
hx : x ≠ 0
⊢ spanSingleton R₁⁰ x * (spanSingleton R₁⁰ x)⁻¹ = 1

Next tactic:
rw [spanSingleton_inv, spanSingleton_mul_spanSingleton, mul_inv_cancel hx, spanSingleton_one]
theorem coe_ideal_span_singleton_mul_inv {x : R₁} (hx : x ≠ 0) :
    (Ideal.span ({x} : Set R₁) : FractionalIdeal R₁⁰ K) *
    (Ideal.span ({x} : Set R₁) : FractionalIdeal R₁⁰ K)⁻¹ = 1 := by
  

Proof state:
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : Field K
inst✝⁷ : IsDomain A
R₁ : Type u_4
inst✝⁶ : CommRing R₁
inst✝⁵ : IsDomain R₁
inst✝⁴ : Algebra R₁ K
inst✝³ : IsFractionRing R₁ K
I J : FractionalIdeal R₁⁰ K
K' : Type u_5
inst✝² : Field K'
inst✝¹ : Algebra R₁ K'
inst✝ : IsFractionRing R₁ K'
x : R₁
hx : x ≠ 0
⊢ ↑(Ideal.span {x}) * (↑(Ideal.span {x}))⁻¹ = 1

Next tactic:
rw [coeIdeal_span_singleton,
    spanSingleton_mul_inv K <|
      (map_ne_zero_iff _ <| NoZeroSMulDivisors.algebraMap_injective R₁ K).mpr hx]
theorem spanSingleton_inv_mul {x : K} (hx : x ≠ 0) :
    (spanSingleton R₁⁰ x)⁻¹ * spanSingleton R₁⁰ x = 1 := by
  

Proof state:
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : Field K
inst✝⁷ : IsDomain A
R₁ : Type u_4
inst✝⁶ : CommRing R₁
inst✝⁵ : IsDomain R₁
inst✝⁴ : Algebra R₁ K
inst✝³ : IsFractionRing R₁ K
I J : FractionalIdeal R₁⁰ K
K' : Type u_5
inst✝² : Field K'
inst✝¹ : Algebra R₁ K'
inst✝ : IsFractionRing R₁ K'
x : K
hx : x ≠ 0
⊢ (spanSingleton R₁⁰ x)⁻¹ * spanSingleton R₁⁰ x = 1

Next tactic:
rw [mul_comm, spanSingleton_mul_inv K hx]
theorem coe_ideal_span_singleton_inv_mul {x : R₁} (hx : x ≠ 0) :
    (Ideal.span ({x} : Set R₁) : FractionalIdeal R₁⁰ K)⁻¹ * Ideal.span ({x} : Set R₁) = 1 := by
  

Proof state:
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : Field K
inst✝⁷ : IsDomain A
R₁ : Type u_4
inst✝⁶ : CommRing R₁
inst✝⁵ : IsDomain R₁
inst✝⁴ : Algebra R₁ K
inst✝³ : IsFractionRing R₁ K
I J : FractionalIdeal R₁⁰ K
K' : Type u_5
inst✝² : Field K'
inst✝¹ : Algebra R₁ K'
inst✝ : IsFractionRing R₁ K'
x : R₁
hx : x ≠ 0
⊢ (↑(Ideal.span {x}))⁻¹ * ↑(Ideal.span {x}) = 1

Next tactic:
rw [mul_comm, coe_ideal_span_singleton_mul_inv K hx]
theorem mul_generator_self_inv {R₁ : Type*} [CommRing R₁] [Algebra R₁ K] [IsLocalization R₁⁰ K]
    (I : FractionalIdeal R₁⁰ K) [Submodule.IsPrincipal (I : Submodule R₁ K)] (h : I ≠ 0) :
    I * spanSingleton _ (generator (I : Submodule R₁ K))⁻¹ = 1 := by
  -- Rewrite only the `I` that appears alone.
  

Proof state:
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁴ : CommRing R
inst✝¹³ : CommRing A
inst✝¹² : Field K
inst✝¹¹ : IsDomain A
R₁✝ : Type u_4
inst✝¹⁰ : CommRing R₁✝
inst✝⁹ : IsDomain R₁✝
inst✝⁸ : Algebra R₁✝ K
inst✝⁷ : IsFractionRing R₁✝ K
I✝ J : FractionalIdeal R₁✝⁰ K
K' : Type u_5
inst✝⁶ : Field K'
inst✝⁵ : Algebra R₁✝ K'
inst✝⁴ : IsFractionRing R₁✝ K'
R₁ : Type u_6
inst✝³ : CommRing R₁
inst✝² : Algebra R₁ K
inst✝¹ : IsLocalization R₁⁰ K
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
h : I ≠ 0
⊢ I * spanSingleton R₁⁰ (generator ↑I)⁻¹ = 1

Next tactic:
conv_lhs => congr; rw [eq_spanSingleton_of_principal I]
theorem mul_generator_self_inv {R₁ : Type*} [CommRing R₁] [Algebra R₁ K] [IsLocalization R₁⁰ K]
    (I : FractionalIdeal R₁⁰ K) [Submodule.IsPrincipal (I : Submodule R₁ K)] (h : I ≠ 0) :
    I * spanSingleton _ (generator (I : Submodule R₁ K))⁻¹ = 1 := by
  -- Rewrite only the `I` that appears alone.
  conv_lhs => 

Proof state:
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁴ : CommRing R
inst✝¹³ : CommRing A
inst✝¹² : Field K
inst✝¹¹ : IsDomain A
R₁✝ : Type u_4
inst✝¹⁰ : CommRing R₁✝
inst✝⁹ : IsDomain R₁✝
inst✝⁸ : Algebra R₁✝ K
inst✝⁷ : IsFractionRing R₁✝ K
I✝ J : FractionalIdeal R₁✝⁰ K
K' : Type u_5
inst✝⁶ : Field K'
inst✝⁵ : Algebra R₁✝ K'
inst✝⁴ : IsFractionRing R₁✝ K'
R₁ : Type u_6
inst✝³ : CommRing R₁
inst✝² : Algebra R₁ K
inst✝¹ : IsLocalization R₁⁰ K
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
h : I ≠ 0
| I * spanSingleton R₁⁰ (generator ↑I)⁻¹

Next tactic:
congr; rw [eq_spanSingleton_of_principal I]
theorem mul_generator_self_inv {R₁ : Type*} [CommRing R₁] [Algebra R₁ K] [IsLocalization R₁⁰ K]
    (I : FractionalIdeal R₁⁰ K) [Submodule.IsPrincipal (I : Submodule R₁ K)] (h : I ≠ 0) :
    I * spanSingleton _ (generator (I : Submodule R₁ K))⁻¹ = 1 := by
  -- Rewrite only the `I` that appears alone.
  conv_lhs => 

Proof state:
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁴ : CommRing R
inst✝¹³ : CommRing A
inst✝¹² : Field K
inst✝¹¹ : IsDomain A
R₁✝ : Type u_4
inst✝¹⁰ : CommRing R₁✝
inst✝⁹ : IsDomain R₁✝
inst✝⁸ : Algebra R₁✝ K
inst✝⁷ : IsFractionRing R₁✝ K
I✝ J : FractionalIdeal R₁✝⁰ K
K' : Type u_5
inst✝⁶ : Field K'
inst✝⁵ : Algebra R₁✝ K'
inst✝⁴ : IsFractionRing R₁✝ K'
R₁ : Type u_6
inst✝³ : CommRing R₁
inst✝² : Algebra R₁ K
inst✝¹ : IsLocalization R₁⁰ K
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
h : I ≠ 0
| I * spanSingleton R₁⁰ (generator ↑I)⁻¹

Next tactic:
congr
theorem mul_generator_self_inv {R₁ : Type*} [CommRing R₁] [Algebra R₁ K] [IsLocalization R₁⁰ K]
    (I : FractionalIdeal R₁⁰ K) [Submodule.IsPrincipal (I : Submodule R₁ K)] (h : I ≠ 0) :
    I * spanSingleton _ (generator (I : Submodule R₁ K))⁻¹ = 1 := by
  -- Rewrite only the `I` that appears alone.
  conv_lhs => congr; 

Proof state:
case a
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁴ : CommRing R
inst✝¹³ : CommRing A
inst✝¹² : Field K
inst✝¹¹ : IsDomain A
R₁✝ : Type u_4
inst✝¹⁰ : CommRing R₁✝
inst✝⁹ : IsDomain R₁✝
inst✝⁸ : Algebra R₁✝ K
inst✝⁷ : IsFractionRing R₁✝ K
I✝ J : FractionalIdeal R₁✝⁰ K
K' : Type u_5
inst✝⁶ : Field K'
inst✝⁵ : Algebra R₁✝ K'
inst✝⁴ : IsFractionRing R₁✝ K'
R₁ : Type u_6
inst✝³ : CommRing R₁
inst✝² : Algebra R₁ K
inst✝¹ : IsLocalization R₁⁰ K
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
h : I ≠ 0
| I
case a
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁴ : CommRing R
inst✝¹³ : CommRing A
inst✝¹² : Field K
inst✝¹¹ : IsDomain A
R₁✝ : Type u_4
inst✝¹⁰ : CommRing R₁✝
inst✝⁹ : IsDomain R₁✝
inst✝⁸ : Algebra R₁✝ K
inst✝⁷ : IsFractionRing R₁✝ K
I✝ J : FractionalIdeal R₁✝⁰ K
K' : Type u_5
inst✝⁶ : Field K'
inst✝⁵ : Algebra R₁✝ K'
inst✝⁴ : IsFractionRing R₁✝ K'
R₁ : Type u_6
inst✝³ : CommRing R₁
inst✝² : Algebra R₁ K
inst✝¹ : IsLocalization R₁⁰ K
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
h : I ≠ 0
| spanSingleton R₁⁰ (generator ↑I)⁻¹

Next tactic:
rw [eq_spanSingleton_of_principal I]
theorem mul_generator_self_inv {R₁ : Type*} [CommRing R₁] [Algebra R₁ K] [IsLocalization R₁⁰ K]
    (I : FractionalIdeal R₁⁰ K) [Submodule.IsPrincipal (I : Submodule R₁ K)] (h : I ≠ 0) :
    I * spanSingleton _ (generator (I : Submodule R₁ K))⁻¹ = 1 := by
  -- Rewrite only the `I` that appears alone.
  conv_lhs => congr; rw [eq_spanSingleton_of_principal I]
  

Proof state:
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁴ : CommRing R
inst✝¹³ : CommRing A
inst✝¹² : Field K
inst✝¹¹ : IsDomain A
R₁✝ : Type u_4
inst✝¹⁰ : CommRing R₁✝
inst✝⁹ : IsDomain R₁✝
inst✝⁸ : Algebra R₁✝ K
inst✝⁷ : IsFractionRing R₁✝ K
I✝ J : FractionalIdeal R₁✝⁰ K
K' : Type u_5
inst✝⁶ : Field K'
inst✝⁵ : Algebra R₁✝ K'
inst✝⁴ : IsFractionRing R₁✝ K'
R₁ : Type u_6
inst✝³ : CommRing R₁
inst✝² : Algebra R₁ K
inst✝¹ : IsLocalization R₁⁰ K
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
h : I ≠ 0
⊢ spanSingleton R₁⁰ (generator ↑I) * spanSingleton R₁⁰ (generator ↑I)⁻¹ = 1

Next tactic:
rw [spanSingleton_mul_spanSingleton, mul_inv_cancel, spanSingleton_one]
theorem mul_generator_self_inv {R₁ : Type*} [CommRing R₁] [Algebra R₁ K] [IsLocalization R₁⁰ K]
    (I : FractionalIdeal R₁⁰ K) [Submodule.IsPrincipal (I : Submodule R₁ K)] (h : I ≠ 0) :
    I * spanSingleton _ (generator (I : Submodule R₁ K))⁻¹ = 1 := by
  -- Rewrite only the `I` that appears alone.
  conv_lhs => congr; rw [eq_spanSingleton_of_principal I]
  rw [spanSingleton_mul_spanSingleton, mul_inv_cancel, spanSingleton_one]
  

Proof state:
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁴ : CommRing R
inst✝¹³ : CommRing A
inst✝¹² : Field K
inst✝¹¹ : IsDomain A
R₁✝ : Type u_4
inst✝¹⁰ : CommRing R₁✝
inst✝⁹ : IsDomain R₁✝
inst✝⁸ : Algebra R₁✝ K
inst✝⁷ : IsFractionRing R₁✝ K
I✝ J : FractionalIdeal R₁✝⁰ K
K' : Type u_5
inst✝⁶ : Field K'
inst✝⁵ : Algebra R₁✝ K'
inst✝⁴ : IsFractionRing R₁✝ K'
R₁ : Type u_6
inst✝³ : CommRing R₁
inst✝² : Algebra R₁ K
inst✝¹ : IsLocalization R₁⁰ K
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
h : I ≠ 0
⊢ generator ↑I ≠ 0

Next tactic:
intro generator_I_eq_zero
theorem mul_generator_self_inv {R₁ : Type*} [CommRing R₁] [Algebra R₁ K] [IsLocalization R₁⁰ K]
    (I : FractionalIdeal R₁⁰ K) [Submodule.IsPrincipal (I : Submodule R₁ K)] (h : I ≠ 0) :
    I * spanSingleton _ (generator (I : Submodule R₁ K))⁻¹ = 1 := by
  -- Rewrite only the `I` that appears alone.
  conv_lhs => congr; rw [eq_spanSingleton_of_principal I]
  rw [spanSingleton_mul_spanSingleton, mul_inv_cancel, spanSingleton_one]
  intro generator_I_eq_zero
  

Proof state:
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁴ : CommRing R
inst✝¹³ : CommRing A
inst✝¹² : Field K
inst✝¹¹ : IsDomain A
R₁✝ : Type u_4
inst✝¹⁰ : CommRing R₁✝
inst✝⁹ : IsDomain R₁✝
inst✝⁸ : Algebra R₁✝ K
inst✝⁷ : IsFractionRing R₁✝ K
I✝ J : FractionalIdeal R₁✝⁰ K
K' : Type u_5
inst✝⁶ : Field K'
inst✝⁵ : Algebra R₁✝ K'
inst✝⁴ : IsFractionRing R₁✝ K'
R₁ : Type u_6
inst✝³ : CommRing R₁
inst✝² : Algebra R₁ K
inst✝¹ : IsLocalization R₁⁰ K
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
h : I ≠ 0
generator_I_eq_zero : generator ↑I = 0
⊢ False

Next tactic:
apply h
theorem mul_generator_self_inv {R₁ : Type*} [CommRing R₁] [Algebra R₁ K] [IsLocalization R₁⁰ K]
    (I : FractionalIdeal R₁⁰ K) [Submodule.IsPrincipal (I : Submodule R₁ K)] (h : I ≠ 0) :
    I * spanSingleton _ (generator (I : Submodule R₁ K))⁻¹ = 1 := by
  -- Rewrite only the `I` that appears alone.
  conv_lhs => congr; rw [eq_spanSingleton_of_principal I]
  rw [spanSingleton_mul_spanSingleton, mul_inv_cancel, spanSingleton_one]
  intro generator_I_eq_zero
  apply h
  

Proof state:
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁴ : CommRing R
inst✝¹³ : CommRing A
inst✝¹² : Field K
inst✝¹¹ : IsDomain A
R₁✝ : Type u_4
inst✝¹⁰ : CommRing R₁✝
inst✝⁹ : IsDomain R₁✝
inst✝⁸ : Algebra R₁✝ K
inst✝⁷ : IsFractionRing R₁✝ K
I✝ J : FractionalIdeal R₁✝⁰ K
K' : Type u_5
inst✝⁶ : Field K'
inst✝⁵ : Algebra R₁✝ K'
inst✝⁴ : IsFractionRing R₁✝ K'
R₁ : Type u_6
inst✝³ : CommRing R₁
inst✝² : Algebra R₁ K
inst✝¹ : IsLocalization R₁⁰ K
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
h : I ≠ 0
generator_I_eq_zero : generator ↑I = 0
⊢ I = 0

Next tactic:
rw [eq_spanSingleton_of_principal I, generator_I_eq_zero, spanSingleton_zero]
theorem invertible_iff_generator_nonzero (I : FractionalIdeal R₁⁰ K)
    [Submodule.IsPrincipal (I : Submodule R₁ K)] :
    I * I⁻¹ = 1 ↔ generator (I : Submodule R₁ K) ≠ 0 := by
  

Proof state:
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : CommRing A
inst✝⁹ : Field K
inst✝⁸ : IsDomain A
R₁ : Type u_4
inst✝⁷ : CommRing R₁
inst✝⁶ : IsDomain R₁
inst✝⁵ : Algebra R₁ K
inst✝⁴ : IsFractionRing R₁ K
I✝ J : FractionalIdeal R₁⁰ K
K' : Type u_5
inst✝³ : Field K'
inst✝² : Algebra R₁ K'
inst✝¹ : IsFractionRing R₁ K'
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
⊢ I * I⁻¹ = 1 ↔ generator ↑I ≠ 0

Next tactic:
constructor
theorem invertible_iff_generator_nonzero (I : FractionalIdeal R₁⁰ K)
    [Submodule.IsPrincipal (I : Submodule R₁ K)] :
    I * I⁻¹ = 1 ↔ generator (I : Submodule R₁ K) ≠ 0 := by
  constructor
  · 

Proof state:
case mp
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : CommRing A
inst✝⁹ : Field K
inst✝⁸ : IsDomain A
R₁ : Type u_4
inst✝⁷ : CommRing R₁
inst✝⁶ : IsDomain R₁
inst✝⁵ : Algebra R₁ K
inst✝⁴ : IsFractionRing R₁ K
I✝ J : FractionalIdeal R₁⁰ K
K' : Type u_5
inst✝³ : Field K'
inst✝² : Algebra R₁ K'
inst✝¹ : IsFractionRing R₁ K'
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
⊢ I * I⁻¹ = 1 → generator ↑I ≠ 0

Next tactic:
intro hI hg
theorem invertible_iff_generator_nonzero (I : FractionalIdeal R₁⁰ K)
    [Submodule.IsPrincipal (I : Submodule R₁ K)] :
    I * I⁻¹ = 1 ↔ generator (I : Submodule R₁ K) ≠ 0 := by
  constructor
  · intro hI hg
    

Proof state:
case mp
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : CommRing A
inst✝⁹ : Field K
inst✝⁸ : IsDomain A
R₁ : Type u_4
inst✝⁷ : CommRing R₁
inst✝⁶ : IsDomain R₁
inst✝⁵ : Algebra R₁ K
inst✝⁴ : IsFractionRing R₁ K
I✝ J : FractionalIdeal R₁⁰ K
K' : Type u_5
inst✝³ : Field K'
inst✝² : Algebra R₁ K'
inst✝¹ : IsFractionRing R₁ K'
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
hI : I * I⁻¹ = 1
hg : generator ↑I = 0
⊢ False

Next tactic:
apply ne_zero_of_mul_eq_one _ _ hI
theorem invertible_iff_generator_nonzero (I : FractionalIdeal R₁⁰ K)
    [Submodule.IsPrincipal (I : Submodule R₁ K)] :
    I * I⁻¹ = 1 ↔ generator (I : Submodule R₁ K) ≠ 0 := by
  constructor
  · intro hI hg
    apply ne_zero_of_mul_eq_one _ _ hI
    

Proof state:
case mp
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : CommRing A
inst✝⁹ : Field K
inst✝⁸ : IsDomain A
R₁ : Type u_4
inst✝⁷ : CommRing R₁
inst✝⁶ : IsDomain R₁
inst✝⁵ : Algebra R₁ K
inst✝⁴ : IsFractionRing R₁ K
I✝ J : FractionalIdeal R₁⁰ K
K' : Type u_5
inst✝³ : Field K'
inst✝² : Algebra R₁ K'
inst✝¹ : IsFractionRing R₁ K'
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
hI : I * I⁻¹ = 1
hg : generator ↑I = 0
⊢ I = 0

Next tactic:
rw [eq_spanSingleton_of_principal I, hg, spanSingleton_zero]
theorem invertible_iff_generator_nonzero (I : FractionalIdeal R₁⁰ K)
    [Submodule.IsPrincipal (I : Submodule R₁ K)] :
    I * I⁻¹ = 1 ↔ generator (I : Submodule R₁ K) ≠ 0 := by
  constructor
  · intro hI hg
    apply ne_zero_of_mul_eq_one _ _ hI
    rw [eq_spanSingleton_of_principal I, hg, spanSingleton_zero]
  · 

Proof state:
case mpr
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : CommRing A
inst✝⁹ : Field K
inst✝⁸ : IsDomain A
R₁ : Type u_4
inst✝⁷ : CommRing R₁
inst✝⁶ : IsDomain R₁
inst✝⁵ : Algebra R₁ K
inst✝⁴ : IsFractionRing R₁ K
I✝ J : FractionalIdeal R₁⁰ K
K' : Type u_5
inst✝³ : Field K'
inst✝² : Algebra R₁ K'
inst✝¹ : IsFractionRing R₁ K'
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
⊢ generator ↑I ≠ 0 → I * I⁻¹ = 1

Next tactic:
intro hg
theorem invertible_iff_generator_nonzero (I : FractionalIdeal R₁⁰ K)
    [Submodule.IsPrincipal (I : Submodule R₁ K)] :
    I * I⁻¹ = 1 ↔ generator (I : Submodule R₁ K) ≠ 0 := by
  constructor
  · intro hI hg
    apply ne_zero_of_mul_eq_one _ _ hI
    rw [eq_spanSingleton_of_principal I, hg, spanSingleton_zero]
  · intro hg
    

Proof state:
case mpr
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : CommRing A
inst✝⁹ : Field K
inst✝⁸ : IsDomain A
R₁ : Type u_4
inst✝⁷ : CommRing R₁
inst✝⁶ : IsDomain R₁
inst✝⁵ : Algebra R₁ K
inst✝⁴ : IsFractionRing R₁ K
I✝ J : FractionalIdeal R₁⁰ K
K' : Type u_5
inst✝³ : Field K'
inst✝² : Algebra R₁ K'
inst✝¹ : IsFractionRing R₁ K'
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
hg : generator ↑I ≠ 0
⊢ I * I⁻¹ = 1

Next tactic:
apply invertible_of_principal
theorem invertible_iff_generator_nonzero (I : FractionalIdeal R₁⁰ K)
    [Submodule.IsPrincipal (I : Submodule R₁ K)] :
    I * I⁻¹ = 1 ↔ generator (I : Submodule R₁ K) ≠ 0 := by
  constructor
  · intro hI hg
    apply ne_zero_of_mul_eq_one _ _ hI
    rw [eq_spanSingleton_of_principal I, hg, spanSingleton_zero]
  · intro hg
    apply invertible_of_principal
    

Proof state:
case mpr.h
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : CommRing A
inst✝⁹ : Field K
inst✝⁸ : IsDomain A
R₁ : Type u_4
inst✝⁷ : CommRing R₁
inst✝⁶ : IsDomain R₁
inst✝⁵ : Algebra R₁ K
inst✝⁴ : IsFractionRing R₁ K
I✝ J : FractionalIdeal R₁⁰ K
K' : Type u_5
inst✝³ : Field K'
inst✝² : Algebra R₁ K'
inst✝¹ : IsFractionRing R₁ K'
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
hg : generator ↑I ≠ 0
⊢ I ≠ 0

Next tactic:
rw [eq_spanSingleton_of_principal I]
theorem invertible_iff_generator_nonzero (I : FractionalIdeal R₁⁰ K)
    [Submodule.IsPrincipal (I : Submodule R₁ K)] :
    I * I⁻¹ = 1 ↔ generator (I : Submodule R₁ K) ≠ 0 := by
  constructor
  · intro hI hg
    apply ne_zero_of_mul_eq_one _ _ hI
    rw [eq_spanSingleton_of_principal I, hg, spanSingleton_zero]
  · intro hg
    apply invertible_of_principal
    rw [eq_spanSingleton_of_principal I]
    

Proof state:
case mpr.h
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : CommRing A
inst✝⁹ : Field K
inst✝⁸ : IsDomain A
R₁ : Type u_4
inst✝⁷ : CommRing R₁
inst✝⁶ : IsDomain R₁
inst✝⁵ : Algebra R₁ K
inst✝⁴ : IsFractionRing R₁ K
I✝ J : FractionalIdeal R₁⁰ K
K' : Type u_5
inst✝³ : Field K'
inst✝² : Algebra R₁ K'
inst✝¹ : IsFractionRing R₁ K'
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
hg : generator ↑I ≠ 0
⊢ spanSingleton R₁⁰ (generator ↑I) ≠ 0

Next tactic:
intro hI
theorem invertible_iff_generator_nonzero (I : FractionalIdeal R₁⁰ K)
    [Submodule.IsPrincipal (I : Submodule R₁ K)] :
    I * I⁻¹ = 1 ↔ generator (I : Submodule R₁ K) ≠ 0 := by
  constructor
  · intro hI hg
    apply ne_zero_of_mul_eq_one _ _ hI
    rw [eq_spanSingleton_of_principal I, hg, spanSingleton_zero]
  · intro hg
    apply invertible_of_principal
    rw [eq_spanSingleton_of_principal I]
    intro hI
    

Proof state:
case mpr.h
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : CommRing A
inst✝⁹ : Field K
inst✝⁸ : IsDomain A
R₁ : Type u_4
inst✝⁷ : CommRing R₁
inst✝⁶ : IsDomain R₁
inst✝⁵ : Algebra R₁ K
inst✝⁴ : IsFractionRing R₁ K
I✝ J : FractionalIdeal R₁⁰ K
K' : Type u_5
inst✝³ : Field K'
inst✝² : Algebra R₁ K'
inst✝¹ : IsFractionRing R₁ K'
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
hg : generator ↑I ≠ 0
hI : spanSingleton R₁⁰ (generator ↑I) = 0
⊢ False

Next tactic:
have := mem_spanSingleton_self R₁⁰ (generator (I : Submodule R₁ K))
theorem invertible_iff_generator_nonzero (I : FractionalIdeal R₁⁰ K)
    [Submodule.IsPrincipal (I : Submodule R₁ K)] :
    I * I⁻¹ = 1 ↔ generator (I : Submodule R₁ K) ≠ 0 := by
  constructor
  · intro hI hg
    apply ne_zero_of_mul_eq_one _ _ hI
    rw [eq_spanSingleton_of_principal I, hg, spanSingleton_zero]
  · intro hg
    apply invertible_of_principal
    rw [eq_spanSingleton_of_principal I]
    intro hI
    have := mem_spanSingleton_self R₁⁰ (generator (I : Submodule R₁ K))
    

Proof state:
case mpr.h
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : CommRing A
inst✝⁹ : Field K
inst✝⁸ : IsDomain A
R₁ : Type u_4
inst✝⁷ : CommRing R₁
inst✝⁶ : IsDomain R₁
inst✝⁵ : Algebra R₁ K
inst✝⁴ : IsFractionRing R₁ K
I✝ J : FractionalIdeal R₁⁰ K
K' : Type u_5
inst✝³ : Field K'
inst✝² : Algebra R₁ K'
inst✝¹ : IsFractionRing R₁ K'
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
hg : generator ↑I ≠ 0
hI : spanSingleton R₁⁰ (generator ↑I) = 0
this : generator ↑I ∈ spanSingleton R₁⁰ (generator ↑I)
⊢ False

Next tactic:
rw [hI, mem_zero_iff] at this
theorem invertible_iff_generator_nonzero (I : FractionalIdeal R₁⁰ K)
    [Submodule.IsPrincipal (I : Submodule R₁ K)] :
    I * I⁻¹ = 1 ↔ generator (I : Submodule R₁ K) ≠ 0 := by
  constructor
  · intro hI hg
    apply ne_zero_of_mul_eq_one _ _ hI
    rw [eq_spanSingleton_of_principal I, hg, spanSingleton_zero]
  · intro hg
    apply invertible_of_principal
    rw [eq_spanSingleton_of_principal I]
    intro hI
    have := mem_spanSingleton_self R₁⁰ (generator (I : Submodule R₁ K))
    rw [hI, mem_zero_iff] at this
    

Proof state:
case mpr.h
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : CommRing A
inst✝⁹ : Field K
inst✝⁸ : IsDomain A
R₁ : Type u_4
inst✝⁷ : CommRing R₁
inst✝⁶ : IsDomain R₁
inst✝⁵ : Algebra R₁ K
inst✝⁴ : IsFractionRing R₁ K
I✝ J : FractionalIdeal R₁⁰ K
K' : Type u_5
inst✝³ : Field K'
inst✝² : Algebra R₁ K'
inst✝¹ : IsFractionRing R₁ K'
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
hg : generator ↑I ≠ 0
hI : spanSingleton R₁⁰ (generator ↑I) = 0
this : generator ↑I = 0
⊢ False

Next tactic:
contradiction
theorem isPrincipal_inv (I : FractionalIdeal R₁⁰ K) [Submodule.IsPrincipal (I : Submodule R₁ K)]
    (h : I ≠ 0) : Submodule.IsPrincipal I⁻¹.1 := by
  

Proof state:
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : CommRing A
inst✝⁹ : Field K
inst✝⁸ : IsDomain A
R₁ : Type u_4
inst✝⁷ : CommRing R₁
inst✝⁶ : IsDomain R₁
inst✝⁵ : Algebra R₁ K
inst✝⁴ : IsFractionRing R₁ K
I✝ J : FractionalIdeal R₁⁰ K
K' : Type u_5
inst✝³ : Field K'
inst✝² : Algebra R₁ K'
inst✝¹ : IsFractionRing R₁ K'
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
h : I ≠ 0
⊢ IsPrincipal ↑I⁻¹

Next tactic:
rw [val_eq_coe, isPrincipal_iff]
theorem isPrincipal_inv (I : FractionalIdeal R₁⁰ K) [Submodule.IsPrincipal (I : Submodule R₁ K)]
    (h : I ≠ 0) : Submodule.IsPrincipal I⁻¹.1 := by
  rw [val_eq_coe, isPrincipal_iff]
  

Proof state:
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : CommRing A
inst✝⁹ : Field K
inst✝⁸ : IsDomain A
R₁ : Type u_4
inst✝⁷ : CommRing R₁
inst✝⁶ : IsDomain R₁
inst✝⁵ : Algebra R₁ K
inst✝⁴ : IsFractionRing R₁ K
I✝ J : FractionalIdeal R₁⁰ K
K' : Type u_5
inst✝³ : Field K'
inst✝² : Algebra R₁ K'
inst✝¹ : IsFractionRing R₁ K'
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
h : I ≠ 0
⊢ ∃ x, I⁻¹ = spanSingleton R₁⁰ x

Next tactic:
use (generator (I : Submodule R₁ K))⁻¹
theorem isPrincipal_inv (I : FractionalIdeal R₁⁰ K) [Submodule.IsPrincipal (I : Submodule R₁ K)]
    (h : I ≠ 0) : Submodule.IsPrincipal I⁻¹.1 := by
  rw [val_eq_coe, isPrincipal_iff]
  use (generator (I : Submodule R₁ K))⁻¹
  

Proof state:
case h
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : CommRing A
inst✝⁹ : Field K
inst✝⁸ : IsDomain A
R₁ : Type u_4
inst✝⁷ : CommRing R₁
inst✝⁶ : IsDomain R₁
inst✝⁵ : Algebra R₁ K
inst✝⁴ : IsFractionRing R₁ K
I✝ J : FractionalIdeal R₁⁰ K
K' : Type u_5
inst✝³ : Field K'
inst✝² : Algebra R₁ K'
inst✝¹ : IsFractionRing R₁ K'
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
h : I ≠ 0
⊢ I⁻¹ = spanSingleton R₁⁰ (generator ↑I)⁻¹

Next tactic:
have hI : I * spanSingleton _ (generator (I : Submodule R₁ K))⁻¹ = 1
theorem isPrincipal_inv (I : FractionalIdeal R₁⁰ K) [Submodule.IsPrincipal (I : Submodule R₁ K)]
    (h : I ≠ 0) : Submodule.IsPrincipal I⁻¹.1 := by
  rw [val_eq_coe, isPrincipal_iff]
  use (generator (I : Submodule R₁ K))⁻¹
  have hI : I * spanSingleton _ (generator (I : Submodule R₁ K))⁻¹ = 1
  

Proof state:
case hI
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : CommRing A
inst✝⁹ : Field K
inst✝⁸ : IsDomain A
R₁ : Type u_4
inst✝⁷ : CommRing R₁
inst✝⁶ : IsDomain R₁
inst✝⁵ : Algebra R₁ K
inst✝⁴ : IsFractionRing R₁ K
I✝ J : FractionalIdeal R₁⁰ K
K' : Type u_5
inst✝³ : Field K'
inst✝² : Algebra R₁ K'
inst✝¹ : IsFractionRing R₁ K'
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
h : I ≠ 0
⊢ I * spanSingleton R₁⁰ (generator ↑I)⁻¹ = 1
case h
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : CommRing A
inst✝⁹ : Field K
inst✝⁸ : IsDomain A
R₁ : Type u_4
inst✝⁷ : CommRing R₁
inst✝⁶ : IsDomain R₁
inst✝⁵ : Algebra R₁ K
inst✝⁴ : IsFractionRing R₁ K
I✝ J : FractionalIdeal R₁⁰ K
K' : Type u_5
inst✝³ : Field K'
inst✝² : Algebra R₁ K'
inst✝¹ : IsFractionRing R₁ K'
I : FractionalIdeal R₁⁰ K
inst✝ : IsPrincipal ↑I
h : I ≠ 0
hI : I * spanSingleton R₁⁰ (generator ↑I)⁻¹ = 1
⊢ I⁻¹ = spanSingleton R₁⁰ (generator ↑I)⁻¹

Next tactic:
apply mul_generator_self_inv _ I h