Skip to content

Commit 143ebf7

Browse files
committed
fixed something
1 parent dd111a5 commit 143ebf7

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

Mathlib/Algebra/GroupWithZero/Range.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,16 @@ def restrict₀ : A →*₀ valueGroup₀ f where
139139
all_goals rw [mul_eq_zero] at h; tauto
140140
map_zero' := by simp
141141

142+
@[simp]
142143
lemma restrict₀_of_ne_zero {a : A} (h : f a ≠ 0) :
143144
restrict₀ f a = (⟨Units.mk0 (f a) h, mem_valueGroup _ ⟨a, rfl⟩⟩ : valueGroup f) :=
144145
by simp [h]
145146

147+
@[simp]
146148
lemma restrict₀_of_eq_zero {a : A} (h : f a = 0) :
147149
restrict₀ f a = 0 := by simp [h]
148150

149-
lemma restrict₀_eq_zero_iff {a : A} : restrict₀ f a = 0 ↔ f a = 0 := by simp
150-
151+
@[simp]
151152
lemma restrict₀_eq (a : A) : valueGroup₀.embedding (restrict₀ f a) = f a := by
152153
simp [restrict₀_apply]
153154
split_ifs <;>

Mathlib/RingTheory/Valuation/Basic.lean

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,11 +468,20 @@ open MonoidWithZeroHom in
468468
@[simps] def ltAddSubgroup (v : Valuation R Γ₀) (γ : (valueGroup₀ v)ˣ) : AddSubgroup R where
469469
carrier := { x | v.restrict x < γ }
470470
zero_mem' := by simp
471-
add_mem' {x y} x_in y_in := sorry--lt_of_le_of_lt (v.map_add x y) (max_lt x_in y_in)
471+
add_mem' {x y} x_in y_in := by
472+
rcases (eq_zero_or_neZero (v x)).symm, (eq_zero_or_neZero (v y)).symm with ⟨hx₀ | _, hy₀ | _⟩
473+
· simp only [restrict_def, restrict₀_apply, Set.mem_setOf_eq]
474+
split_ifs with h
475+
· exact Units.zero_lt γ
476+
apply lt_of_le_of_lt _ (max_lt x_in y_in)
477+
simp only [restrict_def, restrict₀_of_ne_zero hx₀.ne, restrict₀_of_ne_zero hy₀.ne, le_sup_iff,
478+
WithZero.coe_le_coe]
479+
exact v.map_add' ..
480+
all_goals simp_all [v.map_add_of_left_eq_zero, v.map_add_of_right_eq_zero]
472481
neg_mem' x_in := by rwa [Set.mem_setOf, map_neg]
473482

474483
@[simp] lemma mem_ltAddSubgroup_iff {v : Valuation R Γ₀} {γ x} :
475-
x ∈ ltAddSubgroup v γ ↔ v x < γ :=
484+
x ∈ ltAddSubgroup v γ ↔ v.restrict x < γ :=
476485
Iff.rfl
477486

478487
end Group

0 commit comments

Comments
 (0)