l3lab/ntp-mathlib huggingface dataset:
/-- 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
        exact this
        

Proof state:
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:
all_goals exact le_ofPrime A (PrimeSpectrum.asIdeal _)
/-- 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
        exact this
        all_goals 

Proof state:
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✝)

Next tactic:
exact le_ofPrime A (PrimeSpectrum.asIdeal _)
/-- 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
        exact this
        all_goals 

Proof state:
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 le_ofPrime A (PrimeSpectrum.asIdeal _)
/-- 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
        exact this
        all_goals exact le_ofPrime A (PrimeSpectrum.asIdeal _),
      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 : a✝ ≤ b✝
⊢ { 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✝

Next tactic:
apply ofPrime_le_of_le
/-- 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
        exact this
        all_goals exact le_ofPrime A (PrimeSpectrum.asIdeal _),
      fun h => by apply ofPrime_le_of_le; 

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

Next tactic:
exact h
/-- The valuation subring associated to a valuation. -/
def valuationSubring : ValuationSubring K :=
  { v.integer with
    mem_or_inv_mem' := by
      

Proof state:
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
src✝ : Subring K := integer v
⊢ ∀ (x : K),
    x ∈
        { toSubsemiring := src✝.toSubsemiring,
                  neg_mem' :=
                    (_ :
                      ∀ {x : K},
                        x ∈ src✝.carrier → -x ∈ src✝.carrier) }.toSubsemiring.toSubmonoid.toSubsemigroup.carrier ∨
      x⁻¹ ∈
        { toSubsemiring := src✝.toSubsemiring,
                  neg_mem' :=
                    (_ :
                      ∀ {x : K},
                        x ∈ src✝.carrier → -x ∈ src✝.carrier) }.toSubsemiring.toSubmonoid.toSubsemigroup.carrier

Next tactic:
intro x
/-- The valuation subring associated to a valuation. -/
def valuationSubring : ValuationSubring K :=
  { v.integer with
    mem_or_inv_mem' := by
      intro x
      

Proof state:
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
src✝ : Subring K := integer v
x : K
⊢ x ∈
      { toSubsemiring := src✝.toSubsemiring,
                neg_mem' :=
                  (_ :
                    ∀ {x : K},
                      x ∈ src✝.carrier → -x ∈ src✝.carrier) }.toSubsemiring.toSubmonoid.toSubsemigroup.carrier ∨
    x⁻¹ ∈
      { toSubsemiring := src✝.toSubsemiring,
                neg_mem' :=
                  (_ :
                    ∀ {x : K}, x ∈ src✝.carrier → -x ∈ src✝.carrier) }.toSubsemiring.toSubmonoid.toSubsemigroup.carrier

Next tactic:
rcases le_or_lt (v x) 1 with h | h
/-- The valuation subring associated to a valuation. -/
def valuationSubring : ValuationSubring K :=
  { v.integer with
    mem_or_inv_mem' := by
      intro x
      rcases le_or_lt (v x) 1 with h | h
      · 

Proof state:
case inl
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
src✝ : Subring K := integer v
x : K
h : v x ≤ 1
⊢ x ∈
      { toSubsemiring := src✝.toSubsemiring,
                neg_mem' :=
                  (_ :
                    ∀ {x : K},
                      x ∈ src✝.carrier → -x ∈ src✝.carrier) }.toSubsemiring.toSubmonoid.toSubsemigroup.carrier ∨
    x⁻¹ ∈
      { toSubsemiring := src✝.toSubsemiring,
                neg_mem' :=
                  (_ :
                    ∀ {x : K}, x ∈ src✝.carrier → -x ∈ src✝.carrier) }.toSubsemiring.toSubmonoid.toSubsemigroup.carrier

Next tactic:
left
/-- The valuation subring associated to a valuation. -/
def valuationSubring : ValuationSubring K :=
  { v.integer with
    mem_or_inv_mem' := by
      intro x
      rcases le_or_lt (v x) 1 with h | h
      · left; 

Proof state:
case inl.h
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
src✝ : Subring K := integer v
x : K
h : v x ≤ 1
⊢ x ∈
    { toSubsemiring := src✝.toSubsemiring,
              neg_mem' :=
                (_ : ∀ {x : K}, x ∈ src✝.carrier → -x ∈ src✝.carrier) }.toSubsemiring.toSubmonoid.toSubsemigroup.carrier

Next tactic:
exact h
/-- The valuation subring associated to a valuation. -/
def valuationSubring : ValuationSubring K :=
  { v.integer with
    mem_or_inv_mem' := by
      intro x
      rcases le_or_lt (v x) 1 with h | h
      · left; exact h
      · 

Proof state:
case inr
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
src✝ : Subring K := integer v
x : K
h : 1 < v x
⊢ x ∈
      { toSubsemiring := src✝.toSubsemiring,
                neg_mem' :=
                  (_ :
                    ∀ {x : K},
                      x ∈ src✝.carrier → -x ∈ src✝.carrier) }.toSubsemiring.toSubmonoid.toSubsemigroup.carrier ∨
    x⁻¹ ∈
      { toSubsemiring := src✝.toSubsemiring,
                neg_mem' :=
                  (_ :
                    ∀ {x : K}, x ∈ src✝.carrier → -x ∈ src✝.carrier) }.toSubsemiring.toSubmonoid.toSubsemigroup.carrier

Next tactic:
right
/-- The valuation subring associated to a valuation. -/
def valuationSubring : ValuationSubring K :=
  { v.integer with
    mem_or_inv_mem' := by
      intro x
      rcases le_or_lt (v x) 1 with h | h
      · left; exact h
      · right; 

Proof state:
case inr.h
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
src✝ : Subring K := integer v
x : K
h : 1 < v x
⊢ x⁻¹ ∈
    { toSubsemiring := src✝.toSubsemiring,
              neg_mem' :=
                (_ : ∀ {x : K}, x ∈ src✝.carrier → -x ∈ src✝.carrier) }.toSubsemiring.toSubmonoid.toSubsemigroup.carrier

Next tactic:
change v x⁻¹ ≤ 1
/-- The valuation subring associated to a valuation. -/
def valuationSubring : ValuationSubring K :=
  { v.integer with
    mem_or_inv_mem' := by
      intro x
      rcases le_or_lt (v x) 1 with h | h
      · left; exact h
      · right; change v x⁻¹ ≤ 1
        

Proof state:
case inr.h
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
src✝ : Subring K := integer v
x : K
h : 1 < v x
⊢ v x⁻¹ ≤ 1

Next tactic:
rw [map_inv₀ v, ← inv_one, inv_le_inv₀]
/-- The valuation subring associated to a valuation. -/
def valuationSubring : ValuationSubring K :=
  { v.integer with
    mem_or_inv_mem' := by
      intro x
      rcases le_or_lt (v x) 1 with h | h
      · left; exact h
      · right; change v x⁻¹ ≤ 1
        rw [map_inv₀ v, ← inv_one, inv_le_inv₀]
        · 

Proof state:
case inr.h
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
src✝ : Subring K := integer v
x : K
h : 1 < v x
⊢ 1 ≤ v x

Next tactic:
exact le_of_lt h
/-- The valuation subring associated to a valuation. -/
def valuationSubring : ValuationSubring K :=
  { v.integer with
    mem_or_inv_mem' := by
      intro x
      rcases le_or_lt (v x) 1 with h | h
      · left; exact h
      · right; change v x⁻¹ ≤ 1
        rw [map_inv₀ v, ← inv_one, inv_le_inv₀]
        · exact le_of_lt h
        · 

Proof state:
case inr.h.ha
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
src✝ : Subring K := integer v
x : K
h : 1 < v x
⊢ v x ≠ 0

Next tactic:
intro c
/-- The valuation subring associated to a valuation. -/
def valuationSubring : ValuationSubring K :=
  { v.integer with
    mem_or_inv_mem' := by
      intro x
      rcases le_or_lt (v x) 1 with h | h
      · left; exact h
      · right; change v x⁻¹ ≤ 1
        rw [map_inv₀ v, ← inv_one, inv_le_inv₀]
        · exact le_of_lt h
        · intro c; 

Proof state:
case inr.h.ha
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
src✝ : Subring K := integer v
x : K
h : 1 < v x
c : v x = 0
⊢ False

Next tactic:
simp [c] at h
/-- The valuation subring associated to a valuation. -/
def valuationSubring : ValuationSubring K :=
  { v.integer with
    mem_or_inv_mem' := by
      intro x
      rcases le_or_lt (v x) 1 with h | h
      · left; exact h
      · right; change v x⁻¹ ≤ 1
        rw [map_inv₀ v, ← inv_one, inv_le_inv₀]
        · exact le_of_lt h
        · intro c; simp [c] at h
        · 

Proof state:
case inr.h.hb
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
src✝ : Subring K := integer v
x : K
h : 1 < v x
⊢ 1 ≠ 0

Next tactic:
exact one_ne_zero
theorem isEquiv_iff_valuationSubring :
    v₁.IsEquiv v₂ ↔ v₁.valuationSubring = v₂.valuationSubring := by
  

Proof state:
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
⊢ IsEquiv v₁ v₂ ↔ valuationSubring v₁ = valuationSubring v₂

Next tactic:
constructor
theorem isEquiv_iff_valuationSubring :
    v₁.IsEquiv v₂ ↔ v₁.valuationSubring = v₂.valuationSubring := by
  constructor
  · 

Proof state:
case mp
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
⊢ IsEquiv v₁ v₂ → valuationSubring v₁ = valuationSubring v₂

Next tactic:
intro h
theorem isEquiv_iff_valuationSubring :
    v₁.IsEquiv v₂ ↔ v₁.valuationSubring = v₂.valuationSubring := by
  constructor
  · intro h; 

Proof state:
case mp
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
h : IsEquiv v₁ v₂
⊢ valuationSubring v₁ = valuationSubring v₂

Next tactic:
ext x
theorem isEquiv_iff_valuationSubring :
    v₁.IsEquiv v₂ ↔ v₁.valuationSubring = v₂.valuationSubring := by
  constructor
  · intro h; ext x; 

Proof state:
case mp.h
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
h : IsEquiv v₁ v₂
x : K
⊢ x ∈ valuationSubring v₁ ↔ x ∈ valuationSubring v₂

Next tactic:
specialize h x 1
theorem isEquiv_iff_valuationSubring :
    v₁.IsEquiv v₂ ↔ v₁.valuationSubring = v₂.valuationSubring := by
  constructor
  · intro h; ext x; specialize h x 1; 

Proof state:
case mp.h
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
x : K
h : v₁ x ≤ v₁ 1 ↔ v₂ x ≤ v₂ 1
⊢ x ∈ valuationSubring v₁ ↔ x ∈ valuationSubring v₂

Next tactic:
simpa using h
theorem isEquiv_iff_valuationSubring :
    v₁.IsEquiv v₂ ↔ v₁.valuationSubring = v₂.valuationSubring := by
  constructor
  · intro h; ext x; specialize h x 1; simpa using h
  · 

Proof state:
case mpr
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
⊢ valuationSubring v₁ = valuationSubring v₂ → IsEquiv v₁ v₂

Next tactic:
intro h
theorem isEquiv_iff_valuationSubring :
    v₁.IsEquiv v₂ ↔ v₁.valuationSubring = v₂.valuationSubring := by
  constructor
  · intro h; ext x; specialize h x 1; simpa using h
  · intro h; 

Proof state:
case mpr
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
h : valuationSubring v₁ = valuationSubring v₂
⊢ IsEquiv v₁ v₂

Next tactic:
apply isEquiv_of_val_le_one
theorem isEquiv_iff_valuationSubring :
    v₁.IsEquiv v₂ ↔ v₁.valuationSubring = v₂.valuationSubring := by
  constructor
  · intro h; ext x; specialize h x 1; simpa using h
  · intro h; apply isEquiv_of_val_le_one
    

Proof state:
case mpr.h
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
h : valuationSubring v₁ = valuationSubring v₂
⊢ ∀ {x : K}, v₁ x ≤ 1 ↔ v₂ x ≤ 1

Next tactic:
intro x
theorem isEquiv_iff_valuationSubring :
    v₁.IsEquiv v₂ ↔ v₁.valuationSubring = v₂.valuationSubring := by
  constructor
  · intro h; ext x; specialize h x 1; simpa using h
  · intro h; apply isEquiv_of_val_le_one
    intro x
    

Proof state:
case mpr.h
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
h : valuationSubring v₁ = valuationSubring v₂
x : K
⊢ v₁ x ≤ 1 ↔ v₂ x ≤ 1

Next tactic:
have : x ∈ v₁.valuationSubring ↔ x ∈ v₂.valuationSubring := by rw [h]
theorem isEquiv_iff_valuationSubring :
    v₁.IsEquiv v₂ ↔ v₁.valuationSubring = v₂.valuationSubring := by
  constructor
  · intro h; ext x; specialize h x 1; simpa using h
  · intro h; apply isEquiv_of_val_le_one
    intro x
    have : x ∈ v₁.valuationSubring ↔ x ∈ v₂.valuationSubring := by 

Proof state:
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
h : valuationSubring v₁ = valuationSubring v₂
x : K
⊢ x ∈ valuationSubring v₁ ↔ x ∈ valuationSubring v₂

Next tactic:
rw [h]
theorem isEquiv_iff_valuationSubring :
    v₁.IsEquiv v₂ ↔ v₁.valuationSubring = v₂.valuationSubring := by
  constructor
  · intro h; ext x; specialize h x 1; simpa using h
  · intro h; apply isEquiv_of_val_le_one
    intro x
    have : x ∈ v₁.valuationSubring ↔ x ∈ v₂.valuationSubring := by rw [h]
    

Proof state:
case mpr.h
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
h : valuationSubring v₁ = valuationSubring v₂
x : K
this : x ∈ valuationSubring v₁ ↔ x ∈ valuationSubring v₂
⊢ v₁ x ≤ 1 ↔ v₂ x ≤ 1

Next tactic:
simpa using this
theorem isEquiv_valuation_valuationSubring : v.IsEquiv v.valuationSubring.valuation := by
  

Proof state:
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
⊢ IsEquiv v (ValuationSubring.valuation (valuationSubring v))

Next tactic:
rw [isEquiv_iff_val_le_one]
theorem isEquiv_valuation_valuationSubring : v.IsEquiv v.valuationSubring.valuation := by
  rw [isEquiv_iff_val_le_one]
  

Proof state:
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
⊢ ∀ {x : K}, v x ≤ 1 ↔ (ValuationSubring.valuation (valuationSubring v)) x ≤ 1

Next tactic:
intro x
theorem isEquiv_valuation_valuationSubring : v.IsEquiv v.valuationSubring.valuation := by
  rw [isEquiv_iff_val_le_one]
  intro x
  

Proof state:
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
x : K
⊢ v x ≤ 1 ↔ (ValuationSubring.valuation (valuationSubring v)) x ≤ 1

Next tactic:
rw [ValuationSubring.valuation_le_one_iff]
theorem isEquiv_valuation_valuationSubring : v.IsEquiv v.valuationSubring.valuation := by
  rw [isEquiv_iff_val_le_one]
  intro x
  rw [ValuationSubring.valuation_le_one_iff]
  

Proof state:
K : Type u
inst✝³ : Field K
Γ : Type u_1
Γ₁ : Type u_2
Γ₂ : Type u_3
inst✝² : LinearOrderedCommGroupWithZero Γ
inst✝¹ : LinearOrderedCommGroupWithZero Γ₁
inst✝ : LinearOrderedCommGroupWithZero Γ₂
v : Valuation K Γ
v₁ : Valuation K Γ₁
v₂ : Valuation K Γ₂
x : K
⊢ v x ≤ 1 ↔ x ∈ valuationSubring v

Next tactic:
rfl
@[simp]
theorem valuationSubring_valuation : A.valuation.valuationSubring = A := by
  

Proof state:
K : Type u
inst✝ : Field K
A : ValuationSubring K
⊢ Valuation.valuationSubring (valuation A) = A

Next tactic:
ext
@[simp]
theorem valuationSubring_valuation : A.valuation.valuationSubring = A := by
  ext; 

Proof state:
case h
K : Type u
inst✝ : Field K
A : ValuationSubring K
x✝ : K
⊢ x✝ ∈ Valuation.valuationSubring (valuation A) ↔ x✝ ∈ A

Next tactic:
rw [← A.valuation_le_one_iff]
@[simp]
theorem valuationSubring_valuation : A.valuation.valuationSubring = A := by
  ext; rw [← A.valuation_le_one_iff]; 

Proof state:
case h
K : Type u
inst✝ : Field K
A : ValuationSubring K
x✝ : K
⊢ x✝ ∈ Valuation.valuationSubring (valuation A) ↔ (valuation A) x✝ ≤ 1

Next tactic:
rfl
/-- For a valuation subring `A`, `A.unitGroup` agrees with the units of `A`. -/
def unitGroupMulEquiv : A.unitGroup ≃* Aˣ where
  toFun x :=
    { val := ⟨(x : Kˣ), mem_of_valuation_le_one A _ x.prop.le⟩
      inv := ⟨((x⁻¹ : A.unitGroup) : Kˣ), mem_of_valuation_le_one _ _ x⁻¹.prop.le⟩
      -- Porting note: was `Units.mul_inv x`
      val_inv := Subtype.ext (by 

Proof state:
K : Type u
inst✝ : Field K
A : ValuationSubring K
x : ↥(unitGroup A)
⊢ ↑({ val := ↑↑x, property := (_ : ↑↑x ∈ A) } * { val := ↑↑x⁻¹, property := (_ : ↑↑x⁻¹ ∈ A) }) = ↑1

Next tactic:
simp
/-- For a valuation subring `A`, `A.unitGroup` agrees with the units of `A`. -/
def unitGroupMulEquiv : A.unitGroup ≃* Aˣ where
  toFun x :=
    { val := ⟨(x : Kˣ), mem_of_valuation_le_one A _ x.prop.le⟩
      inv := ⟨((x⁻¹ : A.unitGroup) : Kˣ), mem_of_valuation_le_one _ _ x⁻¹.prop.le⟩
      -- Porting note: was `Units.mul_inv x`
      val_inv := Subtype.ext (by simp)
      -- Porting note: was `Units.inv_mul x`
      inv_val := Subtype.ext (by 

Proof state:
K : Type u
inst✝ : Field K
A : ValuationSubring K
x : ↥(unitGroup A)
⊢ ↑({ val := ↑↑x⁻¹, property := (_ : ↑↑x⁻¹ ∈ A) } * { val := ↑↑x, property := (_ : ↑↑x ∈ A) }) = ↑1

Next tactic:
simp