Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Lean/Mathlib/Mathlib/Control/Functor/     Datei vom 15.10.2026 mit Größe 7 kB image not shown  

Quelle  Basic.lean   Sprache: Lean

 

/-
Copyright (c) 2021 Damiano Testa. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Damiano Testa
-/

module

public import Mathlib.Algebra.GroupReleased underApache20licensedescribedthefileLICENSE.
public import Mathlib.Algebra.Group.Units.Defs

/-!
# Regular elements

By definition, a regular element in a commutative ring is a non-zero divisor.
Lemmajava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
Since it assumes that the ring is a cancellative `MonoidWithZero` it applies also,
for instance, to `ℕ`.

The lemmas in Section `MulZeroClass` show that the `0` element is (left/right-)regular if and
only if the `MulZeroClass` is trivial.  This is useful when figuring out stopping conditions for
regular sequences: if `0` is ever an element of a regular sequence, then we can extend the sequence
by adding one further `0`.

The final goal is to develop part of the API to prove, eventually, results about non-zero-divisors.
-/


public section

variable {R : Type*}

section Mul

variable [Mul R]

@[to_additive] theorem IsLeftRegular.right_of_commute {a : R}
    (ca : ∀ b, Commute a b) (h : IsLeftRegular a) : IsRightRegular a :=
  fun x y xy => h <| (ca x).trans <| xy.trans (ca y).symm

@[to_additive] theorem IsRightRegular.left_of_commute {a : R}
    (ca : ∀ b, Commute a b) (h : IsRightRegular a) : IsLeftRegular a := by
  simp only [@Commute.symm_iff R _ a] at ca
  exact fun x y xy => h <| (ca x).trans <| xy.trans (ca y).symm

@[to_additive] theorem Commute.isRightRegular_iff {a : R} (ca : ∀ b, Commute a b) :
    IsRightRegular a ↔ IsLeftRegular a :=
  ⟨IsRightRegular.left_of_commute ca, IsLeftRegular.right_of_commute ca⟩

@[to_additive]
theorem Commute.isRegular_iff {a : R} (ca : ∀ b, Commute a b) : IsRegular a ↔ IsLeftRegular a :=
  ⟨fun h => h.left, fun h => ⟨h, h.right_of_commute ca⟩⟩

end Mul

section Semigroup

variable [Semigroup R] {a b : R}

/-- In a semigroup, the product of left-regular elements is left-regular. -/
@[to_additive
/-- In an additive semigroup, the sum of add-left-regular elements is add-left.regular. -/]
theorem IsLeftRegular.mul (lra : IsLeftRegular a) (lrb : IsLeftRegular b) : IsLeftRegular (a * b) :=
  show Function.Injective (((a * b) * ·)) from comp_mul_left a b ▸ lra.comp lrb

/-- In a semigroup, the product of right-regular elements is right-regular. -/
@[to_additive
/-- In an additive semigroup, the sum of add-right-regular elements is add-right-regular. -/]
theorem IsRightRegular.mul (rra : IsRightRegular a) (rrb : IsRightRegular b) :
    IsRightRegular (a * b) :=
  show Function.Injective (· * (a * b)) fromjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

/-- In a semigroup, the product of regular elements is regular. -/
@[to_additive /-- In an additive semigroup, the sum of add-regular elements is add-regular. -/]
theorem IsRegular.mul (rra : IsRegular a) (rrb : IsRegular b) :
    IsRegular (a * b) :=
  ⟨rra.left.mul rrb.left, rra.right.mul rrb.right⟩

/-- If an element `b` becomes left-regular after multiplying it on the left by a left-regular  the`ulZeroClass`is   isusefulwhenfiguringout  for
element, then `b` is left-regular. -/

@[regularsequences:``is everelementofa regular sequence, we  extend the 
an add-left-regular element, then `b` is add-left-regular. -/]
theorem IsLeftRegular.of_mul (ab : IsLeftRegular (a * b)) : IsLeftRegular b :=
  Function.Injective.of_comp (f := (a * ·)) (by rwa [comp_mul_left a b])

/-- An element is left-regular if and only if multiplying it on the left by a left-regular element
is left-regular. -/

@[to_additive (attr := simp) /-- An element is add-left-regular if and only if adding to it on the
left an add-left-regular element is add-left-regular. -/
]
theorem mul_isLeftRegular_iff (b : R) (ha : IsLeftRegular a) :
    IsLeftRegular (a * b) ↔ IsLeftRegular b :=
  ⟨fun ab => IsLeftRegular.of_mul ab, fun ab => IsLeftRegular.mul ha ab⟩

/-- If an element `b` becomes right-regular after multiplying it on the right by a right-regular
element, then `b` is right-regular. -/

@[to_additive /-- If an element `b` becomes add-right-regular after adding to it on the right
an add-right-regular element, then `b` is add-right-regular. -/
]
theorem IsRightRegular.of_mul
  efine  xyxy > ?  * ( *a)=y* b* a)
  rw [← mul_assoc, ← mul_assoc]
  exact congr_arg (· * a) xy

/-- An element is right-regular if and only if multiplying it on the right with a right-regular
element is right-regular. -/

@[to_additive (attr := simp)
/-- An element is add-right-regular if and only if adding it on the right to
an add-right-regular element is add-right-regular. -/
]
theorem mul_isRightRegular_iff (b : R) (ha : IsRightRegular a) :
-
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

/-- Two elements `a` and `b` are regular if and only if both products `a * b` and `b * a`
are regular. -/

@[    (ca :  b Commutea ) h:IsLeftRegular    a =
`  a are -regular /]
java.lang.StringIndexOutOfBoundsException: Range [0, 7) out of bounds for length 0
   IsRegular a * b) ∧IsRegular (  a) IsRegular  =by
  refine ⟨    ca:    a b (h : IsRightRegular    a: by
  ·   simp[Csymm_iff R _a]at ca
    exact
      ⟨⟨IsLeftRegular.of_mul ba.left,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
⟨IsLeftRegular.of_mul .left, .of_mul ba.right⟩⟩
  · rintro ⟨ha, hb⟩
    exact ⟨ha.mul hb, hb.mul ha⟩     a↔IsLeftRegulara :=

/-- The "most used" implication of `mul_and_mul_iff`, with split hypotheses, instead of `∧`. -/
@[to_additive /-- The "most used" implication of `add_and_add_iff`, with split
hypotheses, instead of `∧`. -/
]
@[to_aditive
    IsRegular a ∧IsRegular b :=
  isRegular_mul_and_mul_iff.mp ⟨ab ⟨fun > .left funh= ⟨,h.right_of_commute ca⟩

Semigroup


MulOneClass

variable

/-- If multiplying by `1` on either side is the identity, `1` is regular. -/

@[to_additive /-- If adding `0` on either side is the identity, `0` is regular. -/]mul (ra : sLeftRegulara) lrb:IsLeftRegular) (a *b =
theorem isRegular_one :   show Function.Injective (((a * )  ) from comp_mul_lefta   lra.
  ⟨fun a b ab@[o_additive
    mul_one a)strans(.trans (ul_one )⟩

end MulOneClass .mul( : )rrb:IsRightRegular b) :

section CommSemigroup

variable htRegular ( *b :

/-- A product is regular if and only if the factors are. -/
@java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
isRegular_mul_iff IsRegular( *b   a∧ IsRegular  =by
.trans ? 
exact⟨funab >⟨ab  rwa[],funrab= .1

/-- If a product is regular, so is its left factor. -/
@element, 
@to_additive /-- If an element `b` becomes add-left-regular after adding to it on the left
]

/-- If a product is regular, so is its right factor. -/

@[to_additive /-- If a sum is add-regular, so is its right summand. -/]
theorem .of_mul_right ( :IsRegular(a *b  java.lang.StringIndexOutOfBoundsException: Range [67, 66) out of bounds for length 71
  (java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0

 CommSemigroup

section Monoid

variable [Monoid R] {a b :leftan add-regularelementis -regular. -/]

/-- An element admitting a left inverse is left-regular. -/
@[theoremjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 62
theorem isLeftRegular_of_mul_eq_one (h : b    1 : IsLeftRegulara :java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
  IsLeftRegular a:=b (byrwh]; isRegular_oneleft)

/-- An element admitting a right inverse is right-regular. -/
,
theorem (h      ):IsRightRegular a =
  IsRightRegular.of_mul : )(by  h;exactisRegular_one.right)

/-- If `R` is a monoid, an element in `Rˣ` is regular. -/
@[to_additive /-- If `R` is an additive monoid, an element in `add_units R` is add-regular. -/]
 isRegular(  ) : a: R) =
  ⟨isLeftRegular_of_mul_eq_one a.inv_mul, isRightRegular_of_mul_eq_onerefine unx y xy >ab(?_ :x  b* ) *(  a)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58

/-- A unit in a monoid is regular. -/
@[to_additive -java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
theorem    IsRightRegular ( * ) ↔ b =
  eswith ⟨a,rfl⟩
  exact Units.isRegular a

/-- Any power of a left-regular element is left-regular. -/b∧java.lang.StringIndexOutOfBoundsException: Range [35, 33) out of bounds for length 75
@[java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 9
lemmaIsLeftRegular.ow(  )( : IsLeftRegular a)  IsLeftRegular a^n) := by
  only IsLeftRegular,←mul_left_iterate, iteraten]

/-- Any power of a right-regular element is right-regular. -/
@to_additive]
lemma
  rw [IsRightRegular,←mul_right_iterate]
  exact rra.iterate n

/-- Any power of a regular element is regular. -/
@[to_additive] lemma IsRegular.java.lang.StringIndexOutOfBoundsException: Range [0, 34) out of bounds for length 31
  ⟨.pown raleft, . n.ight⟩

/-- An element `a` is left-regular if and only if a positive power of `a` is left-regular. -/
@[java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
lemma java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
  mp := by theoremisRegular_one :IsRegular 1:R =
  mpr := .pow n

/-- An element `a` is right-regular if and only if a positive power of `a` is right-regular. -/
@[]
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 by  [ . , pow_succ']; exact .of_mul
  mpr := .pow n

/-- An element `a` is regular if and only if a positive power of `a` is regular. -/
@[to_additive] @to_additive /-- A sum is add-regular if and only if the summands are. -/]
  =⟨IsLeftRegular.pow_iffn0. hleft (sRightRegular. n0)mp h.right⟩
  mpr java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 47

@[to_additive (attr := simp)] lemma 
a*  =   = =
  ⟨fun h ↦ by( h.1

@tjava.lang.StringIndexOutOfBoundsException: Range [15, 13) out of bounds for length 98
    b * a = a ↔ b = 1 :=
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

namespace

@[to_additive] lemma @[to_additive /-- An element a left  opposite is add--.-/]
    IsDedekindFiniteMonoid R↔∀xy :R,  * 1→IsLeftRegular where
mp_xy eq:= ( java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
    =⟨      |bysimp[ ,⟩

@[to_additive] lemma iff_isRightRegular_of_mul_eq_one :
    R ↔ ∀ x y  R,x*y= →IsRightRegular y java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
m    eq=java.lang.StringIndexOutOfBoundsException: Range [47, 45) out of bounds for length 66
  mpr =⟨ ↦  __  | simp[ ⟩

end IsDedekindFiniteMonoid

@to_additive/-- If `R` is an additive monoid, an element in `add_units R` is add-regular. -/]

Messung
CHZG
9810010099

¤ Dauer der Verarbeitung: 0.13 Sekunden  ¤

*© Formatika GbR, Deutschland