Kleene Algebras #
This file defines idempotent semirings and Kleene algebras, which are used extensively in the theory of computation.
An idempotent semiring is a semiring whose addition is idempotent. An idempotent semiring is
naturally a semilattice by setting a ≤ b
if a + b = b
.
A Kleene algebra is an idempotent semiring equipped with an additional unary operator ∗
, the
Kleene star.
Main declarations #
IdemSemiring
: Idempotent semiringIdemCommSemiring
: Idempotent commutative semiringKleeneAlgebra
: Kleene algebra
Notation #
a∗
is notation for kstar a
in locale Computability
.
References #
- [D. Kozen, A completeness theorem for Kleene algebras and the algebra of regular events] [kozen1994]
- https://planetmath.org/idempotentsemiring
- https://encyclopediaofmath.org/wiki/Idempotent_semi-ring
- https://planetmath.org/kleene_algebra
TODO #
Instances for AddOpposite
, MulOpposite
, ULift
, Subsemiring
, Subring
, Subalgebra
.
Tags #
kleene algebra, idempotent semiring
An idempotent semiring is a semiring with the additional property that addition is idempotent.
- add : α → α → α
- zero : α
- nsmul : ℕ → α → α
- nsmul_zero : ∀ (x : α), AddMonoid.nsmul 0 x = 0
- nsmul_succ : ∀ (n : ℕ) (x : α), AddMonoid.nsmul (n + 1) x = AddMonoid.nsmul n x + x
- mul : α → α → α
- one : α
- natCast : ℕ → α
- natCast_zero : NatCast.natCast 0 = 0
- natCast_succ : ∀ (n : ℕ), NatCast.natCast (n + 1) = NatCast.natCast n + 1
- npow : ℕ → α → α
- npow_zero : ∀ (x : α), Semiring.npow 0 x = 1
- npow_succ : ∀ (n : ℕ) (x : α), Semiring.npow (n + 1) x = Semiring.npow n x * x
- sup : α → α → α
- le : α → α → Prop
- lt : α → α → Prop
- le_refl : ∀ (a : α), a ≤ a
- bot : α
The bottom element of an idempotent semiring:
0
by default - bot_le : ∀ (a : α), IdemSemiring.bot ≤ a
Instances
An idempotent commutative semiring is a commutative semiring with the additional property that addition is idempotent.
- add : α → α → α
- zero : α
- nsmul : ℕ → α → α
- nsmul_zero : ∀ (x : α), AddMonoid.nsmul 0 x = 0
- nsmul_succ : ∀ (n : ℕ) (x : α), AddMonoid.nsmul (n + 1) x = AddMonoid.nsmul n x + x
- mul : α → α → α
- one : α
- natCast : ℕ → α
- natCast_zero : NatCast.natCast 0 = 0
- natCast_succ : ∀ (n : ℕ), NatCast.natCast (n + 1) = NatCast.natCast n + 1
- npow : ℕ → α → α
- npow_zero : ∀ (x : α), Semiring.npow 0 x = 1
- npow_succ : ∀ (n : ℕ) (x : α), Semiring.npow (n + 1) x = Semiring.npow n x * x
- sup : α → α → α
- le : α → α → Prop
- lt : α → α → Prop
- le_refl : ∀ (a : α), a ≤ a
- bot : α
The bottom element of an idempotent semiring:
0
by default - bot_le : ∀ (a : α), IdemCommSemiring.bot ≤ a
Instances
The Kleene star operator on a Kleene algebra
Equations
- Computability.«term_∗» = Lean.ParserDescr.trailingNode `Computability.term_∗ 1024 1024 (Lean.ParserDescr.symbol "∗")
Instances For
A Kleene Algebra is an idempotent semiring with an additional unary operator kstar
(for Kleene
star) that satisfies the following properties:
1 + a * a∗ ≤ a∗
1 + a∗ * a ≤ a∗
- If
a * c + b ≤ c
, thena∗ * b ≤ c
- If
c * a + b ≤ c
, thenb * a∗ ≤ c
- add : α → α → α
- zero : α
- nsmul : ℕ → α → α
- nsmul_zero : ∀ (x : α), AddMonoid.nsmul 0 x = 0
- nsmul_succ : ∀ (n : ℕ) (x : α), AddMonoid.nsmul (n + 1) x = AddMonoid.nsmul n x + x
- mul : α → α → α
- one : α
- natCast : ℕ → α
- natCast_zero : NatCast.natCast 0 = 0
- natCast_succ : ∀ (n : ℕ), NatCast.natCast (n + 1) = NatCast.natCast n + 1
- npow : ℕ → α → α
- npow_zero : ∀ (x : α), Semiring.npow 0 x = 1
- npow_succ : ∀ (n : ℕ) (x : α), Semiring.npow (n + 1) x = Semiring.npow n x * x
- sup : α → α → α
- le : α → α → Prop
- lt : α → α → Prop
- le_refl : ∀ (a : α), a ≤ a
- bot : α
- bot_le : ∀ (a : α), IdemSemiring.bot ≤ a
- kstar : α → α
- one_le_kstar : ∀ (a : α), 1 ≤ KStar.kstar a
- mul_kstar_le_kstar : ∀ (a : α), a * KStar.kstar a ≤ KStar.kstar a
- kstar_mul_le_kstar : ∀ (a : α), KStar.kstar a * a ≤ KStar.kstar a
- mul_kstar_le_self : ∀ (a b : α), b * a ≤ b → b * KStar.kstar a ≤ b
- kstar_mul_le_self : ∀ (a b : α), a * b ≤ b → KStar.kstar a * b ≤ b
Instances
Equations
- IdemSemiring.toOrderBot = let __src := inst; OrderBot.mk ⋯
Construct an idempotent semiring from an idempotent addition.
Equations
- IdemSemiring.ofSemiring h = let __src := inst; IdemSemiring.mk ⋯ 0 ⋯
Instances For
Alias of the reverse direction of add_eq_left_iff_le
.
Alias of the reverse direction of add_eq_right_iff_le
.
Equations
- IdemSemiring.toCanonicallyOrderedAddCommMonoid = let __src := inst; CanonicallyOrderedAddCommMonoid.mk ⋯ ⋯
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
Equations
- Prod.instIdemSemiring = let __src := Prod.instSemiring; let __src_1 := Prod.instSemilatticeSup α β; let __src_2 := Prod.instOrderBot α β; IdemSemiring.mk ⋯ ⊥ ⋯
Equations
- Prod.instIdemCommSemiring = let __src := Prod.instCommSemiring; let __src_1 := Prod.instIdemSemiring; IdemCommSemiring.mk ⋯ IdemSemiring.bot ⋯
Equations
- Prod.instKleeneAlgebra = let __src := Prod.instIdemSemiring; KleeneAlgebra.mk ⋯ ⋯ ⋯ ⋯ ⋯
Equations
- Pi.instIdemSemiring = let __src := Pi.semiring; let __src_1 := Pi.instSemilatticeSup; let __src_2 := Pi.instOrderBot; IdemSemiring.mk ⋯ ⊥ ⋯
Equations
- Pi.instIdemCommSemiringForall = let __src := Pi.commSemiring; let __src_1 := Pi.instIdemSemiring; IdemCommSemiring.mk ⋯ IdemSemiring.bot ⋯
Equations
- Pi.instKleeneAlgebraForall = let __src := Pi.instIdemSemiring; KleeneAlgebra.mk ⋯ ⋯ ⋯ ⋯ ⋯
Pullback an IdemSemiring
instance along an injective function.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Pullback an IdemCommSemiring
instance along an injective function.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Pullback a KleeneAlgebra
instance along an injective function.
Equations
- One or more equations did not get rendered due to their size.