l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem ofPrime_idealOfLE (R S : ValuationSubring K) (h : R ≤ S) :
    ofPrime R (idealOfLE R S h) = S := by
  ext x; constructor
  · rintro ⟨a, r, hr, rfl⟩; apply mul_mem; · exact h a.2
    · rw [← valuation_le_one_iff, map_inv₀, ← inv_one, inv_le_inv₀]
      · exact not_lt.1 ((not_iff_not.2 <| valuation_lt_one_iff S _).1 hr)
      · intro hh; erw [Valuation.zero_iff, Subring.coe_eq_zero_iff] at hh
        apply hr; rw [hh]; apply Ideal.zero_mem (R.idealOfLE S h)
      · exact one_ne_zero
  · intro hx; by_cases hr : x ∈ R; · exact R.le_ofPrime _ hr
    have : x ≠ 0 := fun h => hr (by 

Proof state:
K : Type u
inst✝ : Field K
A R S : ValuationSubring K
h✝ : R ≤ S
x : K
hx : x ∈ S
hr : x ∉ R
h : x = 0
⊢ x ∈ R

Next tactic:
rw [h]
@[simp]
theorem ofPrime_idealOfLE (R S : ValuationSubring K) (h : R ≤ S) :
    ofPrime R (idealOfLE R S h) = S := by
  ext x; constructor
  · rintro ⟨a, r, hr, rfl⟩; apply mul_mem; · exact h a.2
    · rw [← valuation_le_one_iff, map_inv₀, ← inv_one, inv_le_inv₀]
      · exact not_lt.1 ((not_iff_not.2 <| valuation_lt_one_iff S _).1 hr)
      · intro hh; erw [Valuation.zero_iff, Subring.coe_eq_zero_iff] at hh
        apply hr; rw [hh]; apply Ideal.zero_mem (R.idealOfLE S h)
      · exact one_ne_zero
  · intro hx; by_cases hr : x ∈ R; · exact R.le_ofPrime _ hr
    have : x ≠ 0 := fun h => hr (by rw [h]; 

Proof state:
K : Type u
inst✝ : Field K
A R S : ValuationSubring K
h✝ : R ≤ S
x : K
hx : x ∈ S
hr : x ∉ R
h : x = 0
⊢ 0 ∈ R

Next tactic:
exact R.zero_mem
@[simp]
theorem ofPrime_idealOfLE (R S : ValuationSubring K) (h : R ≤ S) :
    ofPrime R (idealOfLE R S h) = S := by
  ext x; constructor
  · rintro ⟨a, r, hr, rfl⟩; apply mul_mem; · exact h a.2
    · rw [← valuation_le_one_iff, map_inv₀, ← inv_one, inv_le_inv₀]
      · exact not_lt.1 ((not_iff_not.2 <| valuation_lt_one_iff S _).1 hr)
      · intro hh; erw [Valuation.zero_iff, Subring.coe_eq_zero_iff] at hh
        apply hr; rw [hh]; apply Ideal.zero_mem (R.idealOfLE S h)
      · exact one_ne_zero
  · intro hx; by_cases hr : x ∈ R; · exact R.le_ofPrime _ hr
    have : x ≠ 0 := fun h => hr (by rw [h]; exact R.zero_mem)
    

Proof state:
case neg
K : Type u
inst✝ : Field K
A R S : ValuationSubring K
h : R ≤ S
x : K
hx : x ∈ S
hr : x ∉ R
this : x ≠ 0
⊢ x ∈ ofPrime R (idealOfLE R S h)

Next tactic:
replace hr := (R.mem_or_inv_mem x).resolve_left hr
@[simp]
theorem ofPrime_idealOfLE (R S : ValuationSubring K) (h : R ≤ S) :
    ofPrime R (idealOfLE R S h) = S := by
  ext x; constructor
  · rintro ⟨a, r, hr, rfl⟩; apply mul_mem; · exact h a.2
    · rw [← valuation_le_one_iff, map_inv₀, ← inv_one, inv_le_inv₀]
      · exact not_lt.1 ((not_iff_not.2 <| valuation_lt_one_iff S _).1 hr)
      · intro hh; erw [Valuation.zero_iff, Subring.coe_eq_zero_iff] at hh
        apply hr; rw [hh]; apply Ideal.zero_mem (R.idealOfLE S h)
      · exact one_ne_zero
  · intro hx; by_cases hr : x ∈ R; · exact R.le_ofPrime _ hr
    have : x ≠ 0 := fun h => hr (by rw [h]; exact R.zero_mem)
    replace hr := (R.mem_or_inv_mem x).resolve_left hr
    · -- Porting note: added `⟨⟩` brackets and reordered goals
      

Proof state:
case neg
K : Type u
inst✝ : Field K
A R S : ValuationSubring K
h : R ≤ S
x : K
hx : x ∈ S
this : x ≠ 0
hr : x⁻¹ ∈ R
⊢ x ∈ ofPrime R (idealOfLE R S h)

Next tactic:
use 1, ⟨x⁻¹, hr⟩
@[simp]
theorem ofPrime_idealOfLE (R S : ValuationSubring K) (h : R ≤ S) :
    ofPrime R (idealOfLE R S h) = S := by
  ext x; constructor
  · rintro ⟨a, r, hr, rfl⟩; apply mul_mem; · exact h a.2
    · rw [← valuation_le_one_iff, map_inv₀, ← inv_one, inv_le_inv₀]
      · exact not_lt.1 ((not_iff_not.2 <| valuation_lt_one_iff S _).1 hr)
      · intro hh; erw [Valuation.zero_iff, Subring.coe_eq_zero_iff] at hh
        apply hr; rw [hh]; apply Ideal.zero_mem (R.idealOfLE S h)
      · exact one_ne_zero
  · intro hx; by_cases hr : x ∈ R; · exact R.le_ofPrime _ hr
    have : x ≠ 0 := fun h => hr (by rw [h]; exact R.zero_mem)
    replace hr := (R.mem_or_inv_mem x).resolve_left hr
    · -- Porting note: added `⟨⟩` brackets and reordered goals
      use 1, ⟨x⁻¹, hr⟩; 

Proof state:
case h
K : Type u
inst✝ : Field K
A R S : ValuationSubring K
h : R ≤ S
x : K
hx : x ∈ S
this : x ≠ 0
hr : x⁻¹ ∈ R
⊢ ∃ (_ : { val := x⁻¹, property := hr } ∈ Ideal.primeCompl (idealOfLE R S h)),
    x = (algebraMap (↥R) K) 1 * ((algebraMap (↥R) K) { val := x⁻¹, property := hr })⁻¹

Next tactic:
constructor
@[simp]
theorem ofPrime_idealOfLE (R S : ValuationSubring K) (h : R ≤ S) :
    ofPrime R (idealOfLE R S h) = S := by
  ext x; constructor
  · rintro ⟨a, r, hr, rfl⟩; apply mul_mem; · exact h a.2
    · rw [← valuation_le_one_iff, map_inv₀, ← inv_one, inv_le_inv₀]
      · exact not_lt.1 ((not_iff_not.2 <| valuation_lt_one_iff S _).1 hr)
      · intro hh; erw [Valuation.zero_iff, Subring.coe_eq_zero_iff] at hh
        apply hr; rw [hh]; apply Ideal.zero_mem (R.idealOfLE S h)
      · exact one_ne_zero
  · intro hx; by_cases hr : x ∈ R; · exact R.le_ofPrime _ hr
    have : x ≠ 0 := fun h => hr (by rw [h]; exact R.zero_mem)
    replace hr := (R.mem_or_inv_mem x).resolve_left hr
    · -- Porting note: added `⟨⟩` brackets and reordered goals
      use 1, ⟨x⁻¹, hr⟩; constructor
      · 

Proof state:
case h.h
K : Type u
inst✝ : Field K
A R S : ValuationSubring K
h : R ≤ S
x : K
hx : x ∈ S
this : x ≠ 0
hr : x⁻¹ ∈ R
⊢ x = (algebraMap (↥R) K) 1 * ((algebraMap (↥R) K) { val := x⁻¹, property := hr })⁻¹

Next tactic:
field_simp
@[simp]
theorem ofPrime_idealOfLE (R S : ValuationSubring K) (h : R ≤ S) :
    ofPrime R (idealOfLE R S h) = S := by
  ext x; constructor
  · rintro ⟨a, r, hr, rfl⟩; apply mul_mem; · exact h a.2
    · rw [← valuation_le_one_iff, map_inv₀, ← inv_one, inv_le_inv₀]
      · exact not_lt.1 ((not_iff_not.2 <| valuation_lt_one_iff S _).1 hr)
      · intro hh; erw [Valuation.zero_iff, Subring.coe_eq_zero_iff] at hh
        apply hr; rw [hh]; apply Ideal.zero_mem (R.idealOfLE S h)
      · exact one_ne_zero
  · intro hx; by_cases hr : x ∈ R; · exact R.le_ofPrime _ hr
    have : x ≠ 0 := fun h => hr (by rw [h]; exact R.zero_mem)
    replace hr := (R.mem_or_inv_mem x).resolve_left hr
    · -- Porting note: added `⟨⟩` brackets and reordered goals
      use 1, ⟨x⁻¹, hr⟩; constructor
      · field_simp
      · 

Proof state:
case h.w
K : Type u
inst✝ : Field K
A R S : ValuationSubring K
h : R ≤ S
x : K
hx : x ∈ S
this : x ≠ 0
hr : x⁻¹ ∈ R
⊢ { val := x⁻¹, property := hr } ∈ Ideal.primeCompl (idealOfLE R S h)

Next tactic:
change (⟨x⁻¹, h hr⟩ : S) ∉ nonunits S
@[simp]
theorem ofPrime_idealOfLE (R S : ValuationSubring K) (h : R ≤ S) :
    ofPrime R (idealOfLE R S h) = S := by
  ext x; constructor
  · rintro ⟨a, r, hr, rfl⟩; apply mul_mem; · exact h a.2
    · rw [← valuation_le_one_iff, map_inv₀, ← inv_one, inv_le_inv₀]
      · exact not_lt.1 ((not_iff_not.2 <| valuation_lt_one_iff S _).1 hr)
      · intro hh; erw [Valuation.zero_iff, Subring.coe_eq_zero_iff] at hh
        apply hr; rw [hh]; apply Ideal.zero_mem (R.idealOfLE S h)
      · exact one_ne_zero
  · intro hx; by_cases hr : x ∈ R; · exact R.le_ofPrime _ hr
    have : x ≠ 0 := fun h => hr (by rw [h]; exact R.zero_mem)
    replace hr := (R.mem_or_inv_mem x).resolve_left hr
    · -- Porting note: added `⟨⟩` brackets and reordered goals
      use 1, ⟨x⁻¹, hr⟩; constructor
      · field_simp
      · change (⟨x⁻¹, h hr⟩ : S) ∉ nonunits S
        

Proof state:
case h.w
K : Type u
inst✝ : Field K
A R S : ValuationSubring K
h : R ≤ S
x : K
hx : x ∈ S
this : x ≠ 0
hr : x⁻¹ ∈ R
⊢ { val := x⁻¹, property := (_ : x⁻¹ ∈ S) } ∉ nonunits ↥S

Next tactic:
rw [mem_nonunits_iff, Classical.not_not]
@[simp]
theorem ofPrime_idealOfLE (R S : ValuationSubring K) (h : R ≤ S) :
    ofPrime R (idealOfLE R S h) = S := by
  ext x; constructor
  · rintro ⟨a, r, hr, rfl⟩; apply mul_mem; · exact h a.2
    · rw [← valuation_le_one_iff, map_inv₀, ← inv_one, inv_le_inv₀]
      · exact not_lt.1 ((not_iff_not.2 <| valuation_lt_one_iff S _).1 hr)
      · intro hh; erw [Valuation.zero_iff, Subring.coe_eq_zero_iff] at hh
        apply hr; rw [hh]; apply Ideal.zero_mem (R.idealOfLE S h)
      · exact one_ne_zero
  · intro hx; by_cases hr : x ∈ R; · exact R.le_ofPrime _ hr
    have : x ≠ 0 := fun h => hr (by rw [h]; exact R.zero_mem)
    replace hr := (R.mem_or_inv_mem x).resolve_left hr
    · -- Porting note: added `⟨⟩` brackets and reordered goals
      use 1, ⟨x⁻¹, hr⟩; constructor
      · field_simp
      · change (⟨x⁻¹, h hr⟩ : S) ∉ nonunits S
        rw [mem_nonunits_iff, Classical.not_not]
        

Proof state:
case h.w
K : Type u
inst✝ : Field K
A R S : ValuationSubring K
h : R ≤ S
x : K
hx : x ∈ S
this : x ≠ 0
hr : x⁻¹ ∈ R
⊢ IsUnit { val := x⁻¹, property := (_ : x⁻¹ ∈ S) }

Next tactic:
apply isUnit_of_mul_eq_one _ (⟨x, hx⟩ : S)
@[simp]
theorem ofPrime_idealOfLE (R S : ValuationSubring K) (h : R ≤ S) :
    ofPrime R (idealOfLE R S h) = S := by
  ext x; constructor
  · rintro ⟨a, r, hr, rfl⟩; apply mul_mem; · exact h a.2
    · rw [← valuation_le_one_iff, map_inv₀, ← inv_one, inv_le_inv₀]
      · exact not_lt.1 ((not_iff_not.2 <| valuation_lt_one_iff S _).1 hr)
      · intro hh; erw [Valuation.zero_iff, Subring.coe_eq_zero_iff] at hh
        apply hr; rw [hh]; apply Ideal.zero_mem (R.idealOfLE S h)
      · exact one_ne_zero
  · intro hx; by_cases hr : x ∈ R; · exact R.le_ofPrime _ hr
    have : x ≠ 0 := fun h => hr (by rw [h]; exact R.zero_mem)
    replace hr := (R.mem_or_inv_mem x).resolve_left hr
    · -- Porting note: added `⟨⟩` brackets and reordered goals
      use 1, ⟨x⁻¹, hr⟩; constructor
      · field_simp
      · change (⟨x⁻¹, h hr⟩ : S) ∉ nonunits S
        rw [mem_nonunits_iff, Classical.not_not]
        apply isUnit_of_mul_eq_one _ (⟨x, hx⟩ : S)
        

Proof state:
case h.w
K : Type u
inst✝ : Field K
A R S : ValuationSubring K
h : R ≤ S
x : K
hx : x ∈ S
this : x ≠ 0
hr : x⁻¹ ∈ R
⊢ { val := x⁻¹, property := (_ : x⁻¹ ∈ S) } * { val := x, property := hx } = 1

Next tactic:
ext
@[simp]
theorem ofPrime_idealOfLE (R S : ValuationSubring K) (h : R ≤ S) :
    ofPrime R (idealOfLE R S h) = S := by
  ext x; constructor
  · rintro ⟨a, r, hr, rfl⟩; apply mul_mem; · exact h a.2
    · rw [← valuation_le_one_iff, map_inv₀, ← inv_one, inv_le_inv₀]
      · exact not_lt.1 ((not_iff_not.2 <| valuation_lt_one_iff S _).1 hr)
      · intro hh; erw [Valuation.zero_iff, Subring.coe_eq_zero_iff] at hh
        apply hr; rw [hh]; apply Ideal.zero_mem (R.idealOfLE S h)
      · exact one_ne_zero
  · intro hx; by_cases hr : x ∈ R; · exact R.le_ofPrime _ hr
    have : x ≠ 0 := fun h => hr (by rw [h]; exact R.zero_mem)
    replace hr := (R.mem_or_inv_mem x).resolve_left hr
    · -- Porting note: added `⟨⟩` brackets and reordered goals
      use 1, ⟨x⁻¹, hr⟩; constructor
      · field_simp
      · change (⟨x⁻¹, h hr⟩ : S) ∉ nonunits S
        rw [mem_nonunits_iff, Classical.not_not]
        apply isUnit_of_mul_eq_one _ (⟨x, hx⟩ : S)
        ext; 

Proof state:
case h.w.a
K : Type u
inst✝ : Field K
A R S : ValuationSubring K
h : R ≤ S
x : K
hx : x ∈ S
this : x ≠ 0
hr : x⁻¹ ∈ R
⊢ ↑({ val := x⁻¹, property := (_ : x⁻¹ ∈ S) } * { val := x, property := hx }) = ↑1

Next tactic:
field_simp
theorem idealOfLE_le_of_le (R S : ValuationSubring K) (hR : A ≤ R) (hS : A ≤ S) (h : R ≤ S) :
    idealOfLE A S hS ≤ idealOfLE A R hR := fun x hx =>
  (valuation_lt_one_iff R _).2
    (by
      

Proof state:
K : Type u
inst✝ : Field K
A R S : ValuationSubring K
hR : A ≤ R
hS : A ≤ S
h : R ≤ S
x : ↥A
hx : x ∈ idealOfLE A S hS
⊢ (valuation R) ↑((inclusion A R hR) x) < 1

Next tactic:
by_contra c
theorem idealOfLE_le_of_le (R S : ValuationSubring K) (hR : A ≤ R) (hS : A ≤ S) (h : R ≤ S) :
    idealOfLE A S hS ≤ idealOfLE A R hR := fun x hx =>
  (valuation_lt_one_iff R _).2
    (by
      by_contra c; 

Proof state:
K : Type u
inst✝ : Field K
A R S : ValuationSubring K
hR : A ≤ R
hS : A ≤ S
h : R ≤ S
x : ↥A
hx : x ∈ idealOfLE A S hS
c : ¬(valuation R) ↑((inclusion A R hR) x) < 1
⊢ False

Next tactic:
push_neg at c
theorem idealOfLE_le_of_le (R S : ValuationSubring K) (hR : A ≤ R) (hS : A ≤ S) (h : R ≤ S) :
    idealOfLE A S hS ≤ idealOfLE A R hR := fun x hx =>
  (valuation_lt_one_iff R _).2
    (by
      by_contra c; push_neg at c; 

Proof state:
K : Type u
inst✝ : Field K
A R S : ValuationSubring K
hR : A ≤ R
hS : A ≤ S
h : R ≤ S
x : ↥A
hx : x ∈ idealOfLE A S hS
c : 1 ≤ (valuation R) ↑((inclusion A R hR) x)
⊢ False

Next tactic:
replace c := monotone_mapOfLE R S h c
theorem idealOfLE_le_of_le (R S : ValuationSubring K) (hR : A ≤ R) (hS : A ≤ S) (h : R ≤ S) :
    idealOfLE A S hS ≤ idealOfLE A R hR := fun x hx =>
  (valuation_lt_one_iff R _).2
    (by
      by_contra c; push_neg at c; replace c := monotone_mapOfLE R S h c
      

Proof state:
K : Type u
inst✝ : Field K
A R S : ValuationSubring K
hR : A ≤ R
hS : A ≤ S
h : R ≤ S
x : ↥A
hx : x ∈ idealOfLE A S hS
c : (mapOfLE R S h) 1 ≤ (mapOfLE R S h) ((valuation R) ↑((inclusion A R hR) x))
⊢ False

Next tactic:
rw [(mapOfLE _ _ _).map_one, mapOfLE_valuation_apply] at c
theorem idealOfLE_le_of_le (R S : ValuationSubring K) (hR : A ≤ R) (hS : A ≤ S) (h : R ≤ S) :
    idealOfLE A S hS ≤ idealOfLE A R hR := fun x hx =>
  (valuation_lt_one_iff R _).2
    (by
      by_contra c; push_neg at c; replace c := monotone_mapOfLE R S h c
      rw [(mapOfLE _ _ _).map_one, mapOfLE_valuation_apply] at c
      

Proof state:
K : Type u
inst✝ : Field K
A R S : ValuationSubring K
hR : A ≤ R
hS : A ≤ S
h : R ≤ S
x : ↥A
hx : x ∈ idealOfLE A S hS
c : 1 ≤ (valuation S) ↑((inclusion A R hR) x)
⊢ False

Next tactic:
apply not_le_of_lt ((valuation_lt_one_iff S _).1 hx) c
/-- The equivalence between coarsenings of a valuation ring and its prime ideals.-/
@[simps]
def primeSpectrumEquiv : PrimeSpectrum A ≃ {S // A ≤ S} where
  toFun P := ⟨ofPrime A P.asIdeal, le_ofPrime _ _⟩
  invFun S := ⟨idealOfLE _ S S.2, inferInstance⟩
  left_inv P := by 

Proof state:
K : Type u
inst✝ : Field K
A : ValuationSubring K
P : PrimeSpectrum ↥A
⊢ (fun S => { asIdeal := idealOfLE A ↑S (_ : A ≤ ↑S), IsPrime := (_ : Ideal.IsPrime (idealOfLE A ↑S (_ : A ≤ ↑S))) })
      ((fun P => { val := ofPrime A P.asIdeal, property := (_ : A ≤ ofPrime A P.asIdeal) }) P) =
    P

Next tactic:
ext1
/-- The equivalence between coarsenings of a valuation ring and its prime ideals.-/
@[simps]
def primeSpectrumEquiv : PrimeSpectrum A ≃ {S // A ≤ S} where
  toFun P := ⟨ofPrime A P.asIdeal, le_ofPrime _ _⟩
  invFun S := ⟨idealOfLE _ S S.2, inferInstance⟩
  left_inv P := by ext1; 

Proof state:
case asIdeal
K : Type u
inst✝ : Field K
A : ValuationSubring K
P : PrimeSpectrum ↥A
⊢ ((fun S => { asIdeal := idealOfLE A ↑S (_ : A ≤ ↑S), IsPrime := (_ : Ideal.IsPrime (idealOfLE A ↑S (_ : A ≤ ↑S))) })
        ((fun P => { val := ofPrime A P.asIdeal, property := (_ : A ≤ ofPrime A P.asIdeal) }) P)).asIdeal =
    P.asIdeal

Next tactic:
simp
/-- The equivalence between coarsenings of a valuation ring and its prime ideals.-/
@[simps]
def primeSpectrumEquiv : PrimeSpectrum A ≃ {S // A ≤ S} where
  toFun P := ⟨ofPrime A P.asIdeal, le_ofPrime _ _⟩
  invFun S := ⟨idealOfLE _ S S.2, inferInstance⟩
  left_inv P := by ext1; simp
  right_inv S := by 

Proof state:
K : Type u
inst✝ : Field K
A : ValuationSubring K
S : { S // A ≤ S }
⊢ (fun P => { val := ofPrime A P.asIdeal, property := (_ : A ≤ ofPrime A P.asIdeal) })
      ((fun S =>
          { asIdeal := idealOfLE A ↑S (_ : A ≤ ↑S), IsPrime := (_ : Ideal.IsPrime (idealOfLE A ↑S (_ : A ≤ ↑S))) })
        S) =
    S

Next tactic:
ext1
/-- The equivalence between coarsenings of a valuation ring and its prime ideals.-/
@[simps]
def primeSpectrumEquiv : PrimeSpectrum A ≃ {S // A ≤ S} where
  toFun P := ⟨ofPrime A P.asIdeal, le_ofPrime _ _⟩
  invFun S := ⟨idealOfLE _ S S.2, inferInstance⟩
  left_inv P := by ext1; simp
  right_inv S := by ext1; 

Proof state:
case a
K : Type u
inst✝ : Field K
A : ValuationSubring K
S : { S // A ≤ S }
⊢ ↑((fun P => { val := ofPrime A P.asIdeal, property := (_ : A ≤ ofPrime A P.asIdeal) })
        ((fun S =>
            { asIdeal := idealOfLE A ↑S (_ : A ≤ ↑S), IsPrime := (_ : Ideal.IsPrime (idealOfLE A ↑S (_ : A ≤ ↑S))) })
          S)) =
    ↑S

Next tactic:
simp
/-- An ordered variant of `primeSpectrumEquiv`. -/
@[simps]
def primeSpectrumOrderEquiv : (PrimeSpectrum A)ᵒᵈ ≃o {S // A ≤ S} :=
  { primeSpectrumEquiv A with
    map_rel_iff' :=
      ⟨fun h => by
        

Proof state:
K : Type u
inst✝ : Field K
A : ValuationSubring K
src✝ : PrimeSpectrum ↥A ≃ { S // A ≤ S } := primeSpectrumEquiv A
a✝ b✝ : (PrimeSpectrum ↥A)ᵒᵈ
h :
  { toFun := src✝.toFun, invFun := src✝.invFun, left_inv := (_ : Function.LeftInverse src✝.invFun src✝.toFun),
        right_inv := (_ : Function.RightInverse src✝.invFun src✝.toFun) }
      a✝ ≤
    { toFun := src✝.toFun, invFun := src✝.invFun, left_inv := (_ : Function.LeftInverse src✝.invFun src✝.toFun),
        right_inv := (_ : Function.RightInverse src✝.invFun src✝.toFun) }
      b✝
⊢ a✝ ≤ b✝

Next tactic:
dsimp at h
/-- An ordered variant of `primeSpectrumEquiv`. -/
@[simps]
def primeSpectrumOrderEquiv : (PrimeSpectrum A)ᵒᵈ ≃o {S // A ≤ S} :=
  { primeSpectrumEquiv A with
    map_rel_iff' :=
      ⟨fun h => by
        dsimp at h
        

Proof state:
K : Type u
inst✝ : Field K
A : ValuationSubring K
src✝ : PrimeSpectrum ↥A ≃ { S // A ≤ S } := primeSpectrumEquiv A
a✝ b✝ : (PrimeSpectrum ↥A)ᵒᵈ
h : (primeSpectrumEquiv A) a✝ ≤ (primeSpectrumEquiv A) b✝
⊢ a✝ ≤ b✝

Next tactic:
have := idealOfLE_le_of_le A _ _ ?_ ?_ h
/-- An ordered variant of `primeSpectrumEquiv`. -/
@[simps]
def primeSpectrumOrderEquiv : (PrimeSpectrum A)ᵒᵈ ≃o {S // A ≤ S} :=
  { primeSpectrumEquiv A with
    map_rel_iff' :=
      ⟨fun h => by
        dsimp at h
        have := idealOfLE_le_of_le A _ _ ?_ ?_ h
        

Proof state:
case refine_3
K : Type u
inst✝ : Field K
A : ValuationSubring K
src✝ : PrimeSpectrum ↥A ≃ { S // A ≤ S } := primeSpectrumEquiv A
a✝ b✝ : (PrimeSpectrum ↥A)ᵒᵈ
h : (primeSpectrumEquiv A) a✝ ≤ (primeSpectrumEquiv A) b✝
this : idealOfLE A ↑((primeSpectrumEquiv A) b✝) ?refine_2 ≤ idealOfLE A ↑((primeSpectrumEquiv A) a✝) ?refine_1
⊢ a✝ ≤ b✝
case refine_1
K : Type u
inst✝ : Field K
A : ValuationSubring K
src✝ : PrimeSpectrum ↥A ≃ { S // A ≤ S } := primeSpectrumEquiv A
a✝ b✝ : (PrimeSpectrum ↥A)ᵒᵈ
h : (primeSpectrumEquiv A) a✝ ≤ (primeSpectrumEquiv A) b✝
⊢ A ≤ ↑((primeSpectrumEquiv A) a✝)
case refine_2
K : Type u
inst✝ : Field K
A : ValuationSubring K
src✝ : PrimeSpectrum ↥A ≃ { S // A ≤ S } := primeSpectrumEquiv A
a✝ b✝ : (PrimeSpectrum ↥A)ᵒᵈ
h : (primeSpectrumEquiv A) a✝ ≤ (primeSpectrumEquiv A) b✝
⊢ A ≤ ↑((primeSpectrumEquiv A) b✝)

Next tactic:
iterate 2 erw [idealOfLE_ofPrime] at this
/-- An ordered variant of `primeSpectrumEquiv`. -/
@[simps]
def primeSpectrumOrderEquiv : (PrimeSpectrum A)ᵒᵈ ≃o {S // A ≤ S} :=
  { primeSpectrumEquiv A with
    map_rel_iff' :=
      ⟨fun h => by
        dsimp at h
        have := idealOfLE_le_of_le A _ _ ?_ ?_ h
        iterate 2 

Proof state:
case refine_3
K : Type u
inst✝ : Field K
A : ValuationSubring K
src✝ : PrimeSpectrum ↥A ≃ { S // A ≤ S } := primeSpectrumEquiv A
a✝ b✝ : (PrimeSpectrum ↥A)ᵒᵈ
h : (primeSpectrumEquiv A) a✝ ≤ (primeSpectrumEquiv A) b✝
this : idealOfLE A ↑((primeSpectrumEquiv A) b✝) ?refine_2 ≤ idealOfLE A ↑((primeSpectrumEquiv A) a✝) ?refine_1
⊢ a✝ ≤ b✝
case refine_1
K : Type u
inst✝ : Field K
A : ValuationSubring K
src✝ : PrimeSpectrum ↥A ≃ { S // A ≤ S } := primeSpectrumEquiv A
a✝ b✝ : (PrimeSpectrum ↥A)ᵒᵈ
h : (primeSpectrumEquiv A) a✝ ≤ (primeSpectrumEquiv A) b✝
⊢ A ≤ ↑((primeSpectrumEquiv A) a✝)
case refine_2
K : Type u
inst✝ : Field K
A : ValuationSubring K
src✝ : PrimeSpectrum ↥A ≃ { S // A ≤ S } := primeSpectrumEquiv A
a✝ b✝ : (PrimeSpectrum ↥A)ᵒᵈ
h : (primeSpectrumEquiv A) a✝ ≤ (primeSpectrumEquiv A) b✝
⊢ A ≤ ↑((primeSpectrumEquiv A) b✝)

Next tactic:
erw [idealOfLE_ofPrime] at this
/-- An ordered variant of `primeSpectrumEquiv`. -/
@[simps]
def primeSpectrumOrderEquiv : (PrimeSpectrum A)ᵒᵈ ≃o {S // A ≤ S} :=
  { primeSpectrumEquiv A with
    map_rel_iff' :=
      ⟨fun h => by
        dsimp at h
        have := idealOfLE_le_of_le A _ _ ?_ ?_ h
        iterate 2 

Proof state:
case refine_3
K : Type u
inst✝ : Field K
A : ValuationSubring K
src✝ : PrimeSpectrum ↥A ≃ { S // A ≤ S } := primeSpectrumEquiv A
a✝ b✝ : (PrimeSpectrum ↥A)ᵒᵈ
h : (primeSpectrumEquiv A) a✝ ≤ (primeSpectrumEquiv A) b✝
this : b✝.asIdeal ≤ idealOfLE A ↑((primeSpectrumEquiv A) a✝) ?refine_1
⊢ a✝ ≤ b✝
case refine_2
K : Type u
inst✝ : Field K
A : ValuationSubring K
src✝ : PrimeSpectrum ↥A ≃ { S // A ≤ S } := primeSpectrumEquiv A
a✝ b✝ : (PrimeSpectrum ↥A)ᵒᵈ
h : (primeSpectrumEquiv A) a✝ ≤ (primeSpectrumEquiv A) b✝
⊢ A ≤ ↑((primeSpectrumEquiv A) b✝)
case refine_1
K : Type u
inst✝ : Field K
A : ValuationSubring K
src✝ : PrimeSpectrum ↥A ≃ { S // A ≤ S } := primeSpectrumEquiv A
a✝ b✝ : (PrimeSpectrum ↥A)ᵒᵈ
h : (primeSpectrumEquiv A) a✝ ≤ (primeSpectrumEquiv A) b✝
⊢ A ≤ ↑((primeSpectrumEquiv A) a✝)
case refine_1
K : Type u
inst✝ : Field K
A : ValuationSubring K
src✝ : PrimeSpectrum ↥A ≃ { S // A ≤ S } := primeSpectrumEquiv A
a✝ b✝ : (PrimeSpectrum ↥A)ᵒᵈ
h : (primeSpectrumEquiv A) a✝ ≤ (primeSpectrumEquiv A) b✝
⊢ A ≤ ↑((primeSpectrumEquiv A) a✝)
case refine_2
K : Type u
inst✝ : Field K
A : ValuationSubring K
src✝ : PrimeSpectrum ↥A ≃ { S // A ≤ S } := primeSpectrumEquiv A
a✝ b✝ : (PrimeSpectrum ↥A)ᵒᵈ
h : (primeSpectrumEquiv A) a✝ ≤ (primeSpectrumEquiv A) b✝
⊢ A ≤ ↑((primeSpectrumEquiv A) b✝)

Next tactic:
erw [idealOfLE_ofPrime] at this
/-- An ordered variant of `primeSpectrumEquiv`. -/
@[simps]
def primeSpectrumOrderEquiv : (PrimeSpectrum A)ᵒᵈ ≃o {S // A ≤ S} :=
  { primeSpectrumEquiv A with
    map_rel_iff' :=
      ⟨fun h => by
        dsimp at h
        have := idealOfLE_le_of_le A _ _ ?_ ?_ h
        iterate 2 erw [idealOfLE_ofPrime] at this
        

Proof state:
case refine_3
K : Type u
inst✝ : Field K
A : ValuationSubring K
src✝ : PrimeSpectrum ↥A ≃ { S // A ≤ S } := primeSpectrumEquiv A
a✝ b✝ : (PrimeSpectrum ↥A)ᵒᵈ
h : (primeSpectrumEquiv A) a✝ ≤ (primeSpectrumEquiv A) b✝
this : b✝.asIdeal ≤ a✝.asIdeal
⊢ a✝ ≤ b✝
case refine_1
K : Type u
inst✝ : Field K
A : ValuationSubring K
src✝ : PrimeSpectrum ↥A ≃ { S // A ≤ S } := primeSpectrumEquiv A
a✝ b✝ : (PrimeSpectrum ↥A)ᵒᵈ
h : (primeSpectrumEquiv A) a✝ ≤ (primeSpectrumEquiv A) b✝
⊢ A ≤ ↑((primeSpectrumEquiv A) a✝)
case refine_2
K : Type u
inst✝ : Field K
A : ValuationSubring K
src✝ : PrimeSpectrum ↥A ≃ { S // A ≤ S } := primeSpectrumEquiv A
a✝ b✝ : (PrimeSpectrum ↥A)ᵒᵈ
h : (primeSpectrumEquiv A) a✝ ≤ (primeSpectrumEquiv A) b✝
⊢ A ≤ ↑((primeSpectrumEquiv A) b✝)
case refine_1
K : Type u
inst✝ : Field K
A : ValuationSubring K
src✝ : PrimeSpectrum ↥A ≃ { S // A ≤ S } := primeSpectrumEquiv A
a✝ b✝ : (PrimeSpectrum ↥A)ᵒᵈ
h : (primeSpectrumEquiv A) a✝ ≤ (primeSpectrumEquiv A) b✝
⊢ A ≤ ↑((primeSpectrumEquiv A) a✝)
case refine_1
K : Type u
inst✝ : Field K
A : ValuationSubring K
src✝ : PrimeSpectrum ↥A ≃ { S // A ≤ S } := primeSpectrumEquiv A
a✝ b✝ : (PrimeSpectrum ↥A)ᵒᵈ
h : (primeSpectrumEquiv A) a✝ ≤ (primeSpectrumEquiv A) b✝
⊢ A ≤ ↑((primeSpectrumEquiv A) a✝)
case refine_2
K : Type u
inst✝ : Field K
A : ValuationSubring K
src✝ : PrimeSpectrum ↥A ≃ { S // A ≤ S } := primeSpectrumEquiv A
a✝ b✝ : (PrimeSpectrum ↥A)ᵒᵈ
h : (primeSpectrumEquiv A) a✝ ≤ (primeSpectrumEquiv A) b✝
⊢ A ≤ ↑((primeSpectrumEquiv A) b✝)

Next tactic:
exact this