|
1 | 1 | /- |
2 | 2 | Copyright (c) 2020 Johan Commelin. All rights reserved. |
3 | 3 | Released under Apache 2.0 license as described in the file LICENSE. |
4 | | -Authors: Kevin Buzzard, Johan Commelin, Patrick Massot |
| 4 | +Authors: Kevin Buzzard, Johan Commelin, Patrick Massot, Filippo A. E. Nuccio |
5 | 5 | -/ |
6 | 6 | module |
7 | 7 |
|
8 | | -public import Mathlib.Algebra.GroupWithZero.Range |
| 8 | +public import Mathlib.Algebra.Order.GroupWithZero.Range |
9 | 9 | public import Mathlib.Algebra.Order.Hom.Monoid |
10 | 10 | public import Mathlib.Algebra.Order.Ring.Basic |
11 | 11 | public import Mathlib.Algebra.Ring.Torsion |
@@ -453,6 +453,108 @@ lemma mem_leAddSubgroup_iff {v : Valuation R Γ₀} {γ : Γ₀} {x : R} : |
453 | 453 | lemma leAddSubgroup_monotone (v : Valuation R Γ₀) : Monotone v.leAddSubgroup := |
454 | 454 | fun _ _ h _ ↦ h.trans' |
455 | 455 |
|
| 456 | +open MonoidWithZeroHom MonoidWithZeroHom.ValueGroup₀ |
| 457 | + |
| 458 | +set_option backward.isDefEq.respectTransparency false in |
| 459 | +/-- The restriction of a valuation so that it takes values in its `valueGroup₀`. -/ |
| 460 | +def restrict : Valuation R (MonoidWithZeroHom.ValueGroup₀ (v : R →*₀ Γ₀)) where |
| 461 | + __ := restrict₀ v |
| 462 | + map_add_le_max' x y := by |
| 463 | + by_cases H : v x ≠ 0 ∨ v y ≠ 0 |
| 464 | + · rcases H with h | h <;> |
| 465 | + simp only [ZeroHom.toFun_eq_coe, toZeroHom_coe, restrict₀_apply, h, ↓reduceDIte] <;> |
| 466 | + · split_ifs with H _ hy |
| 467 | + all_goals simp [← Units.val_le_val] |
| 468 | + simpa using map_add_le _ (by simp_all) (by simp_all) |
| 469 | + · simp only [ne_eq, not_or, Decidable.not_not] at H |
| 470 | + simp only [ZeroHom.toFun_eq_coe, toZeroHom_coe, restrict₀_apply, H, ↓reduceDIte, max_self, |
| 471 | + le_zero_iff, dite_eq_left_iff, WithZero.coe_ne_zero, imp_false, Decidable.not_not] |
| 472 | + simpa using map_add_le _ (le_of_eq H.1) (le_of_eq H.2) |
| 473 | + |
| 474 | +lemma restrict_def (x : R) : v.restrict x = restrict₀ v x := rfl |
| 475 | + |
| 476 | +set_option backward.isDefEq.respectTransparency false in |
| 477 | +@[simp] |
| 478 | +lemma restrict_pos_iff (x : R) : 0 < v.restrict x ↔ 0 < v x := by |
| 479 | + simp only [restrict_def, restrict₀_apply] |
| 480 | + split_ifs with h <;> |
| 481 | + simp_all [zero_lt_iff.mpr] |
| 482 | + |
| 483 | +set_option backward.isDefEq.respectTransparency false in |
| 484 | +@[simp] |
| 485 | +lemma restrict_lt_iff {x y : R} : v.restrict x < v.restrict y ↔ v x < v y := by |
| 486 | + simp only [restrict_def, restrict₀_apply] |
| 487 | + split_ifs with hx hy <;> simp_all [zero_lt_iff.mpr, ← Units.val_lt_val] |
| 488 | + |
| 489 | +set_option backward.isDefEq.respectTransparency false in |
| 490 | +lemma restrict_lt_iff_lt_embedding {x : R} {g : ValueGroup₀ v} : |
| 491 | + v.restrict x < g ↔ v x < embedding g := by |
| 492 | + conv_rhs => rw [← ValueGroup₀.embedding_restrict₀ x] |
| 493 | + rw [embedding_strictMono.lt_iff_lt, restrict_def] |
| 494 | + |
| 495 | +set_option backward.isDefEq.respectTransparency false in |
| 496 | +lemma restrict_le_iff_le_embedding {x : R} {g : ValueGroup₀ v} : |
| 497 | + v.restrict x ≤ g ↔ v x ≤ embedding g := by |
| 498 | + conv_rhs => rw [← ValueGroup₀.embedding_restrict₀ x] |
| 499 | + rw [embedding_strictMono.le_iff_le, restrict_def] |
| 500 | + |
| 501 | +set_option backward.isDefEq.respectTransparency false in |
| 502 | +@[simp] |
| 503 | +lemma restrict_lt_one_iff {x : R} : v.restrict x < 1 ↔ v x < 1 := by |
| 504 | + rw [restrict_lt_iff_lt_embedding, map_one] |
| 505 | + |
| 506 | +set_option backward.isDefEq.respectTransparency false in |
| 507 | +@[simp] |
| 508 | +lemma restrict_le_one_iff {x : R} : v.restrict x ≤ 1 ↔ v x ≤ 1 := by |
| 509 | + rw [restrict_le_iff_le_embedding, map_one] |
| 510 | + |
| 511 | +set_option backward.isDefEq.respectTransparency false in |
| 512 | +@[simp] |
| 513 | +lemma restrict_eq_zero_iff {x : R} : v.restrict x = 0 ↔ v x = 0 := by |
| 514 | + rw [restrict_def,restrict₀_eq_zero_iff] |
| 515 | + |
| 516 | +set_option backward.isDefEq.respectTransparency false in |
| 517 | +@[simp] |
| 518 | +lemma restrict_eq_one_iff {x : R} : v.restrict x = 1 ↔ v x = 1 := by |
| 519 | + rw [restrict_def,restrict₀_eq_one_iff] |
| 520 | + |
| 521 | +set_option backward.isDefEq.respectTransparency false in |
| 522 | +@[simp] |
| 523 | +lemma restrict_le_iff {x y : R} : v.restrict x ≤ v.restrict y ↔ v x ≤ v y := by |
| 524 | + simp only [restrict_def, restrict₀_apply] |
| 525 | + split_ifs with hx hy <;> simp_all [← Units.val_le_val] |
| 526 | + |
| 527 | +set_option backward.isDefEq.respectTransparency false in |
| 528 | +@[simp] |
| 529 | +lemma restrict_inj {x y : R} : v.restrict x = v.restrict y ↔ v x = v y := by |
| 530 | + simp only [restrict_def, restrict₀_apply] |
| 531 | + aesop |
| 532 | + |
| 533 | +@[simp] |
| 534 | +lemma embedding_restrict (x : R) : ValueGroup₀.embedding (v.restrict x) = v x := |
| 535 | + embedding_restrict₀ x |
| 536 | + |
| 537 | +set_option backward.isDefEq.respectTransparency false in |
| 538 | +lemma exists_div_eq_of_unit (γ : (ValueGroup₀ v)ˣ) : |
| 539 | + ∃ r s, 0 < v r ∧ 0 < v s ∧ v.restrict r / v.restrict s = γ.1 := by |
| 540 | + set u := WithZero.unzero (Units.ne_zero γ) with hu_def |
| 541 | + obtain ⟨a, ⟨ha, x, hax⟩⟩ := (mem_valueGroup_iff_of_comm _).mp u.2 |
| 542 | + have hx : 0 < v x := by |
| 543 | + rw [← restrict_pos_iff, restrict_def, WithZero.pos_iff_ne_zero, ne_eq, restrict₀_eq_zero_iff] |
| 544 | + aesop |
| 545 | + use x, a, hx, zero_lt_iff.mpr ha |
| 546 | + have ha0 : v.restrict a ≠ 0 := by simp [ha] |
| 547 | + rw [div_eq_iff ha0, mul_comm, ← embedding_strictMono.injective.eq_iff, map_mul, |
| 548 | + embedding_restrict, embedding_restrict, ← hax] |
| 549 | + congr |
| 550 | + rw [← WithZero.coe_unzero (Units.ne_zero γ)] |
| 551 | + exact Eq.refl .. |
| 552 | + |
| 553 | +lemma IsEquiv.restrict {Γ₀' : Type*} [LinearOrderedCommGroupWithZero Γ₀'] |
| 554 | + {w : Valuation R Γ₀'} (h : v.IsEquiv w) : v.restrict.IsEquiv w.restrict := by |
| 555 | + simp only [IsEquiv] at h ⊢ |
| 556 | + simp [restrict_le_iff, h] |
| 557 | + |
456 | 558 | /-- The subgroup of elements whose valuation is less than a certain unit. -/ |
457 | 559 | @[simps] def ltAddSubgroup (v : Valuation R Γ₀) (γ : Γ₀ˣ) : AddSubgroup R where |
458 | 560 | carrier := { x | v x < γ } |
|
0 commit comments