Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit b0b0a24

Browse files
committed
feat(data/int): absolute values and integers (#9028)
We prove that an absolute value maps all `units ℤ` to `1`. I added a new file since there is no neat place in the import hierarchy where this fit (the meet of `algebra.algebra.basic` and `data.int.cast`).
1 parent fd453cf commit b0b0a24

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

src/data/int/absolute_value.lean

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/-
2+
Copyright (c) 2021 Anne Baanen. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Anne Baanen
5+
-/
6+
import algebra.absolute_value
7+
import algebra.algebra.basic
8+
import data.int.cast
9+
import group_theory.group_action.units
10+
11+
/-!
12+
# Absolute values and the integers
13+
14+
This file contains some results on absolute values applied to integers.
15+
16+
## Main results
17+
18+
* `absolute_value.map_units_int`: an absolute value sends all units of `ℤ` to `1`
19+
-/
20+
21+
variables {R S : Type*} [ring R] [linear_ordered_comm_ring S]
22+
23+
@[simp]
24+
lemma absolute_value.map_units_int (abv : absolute_value ℤ S) (x : units ℤ) :
25+
abv x = 1 :=
26+
by rcases int.units_eq_one_or x with (rfl | rfl); simp
27+
28+
@[simp]
29+
lemma absolute_value.map_units_int_cast [nontrivial R] (abv : absolute_value R S) (x : units ℤ) :
30+
abv ((x : ℤ) : R) = 1 :=
31+
by rcases int.units_eq_one_or x with (rfl | rfl); simp
32+
33+
@[simp]
34+
lemma absolute_value.map_units_int_smul (abv : absolute_value R S) (x : units ℤ) (y : R) :
35+
abv (x • y) = abv y :=
36+
by rcases int.units_eq_one_or x with (rfl | rfl); simp

0 commit comments

Comments
 (0)