statement
stringlengths
1
2.88k
proof
stringlengths
0
13.9k
type
stringclasses
10 values
symbolic_name
stringlengths
1
131
library
stringclasses
417 values
filename
stringlengths
17
80
imports
listlengths
0
16
deps
listlengths
0
64
docstring
stringlengths
0
10.2k
source_url
stringclasses
1 value
commit
stringclasses
1 value
to_lex_rat_cast [has_rat_cast α] (n : ℚ) : to_lex (n : α) = n
rfl
lemma
to_lex_rat_cast
algebra.field
src/algebra/field/basic.lean
[ "algebra.field.defs", "algebra.group_with_zero.units.lemmas", "algebra.hom.ring", "algebra.ring.commute" ]
[ "has_rat_cast", "to_lex" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
of_lex_rat_cast [has_rat_cast α] (n : ℚ) : (of_lex n : α) = n
rfl
lemma
of_lex_rat_cast
algebra.field
src/algebra/field/basic.lean
[ "algebra.field.defs", "algebra.group_with_zero.units.lemmas", "algebra.hom.ring", "algebra.ring.commute" ]
[ "has_rat_cast", "of_lex" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
rat.cast_rec [has_lift_t ℕ K] [has_lift_t ℤ K] [has_mul K] [has_inv K] : ℚ → K
| ⟨a, b, _, _⟩ := ↑a * (↑b)⁻¹
def
rat.cast_rec
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[]
The default definition of the coercion `(↑(a : ℚ) : K)` for a division ring `K` is defined as `(a / b : K) = (a : K) * (b : K)⁻¹`. Use `coe` instead of `rat.cast_rec` for better definitional behaviour.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
has_rat_cast (K : Type u)
(rat_cast : ℚ → K)
class
has_rat_cast
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[]
Type class for the canonical homomorphism `ℚ → K`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
qsmul_rec (coe : ℚ → K) [has_mul K] (a : ℚ) (x : K) : K
coe a * x
def
qsmul_rec
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[]
The default definition of the scalar multiplication `(a : ℚ) • (x : K)` for a division ring `K` is given by `a • x = (↑ a) * x`. Use `(a : ℚ) • (x : K)` instead of `qsmul_rec` for better definitional behaviour.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
division_semiring (α : Type*) extends semiring α, group_with_zero α
class
division_semiring
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[ "group_with_zero", "semiring" ]
A `division_semiring` is a `semiring` with multiplicative inverses for nonzero elements.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
division_ring (K : Type u) extends ring K, div_inv_monoid K, nontrivial K, has_rat_cast K
(mul_inv_cancel : ∀ {a : K}, a ≠ 0 → a * a⁻¹ = 1) (inv_zero : (0 : K)⁻¹ = 0) (rat_cast := rat.cast_rec) (rat_cast_mk : ∀ (a : ℤ) (b : ℕ) h1 h2, rat_cast ⟨a, b, h1, h2⟩ = a * b⁻¹ . try_refl_tac) (qsmul : ℚ → K → K := qsmul_rec rat_cast) (qsmul_eq_mul' : ∀ (a : ℚ) (x : K), qsmul a x = rat_cast a * x . try_refl_tac)
class
division_ring
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[ "div_inv_monoid", "has_rat_cast", "inv_zero", "mul_inv_cancel", "nontrivial", "qsmul_rec", "rat.cast_rec", "ring", "try_refl_tac" ]
A `division_ring` is a `ring` with multiplicative inverses for nonzero elements. An instance of `division_ring K` includes maps `rat_cast : ℚ → K` and `qsmul : ℚ → K → K`. If the division ring has positive characteristic p, we define `rat_cast (1 / p) = 1 / 0 = 0` for consistency with our division by zero convention. ...
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
division_ring.to_division_semiring [division_ring α] : division_semiring α
{ ..‹division_ring α›, ..(infer_instance : semiring α) }
instance
division_ring.to_division_semiring
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[ "division_ring", "division_semiring", "semiring" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
semifield (α : Type*) extends comm_semiring α, division_semiring α, comm_group_with_zero α
class
semifield
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[ "comm_group_with_zero", "comm_semiring", "division_semiring" ]
A `semifield` is a `comm_semiring` with multiplicative inverses for nonzero elements.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
field (K : Type u) extends comm_ring K, division_ring K
class
field
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[ "comm_ring", "division_ring" ]
A `field` is a `comm_ring` with multiplicative inverses for nonzero elements. An instance of `field K` includes maps `of_rat : ℚ → K` and `qsmul : ℚ → K → K`. If the field has positive characteristic p, we define `of_rat (1 / p) = 1 / 0 = 0` for consistency with our division by zero convention. The fields `of_rat` and...
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
cast_coe {K : Type*} [has_rat_cast K] : has_coe_t ℚ K
⟨has_rat_cast.rat_cast⟩
instance
rat.cast_coe
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[ "has_rat_cast" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
cast_mk' (a b h1 h2) : ((⟨a, b, h1, h2⟩ : ℚ) : K) = a * b⁻¹
division_ring.rat_cast_mk _ _ _ _
theorem
rat.cast_mk'
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
cast_def : ∀ (r : ℚ), (r : K) = r.num / r.denom
| ⟨a, b, h1, h2⟩ := (cast_mk' _ _ _ _).trans (div_eq_mul_inv _ _).symm
theorem
rat.cast_def
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[ "div_eq_mul_inv" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
smul_division_ring : has_smul ℚ K
⟨division_ring.qsmul⟩
instance
rat.smul_division_ring
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[ "has_smul" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
smul_def (a : ℚ) (x : K) : a • x = ↑a * x
division_ring.qsmul_eq_mul' a x
lemma
rat.smul_def
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
smul_one_eq_coe (A : Type*) [division_ring A] (m : ℚ) : m • (1 : A) = ↑m
by rw [rat.smul_def, mul_one]
lemma
rat.smul_one_eq_coe
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[ "division_ring", "mul_one", "rat.smul_def" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
field.to_semifield : semifield K
{ .. ‹field K›, .. (infer_instance : semiring K) }
instance
field.to_semifield
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[ "semifield", "semiring" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
is_field (R : Type u) [semiring R] : Prop
(exists_pair_ne : ∃ (x y : R), x ≠ y) (mul_comm : ∀ (x y : R), x * y = y * x) (mul_inv_cancel : ∀ {a : R}, a ≠ 0 → ∃ b, a * b = 1)
structure
is_field
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[ "exists_pair_ne", "mul_comm", "mul_inv_cancel", "semiring" ]
A predicate to express that a (semi)ring is a (semi)field. This is mainly useful because such a predicate does not contain data, and can therefore be easily transported along ring isomorphisms. Additionaly, this is useful when trying to prove that a particular ring structure extends to a (semi)field.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
semifield.to_is_field (R : Type u) [semifield R] : is_field R
{ mul_inv_cancel := λ a ha, ⟨a⁻¹, mul_inv_cancel ha⟩, ..‹semifield R› }
lemma
semifield.to_is_field
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[ "is_field", "mul_inv_cancel", "semifield" ]
Transferring from `semifield` to `is_field`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
field.to_is_field (R : Type u) [field R] : is_field R
semifield.to_is_field _
lemma
field.to_is_field
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[ "field", "is_field", "semifield.to_is_field" ]
Transferring from `field` to `is_field`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
is_field.nontrivial {R : Type u} [semiring R] (h : is_field R) : nontrivial R
⟨h.exists_pair_ne⟩
lemma
is_field.nontrivial
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[ "is_field", "nontrivial", "semiring" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
not_is_field_of_subsingleton (R : Type u) [semiring R] [subsingleton R] : ¬is_field R
λ h, let ⟨x, y, h⟩ := h.exists_pair_ne in h (subsingleton.elim _ _)
lemma
not_is_field_of_subsingleton
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[ "is_field", "semiring" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
is_field.to_semifield {R : Type u} [semiring R] (h : is_field R) : semifield R
{ inv := λ a, if ha : a = 0 then 0 else classical.some (is_field.mul_inv_cancel h ha), inv_zero := dif_pos rfl, mul_inv_cancel := λ a ha, begin convert classical.some_spec (is_field.mul_inv_cancel h ha), exact dif_neg ha end, .. ‹semiring R›, ..h }
def
is_field.to_semifield
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[ "inv_zero", "is_field", "mul_inv_cancel", "semifield", "semiring" ]
Transferring from `is_field` to `semifield`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
is_field.to_field {R : Type u} [ring R] (h : is_field R) : field R
{ .. ‹ring R›, ..is_field.to_semifield h }
def
is_field.to_field
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[ "field", "is_field", "is_field.to_semifield", "ring" ]
Transferring from `is_field` to `field`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
uniq_inv_of_is_field (R : Type u) [ring R] (hf : is_field R) : ∀ (x : R), x ≠ 0 → ∃! (y : R), x * y = 1
begin intros x hx, apply exists_unique_of_exists_of_unique, { exact hf.mul_inv_cancel hx }, { intros y z hxy hxz, calc y = y * (x * z) : by rw [hxz, mul_one] ... = (x * y) * z : by rw [← mul_assoc, hf.mul_comm y x] ... = z : by rw [hxy, one_mul] } end
lemma
uniq_inv_of_is_field
algebra.field
src/algebra/field/defs.lean
[ "data.rat.init", "algebra.ring.defs" ]
[ "is_field", "mul_assoc", "mul_one", "one_mul", "ring" ]
For each field, and for each nonzero element of said field, there is a unique inverse. Since `is_field` doesn't remember the data of an `inv` function and as such, a lemma that there is a unique inverse could be useful.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
op_rat_cast [has_rat_cast α] (q : ℚ) : op (q : α) = q
rfl
lemma
mul_opposite.op_rat_cast
algebra.field
src/algebra/field/opposite.lean
[ "algebra.field.defs", "algebra.ring.opposite", "data.int.cast.lemmas" ]
[ "has_rat_cast" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
unop_rat_cast [has_rat_cast α] (q : ℚ) : unop (q : αᵐᵒᵖ) = q
rfl
lemma
mul_opposite.unop_rat_cast
algebra.field
src/algebra/field/opposite.lean
[ "algebra.field.defs", "algebra.ring.opposite", "data.int.cast.lemmas" ]
[ "has_rat_cast" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
zpow_bit1_neg (a : α) (n : ℤ) : (-a) ^ bit1 n = - a ^ bit1 n
by rw [zpow_bit1', zpow_bit1', neg_mul_neg, neg_mul_eq_mul_neg]
lemma
zpow_bit1_neg
algebra.field
src/algebra/field/power.lean
[ "algebra.field.defs", "algebra.group_with_zero.power", "algebra.parity" ]
[ "neg_mul_eq_mul_neg", "neg_mul_neg", "zpow_bit1'" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
odd.neg_zpow (h : odd n) (a : α) : (-a) ^ n = - a ^ n
by { obtain ⟨k, rfl⟩ := h.exists_bit1, exact zpow_bit1_neg _ _ }
lemma
odd.neg_zpow
algebra.field
src/algebra/field/power.lean
[ "algebra.field.defs", "algebra.group_with_zero.power", "algebra.parity" ]
[ "odd", "zpow_bit1_neg" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
odd.neg_one_zpow (h : odd n) : (-1 : α) ^ n = -1
by rw [h.neg_zpow, one_zpow]
lemma
odd.neg_one_zpow
algebra.field
src/algebra/field/power.lean
[ "algebra.field.defs", "algebra.group_with_zero.power", "algebra.parity" ]
[ "odd", "one_zpow" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
up_rat_cast [has_rat_cast α] (q : ℚ) : up (q : α) = q
rfl
lemma
ulift.up_rat_cast
algebra.field
src/algebra/field/ulift.lean
[ "algebra.field.basic", "algebra.ring.ulift" ]
[ "has_rat_cast" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
down_rat_cast [has_rat_cast α] (q : ℚ) : down (q : ulift α) = q
rfl
lemma
ulift.down_rat_cast
algebra.field
src/algebra/field/ulift.lean
[ "algebra.field.basic", "algebra.ring.ulift" ]
[ "has_rat_cast" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
division_semiring [division_semiring α] : division_semiring (ulift α)
by refine down_injective.division_semiring down _ _ _ _ _ _ _ _ _ _; intros; refl
instance
ulift.division_semiring
algebra.field
src/algebra/field/ulift.lean
[ "algebra.field.basic", "algebra.ring.ulift" ]
[ "division_semiring" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
semifield [semifield α] : semifield (ulift α)
{ ..ulift.division_semiring, ..ulift.comm_group_with_zero }
instance
ulift.semifield
algebra.field
src/algebra/field/ulift.lean
[ "algebra.field.basic", "algebra.ring.ulift" ]
[ "semifield", "ulift.comm_group_with_zero", "ulift.division_semiring" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
division_ring [division_ring α] : division_ring (ulift α)
{ ..ulift.division_semiring, ..ulift.add_group }
instance
ulift.division_ring
algebra.field
src/algebra/field/ulift.lean
[ "algebra.field.basic", "algebra.ring.ulift" ]
[ "division_ring", "ulift.division_semiring" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
field [field α] : field (ulift α)
{ ..ulift.semifield, ..ulift.division_ring }
instance
ulift.field
algebra.field
src/algebra/field/ulift.lean
[ "algebra.field.basic", "algebra.ring.ulift" ]
[ "field", "ulift.division_ring", "ulift.semifield" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
free_monoid (α)
list α
def
free_monoid
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[]
Free monoid over a given alphabet.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
to_list : free_monoid α ≃ list α
equiv.refl _
def
free_monoid.to_list
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "equiv.refl", "free_monoid" ]
The identity equivalence between `free_monoid α` and `list α`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
of_list : list α ≃ free_monoid α
equiv.refl _
def
free_monoid.of_list
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "equiv.refl", "free_monoid" ]
The identity equivalence between `list α` and `free_monoid α`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
to_list_symm : (@to_list α).symm = of_list
rfl
lemma
free_monoid.to_list_symm
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
of_list_symm : (@of_list α).symm = to_list
rfl
lemma
free_monoid.of_list_symm
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
to_list_of_list (l : list α) : to_list (of_list l) = l
rfl
lemma
free_monoid.to_list_of_list
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "to_list_of_list" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
of_list_to_list (xs : free_monoid α) : of_list (to_list xs) = xs
rfl
lemma
free_monoid.of_list_to_list
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
to_list_comp_of_list : @to_list α ∘ of_list = id
rfl
lemma
free_monoid.to_list_comp_of_list
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
of_list_comp_to_list : @of_list α ∘ to_list = id
rfl
lemma
free_monoid.of_list_comp_to_list
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
to_list_one : (1 : free_monoid α).to_list = []
rfl
lemma
free_monoid.to_list_one
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
of_list_nil : of_list ([] : list α) = 1
rfl
lemma
free_monoid.of_list_nil
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "of_list_nil" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
to_list_mul (xs ys : free_monoid α) : (xs * ys).to_list = xs.to_list ++ ys.to_list
rfl
lemma
free_monoid.to_list_mul
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
of_list_append (xs ys : list α) : of_list (xs ++ ys) = of_list xs * of_list ys
rfl
lemma
free_monoid.of_list_append
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "of_list_append" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
to_list_prod (xs : list (free_monoid α)) : to_list xs.prod = (xs.map to_list).join
by induction xs; simp [*, list.join]
lemma
free_monoid.to_list_prod
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
of_list_join (xs : list (list α)) : of_list xs.join = (xs.map of_list).prod
to_list.injective $ by simp
lemma
free_monoid.of_list_join
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
of (x : α) : free_monoid α
of_list [x]
def
free_monoid.of
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid" ]
Embeds an element of `α` into `free_monoid α` as a singleton list.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
to_list_of (x : α) : to_list (of x) = [x]
rfl
lemma
free_monoid.to_list_of
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
of_list_singleton (x : α) : of_list [x] = of x
rfl
lemma
free_monoid.of_list_singleton
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
of_list_cons (x : α) (xs : list α) : of_list (x :: xs) = of x * of_list xs
rfl
lemma
free_monoid.of_list_cons
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "of_list_cons" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
to_list_of_mul (x : α) (xs : free_monoid α) : to_list (of x * xs) = x :: xs.to_list
rfl
lemma
free_monoid.to_list_of_mul
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
of_injective : function.injective (@of α)
list.singleton_injective
lemma
free_monoid.of_injective
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "list.singleton_injective" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
rec_on {C : free_monoid α → Sort*} (xs : free_monoid α) (h0 : C 1) (ih : Π x xs, C xs → C (of x * xs)) : C xs
list.rec_on xs h0 ih
def
free_monoid.rec_on
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid", "ih" ]
Recursor for `free_monoid` using `1` and `free_monoid.of x * xs` instead of `[]` and `x :: xs`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
rec_on_one {C : free_monoid α → Sort*} (h0 : C 1) (ih : Π x xs, C xs → C (of x * xs)) : @rec_on α C 1 h0 ih = h0
rfl
lemma
free_monoid.rec_on_one
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid", "ih" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
rec_on_of_mul {C : free_monoid α → Sort*} (x : α) (xs : free_monoid α) (h0 : C 1) (ih : Π x xs, C xs → C (of x * xs)) : @rec_on α C (of x * xs) h0 ih = ih x xs (rec_on xs h0 ih)
rfl
lemma
free_monoid.rec_on_of_mul
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid", "ih" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
cases_on {C : free_monoid α → Sort*} (xs : free_monoid α) (h0 : C 1) (ih : Π x xs, C (of x * xs)) : C xs
list.cases_on xs h0 ih
def
free_monoid.cases_on
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid", "ih" ]
A version of `list.cases_on` for `free_monoid` using `1` and `free_monoid.of x * xs` instead of `[]` and `x :: xs`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
cases_on_one {C : free_monoid α → Sort*} (h0 : C 1) (ih : Π x xs, C (of x * xs)) : @cases_on α C 1 h0 ih = h0
rfl
lemma
free_monoid.cases_on_one
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid", "ih" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
cases_on_of_mul {C : free_monoid α → Sort*} (x : α) (xs : free_monoid α) (h0 : C 1) (ih : Π x xs, C (of x * xs)) : @cases_on α C (of x * xs) h0 ih = ih x xs
rfl
lemma
free_monoid.cases_on_of_mul
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid", "ih" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
hom_eq ⦃f g : free_monoid α →* M⦄ (h : ∀ x, f (of x) = g (of x)) : f = g
monoid_hom.ext $ λ l, rec_on l (f.map_one.trans g.map_one.symm) $ λ x xs hxs, by simp only [h, hxs, monoid_hom.map_mul]
lemma
free_monoid.hom_eq
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid", "monoid_hom.ext", "monoid_hom.map_mul" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_aux {M} [monoid M] (l : list M) : M
l.rec_on 1 (λ x xs (_ : M), list.foldl (*) x xs)
def
free_monoid.prod_aux
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "monoid" ]
A variant of `list.prod` that has `[x].prod = x` true definitionally. The purpose is to make `free_monoid.lift_eval_of` true by `rfl`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
prod_aux_eq : ∀ l : list M, free_monoid.prod_aux l = l.prod
| [] := rfl | (x :: xs) := congr_arg (λ x, list.foldl (*) x xs) (one_mul _).symm
lemma
free_monoid.prod_aux_eq
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid.prod_aux", "one_mul" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lift : (α → M) ≃ (free_monoid α →* M)
{ to_fun := λ f, ⟨λ l, free_monoid.prod_aux (l.to_list.map f), rfl, λ l₁ l₂, by simp only [prod_aux_eq, to_list_mul, list.map_append, list.prod_append]⟩, inv_fun := λ f x, f (of x), left_inv := λ f, rfl, right_inv := λ f, hom_eq $ λ x, rfl }
def
free_monoid.lift
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid", "free_monoid.prod_aux", "inv_fun", "lift", "list.prod_append" ]
Equivalence between maps `α → M` and monoid homomorphisms `free_monoid α →* M`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lift_symm_apply (f : free_monoid α →* M) : lift.symm f = f ∘ of
rfl
lemma
free_monoid.lift_symm_apply
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lift_apply (f : α → M) (l : free_monoid α) : lift f l = (l.to_list.map f).prod
prod_aux_eq _
lemma
free_monoid.lift_apply
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid", "lift" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lift_comp_of (f : α → M) : lift f ∘ of = f
rfl
lemma
free_monoid.lift_comp_of
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "lift" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lift_eval_of (f : α → M) (x : α) : lift f (of x) = f x
rfl
lemma
free_monoid.lift_eval_of
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "lift" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lift_restrict (f : free_monoid α →* M) : lift (f ∘ of) = f
lift.apply_symm_apply f
lemma
free_monoid.lift_restrict
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid", "lift" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
comp_lift (g : M →* N) (f : α → M) : g.comp (lift f) = lift (g ∘ f)
by { ext, simp }
lemma
free_monoid.comp_lift
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "lift" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
hom_map_lift (g : M →* N) (f : α → M) (x : free_monoid α) : g (lift f x) = lift (g ∘ f) x
monoid_hom.ext_iff.1 (comp_lift g f) x
lemma
free_monoid.hom_map_lift
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid", "lift" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
mk_mul_action (f : α → β → β) : mul_action (free_monoid α) β
{ smul := λ l b, l.to_list.foldr f b, one_smul := λ x, rfl, mul_smul := λ xs ys b, list.foldr_append _ _ _ _ }
def
free_monoid.mk_mul_action
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid", "list.foldr_append", "mul_action", "one_smul" ]
Define a multiplicative action of `free_monoid α` on `β`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
smul_def (f : α → β → β) (l : free_monoid α) (b : β) : (by haveI := mk_mul_action f; exact l • b = l.to_list.foldr f b)
rfl
lemma
free_monoid.smul_def
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
of_list_smul (f : α → β → β) (l : list α) (b : β) : (by haveI := mk_mul_action f; exact (of_list l) • b = l.foldr f b)
rfl
lemma
free_monoid.of_list_smul
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
of_smul (f : α → β → β) (x : α) (y : β) : (by haveI := mk_mul_action f; exact of x • y) = f x y
rfl
lemma
free_monoid.of_smul
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
map (f : α → β) : free_monoid α →* free_monoid β
{ to_fun := λ l, of_list $ l.to_list.map f, map_one' := rfl, map_mul' := λ l₁ l₂, list.map_append _ _ _ }
def
free_monoid.map
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid" ]
The unique monoid homomorphism `free_monoid α →* free_monoid β` that sends each `of x` to `of (f x)`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
map_of (f : α → β) (x : α) : map f (of x) = of (f x)
rfl
lemma
free_monoid.map_of
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
to_list_map (f : α → β) (xs : free_monoid α) : (map f xs).to_list = xs.to_list.map f
rfl
lemma
free_monoid.to_list_map
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
of_list_map (f : α → β) (xs : list α) : of_list (xs.map f) = map f (of_list xs)
rfl
lemma
free_monoid.of_list_map
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lift_of_comp_eq_map (f : α → β) : lift (λ x, of (f x)) = map f
hom_eq $ λ x, rfl
lemma
free_monoid.lift_of_comp_eq_map
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "lift" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
map_comp (g : β → γ) (f : α → β) : map (g ∘ f) = (map g).comp (map f)
hom_eq $ λ x, rfl
lemma
free_monoid.map_comp
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "map_comp" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
map_id : map (@id α) = monoid_hom.id (free_monoid α)
hom_eq $ λ x, rfl
lemma
free_monoid.map_id
algebra.free_monoid
src/algebra/free_monoid/basic.lean
[ "data.list.big_operators.basic" ]
[ "free_monoid", "map_id", "monoid_hom.id" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
countp (p : α → Prop) [decidable_pred p] : free_add_monoid α →+ ℕ
⟨list.countp p, list.countp_nil p, list.countp_append _⟩
def
free_add_monoid.countp
algebra.free_monoid
src/algebra/free_monoid/count.lean
[ "algebra.free_monoid.basic", "data.list.count" ]
[ "list.countp_append", "list.countp_nil" ]
`list.countp` as a bundled additive monoid homomorphism.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
countp_of (x : α) : countp p (of x) = if p x then 1 else 0
rfl
lemma
free_add_monoid.countp_of
algebra.free_monoid
src/algebra/free_monoid/count.lean
[ "algebra.free_monoid.basic", "data.list.count" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
countp_apply (l : free_add_monoid α) : countp p l = list.countp p l
rfl
lemma
free_add_monoid.countp_apply
algebra.free_monoid
src/algebra/free_monoid/count.lean
[ "algebra.free_monoid.basic", "data.list.count" ]
[ "list.countp" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
count [decidable_eq α] (x : α) : free_add_monoid α →+ ℕ
countp (eq x)
def
free_add_monoid.count
algebra.free_monoid
src/algebra/free_monoid/count.lean
[ "algebra.free_monoid.basic", "data.list.count" ]
[]
`list.count` as a bundled additive monoid homomorphism.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
count_of [decidable_eq α] (x y : α) : count x (of y) = pi.single x 1 y
by simp only [count, countp_of, pi.single_apply, eq_comm]
lemma
free_add_monoid.count_of
algebra.free_monoid
src/algebra/free_monoid/count.lean
[ "algebra.free_monoid.basic", "data.list.count" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
count_apply [decidable_eq α] (x : α) (l : free_add_monoid α) : count x l = list.count x l
rfl
lemma
free_add_monoid.count_apply
algebra.free_monoid
src/algebra/free_monoid/count.lean
[ "algebra.free_monoid.basic", "data.list.count" ]
[ "list.count" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
countp (p : α → Prop) [decidable_pred p] : free_monoid α →* multiplicative ℕ
(free_add_monoid.countp p).to_multiplicative
def
free_monoid.countp
algebra.free_monoid
src/algebra/free_monoid/count.lean
[ "algebra.free_monoid.basic", "data.list.count" ]
[ "free_add_monoid.countp", "free_monoid", "multiplicative" ]
`list.countp` as a bundled multiplicative monoid homomorphism.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
countp_of' (x : α) : countp p (of x) = if p x then multiplicative.of_add 1 else multiplicative.of_add 0
rfl
lemma
free_monoid.countp_of'
algebra.free_monoid
src/algebra/free_monoid/count.lean
[ "algebra.free_monoid.basic", "data.list.count" ]
[ "multiplicative.of_add" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
countp_of (x : α) : countp p (of x) = if p x then multiplicative.of_add 1 else 1
by rw [countp_of', of_add_zero]
lemma
free_monoid.countp_of
algebra.free_monoid
src/algebra/free_monoid/count.lean
[ "algebra.free_monoid.basic", "data.list.count" ]
[ "multiplicative.of_add", "of_add_zero" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
countp_apply (l : free_add_monoid α) : countp p l = multiplicative.of_add (list.countp p l)
rfl
lemma
free_monoid.countp_apply
algebra.free_monoid
src/algebra/free_monoid/count.lean
[ "algebra.free_monoid.basic", "data.list.count" ]
[ "list.countp", "multiplicative.of_add" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
count [decidable_eq α] (x : α) : free_monoid α →* multiplicative ℕ
countp (eq x)
def
free_monoid.count
algebra.free_monoid
src/algebra/free_monoid/count.lean
[ "algebra.free_monoid.basic", "data.list.count" ]
[ "free_monoid", "multiplicative" ]
`list.count` as a bundled additive monoid homomorphism.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
count_apply [decidable_eq α] (x : α) (l : free_add_monoid α) : count x l = multiplicative.of_add (list.count x l)
rfl
lemma
free_monoid.count_apply
algebra.free_monoid
src/algebra/free_monoid/count.lean
[ "algebra.free_monoid.basic", "data.list.count" ]
[ "list.count", "multiplicative.of_add" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
count_of [decidable_eq α] (x y : α) : count x (of y) = @pi.mul_single α (λ _, multiplicative ℕ) _ _ x (multiplicative.of_add 1) y
by simp only [count, countp_of, pi.mul_single_apply, eq_comm]
lemma
free_monoid.count_of
algebra.free_monoid
src/algebra/free_monoid/count.lean
[ "algebra.free_monoid.basic", "data.list.count" ]
[ "multiplicative", "multiplicative.of_add", "pi.mul_single", "pi.mul_single_apply" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
normalization_monoid (α : Type*) [cancel_comm_monoid_with_zero α]
(norm_unit : α → αˣ) (norm_unit_zero : norm_unit 0 = 1) (norm_unit_mul : ∀{a b}, a ≠ 0 → b ≠ 0 → norm_unit (a * b) = norm_unit a * norm_unit b) (norm_unit_coe_units : ∀(u : αˣ), norm_unit u = u⁻¹)
class
normalization_monoid
algebra.gcd_monoid
src/algebra/gcd_monoid/basic.lean
[ "algebra.associated", "algebra.group_power.lemmas", "algebra.ring.regular" ]
[ "cancel_comm_monoid_with_zero" ]
Normalization monoid: multiplying with `norm_unit` gives a normal form for associated elements.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
norm_unit_one : norm_unit (1:α) = 1
norm_unit_coe_units 1
theorem
norm_unit_one
algebra.gcd_monoid
src/algebra/gcd_monoid/basic.lean
[ "algebra.associated", "algebra.group_power.lemmas", "algebra.ring.regular" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83