File: Mathlib/Algebra/Order/Kleene.lean

full_name: IdemSemiring.bot_le
code: /-- An idempotent semiring is a semiring with the additional property that addition is idempotent.
-/
class IdemSemiring (α : Type u) extends Semiring α, SemilatticeSup α where
  protected sup := (· + ·)
  protected add_eq_sup : ∀ a b : α, a + b = a ⊔ b := by
    intros
    rfl
  /-- The bottom element of an idempotent semiring: `0` by default -/
  protected bot : α := 0
  protected bot_le : ∀ a, bot ≤ a
goal: IdemSemiring.bot ≤ a

full_name: IdemSemiring.bot
code: /-- An idempotent semiring is a semiring with the additional property that addition is idempotent.
-/
class IdemSemiring (α : Type u) extends Semiring α, SemilatticeSup α where
  protected sup := (· + ·)
  protected add_eq_sup : ∀ a b : α, a + b = a ⊔ b := by
    intros
    rfl
  /-- The bottom element of an idempotent semiring: `0` by default -/
  protected bot : α := 0
  protected bot_le : ∀ a, bot ≤ a
goal: α

full_name: IdemSemiring
code: /-- An idempotent semiring is a semiring with the additional property that addition is idempotent.
-/
class IdemSemiring (α : Type u) extends Semiring α, SemilatticeSup α where
  protected sup := (· + ·)
  protected add_eq_sup : ∀ a b : α, a + b = a ⊔ b := by
    intros
    rfl
  /-- The bottom element of an idempotent semiring: `0` by default -/
  protected bot : α := 0
  protected bot_le : ∀ a, bot ≤ a
goal: Type u

full_name: IdemSemiring.add_eq_sup
code: /-- An idempotent semiring is a semiring with the additional property that addition is idempotent.
-/
class IdemSemiring (α : Type u) extends Semiring α, SemilatticeSup α where
  protected sup := (· + ·)
  protected add_eq_sup : ∀ a b : α, a + b = a ⊔ b := by
    intros
    rfl
  /-- The bottom element of an idempotent semiring: `0` by default -/
  protected bot : α := 0
  protected bot_le : ∀ a, bot ≤ a
goal: a + b = a ⊔ b

full_name: IdemCommSemiring
code: /-- An idempotent commutative semiring is a commutative semiring with the additional property that
addition is idempotent. -/
class IdemCommSemiring (α : Type u) extends CommSemiring α, IdemSemiring α
goal: Type u

full_name: KStar.kstar
code: /-- Notation typeclass for the Kleene star `∗`. -/
class KStar (α : Type*) where
  /-- The Kleene star operator on a Kleene algebra -/
  protected kstar : α → α
goal: α → α

full_name: KStar
code: /-- Notation typeclass for the Kleene star `∗`. -/
class KStar (α : Type*) where
  /-- The Kleene star operator on a Kleene algebra -/
  protected kstar : α → α
goal: Type u_5

full_name: Computability.«_aux_Mathlib_Algebra_Order_Kleene___macroRules_Computability_term_∗_1»
code: @[inherit_doc] scoped[Computability] postfix:1024 "∗" => KStar.kstar
goal: Lean.Macro

full_name: Computability._aux_Mathlib_Algebra_Order_Kleene___unexpand_KStar_kstar_1
code: @[inherit_doc] scoped[Computability] postfix:1024 "∗" => KStar.kstar
goal: Lean.PrettyPrinter.Unexpander

full_name: KleeneAlgebra.mul_kstar_le_self
code: /-- 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`, then `a∗ * b ≤ c`
* If `c * a + b ≤ c`, then `b * a∗ ≤ c`
-/
class KleeneAlgebra (α : Type*) extends IdemSemiring α, KStar α where
  protected one_le_kstar : ∀ a : α, 1 ≤ a∗
  protected mul_kstar_le_kstar : ∀ a : α, a * a∗ ≤ a∗
  protected kstar_mul_le_kstar : ∀ a : α, a∗ * a ≤ a∗
  protected mul_kstar_le_self : ∀ a b : α, b * a ≤ b → b * a∗ ≤ b
  protected kstar_mul_le_self : ∀ a b : α, a * b ≤ b → a∗ * b ≤ b
goal: b * a ≤ b → b * a∗ ≤ b

full_name: KleeneAlgebra
code: /-- 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`, then `a∗ * b ≤ c`
* If `c * a + b ≤ c`, then `b * a∗ ≤ c`
-/
class KleeneAlgebra (α : Type*) extends IdemSemiring α, KStar α where
  protected one_le_kstar : ∀ a : α, 1 ≤ a∗
  protected mul_kstar_le_kstar : ∀ a : α, a * a∗ ≤ a∗
  protected kstar_mul_le_kstar : ∀ a : α, a∗ * a ≤ a∗
  protected mul_kstar_le_self : ∀ a b : α, b * a ≤ b → b * a∗ ≤ b
  protected kstar_mul_le_self : ∀ a b : α, a * b ≤ b → a∗ * b ≤ b
goal: Type u_5

full_name: KleeneAlgebra.kstar_mul_le_self
code: /-- 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`, then `a∗ * b ≤ c`
* If `c * a + b ≤ c`, then `b * a∗ ≤ c`
-/
class KleeneAlgebra (α : Type*) extends IdemSemiring α, KStar α where
  protected one_le_kstar : ∀ a : α, 1 ≤ a∗
  protected mul_kstar_le_kstar : ∀ a : α, a * a∗ ≤ a∗
  protected kstar_mul_le_kstar : ∀ a : α, a∗ * a ≤ a∗
  protected mul_kstar_le_self : ∀ a b : α, b * a ≤ b → b * a∗ ≤ b
  protected kstar_mul_le_self : ∀ a b : α, a * b ≤ b → a∗ * b ≤ b
goal: a * b ≤ b → a∗ * b ≤ b

full_name: KleeneAlgebra.mul_kstar_le_kstar
code: /-- 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`, then `a∗ * b ≤ c`
* If `c * a + b ≤ c`, then `b * a∗ ≤ c`
-/
class KleeneAlgebra (α : Type*) extends IdemSemiring α, KStar α where
  protected one_le_kstar : ∀ a : α, 1 ≤ a∗
  protected mul_kstar_le_kstar : ∀ a : α, a * a∗ ≤ a∗
  protected kstar_mul_le_kstar : ∀ a : α, a∗ * a ≤ a∗
  protected mul_kstar_le_self : ∀ a b : α, b * a ≤ b → b * a∗ ≤ b
  protected kstar_mul_le_self : ∀ a b : α, a * b ≤ b → a∗ * b ≤ b
goal: a * a∗ ≤ a∗

full_name: KleeneAlgebra.kstar_mul_le_kstar
code: /-- 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`, then `a∗ * b ≤ c`
* If `c * a + b ≤ c`, then `b * a∗ ≤ c`
-/
class KleeneAlgebra (α : Type*) extends IdemSemiring α, KStar α where
  protected one_le_kstar : ∀ a : α, 1 ≤ a∗
  protected mul_kstar_le_kstar : ∀ a : α, a * a∗ ≤ a∗
  protected kstar_mul_le_kstar : ∀ a : α, a∗ * a ≤ a∗
  protected mul_kstar_le_self : ∀ a b : α, b * a ≤ b → b * a∗ ≤ b
  protected kstar_mul_le_self : ∀ a b : α, a * b ≤ b → a∗ * b ≤ b
goal: a∗ * a ≤ a∗

full_name: KleeneAlgebra.one_le_kstar
code: /-- 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`, then `a∗ * b ≤ c`
* If `c * a + b ≤ c`, then `b * a∗ ≤ c`
-/
class KleeneAlgebra (α : Type*) extends IdemSemiring α, KStar α where
  protected one_le_kstar : ∀ a : α, 1 ≤ a∗
  protected mul_kstar_le_kstar : ∀ a : α, a * a∗ ≤ a∗
  protected kstar_mul_le_kstar : ∀ a : α, a∗ * a ≤ a∗
  protected mul_kstar_le_self : ∀ a b : α, b * a ≤ b → b * a∗ ≤ b
  protected kstar_mul_le_self : ∀ a b : α, a * b ≤ b → a∗ * b ≤ b
goal: 1 ≤ a∗

full_name: IdemSemiring.toOrderBot
code: instance (priority := 100) IdemSemiring.toOrderBot [IdemSemiring α] : OrderBot α 
goal: OrderBot α

full_name: IdemSemiring.ofSemiring
code: /-- Construct an idempotent semiring from an idempotent addition. -/
abbrev IdemSemiring.ofSemiring [Semiring α] (h : ∀ a : α, a + a = a) : IdemSemiring α 
goal: IdemSemiring α

full_name: add_eq_sup
code: theorem add_eq_sup (a b : α) : a + b = a ⊔ b 
goal: a + b = a ⊔ b

full_name: add_idem
code: theorem add_idem (a : α) : a + a = a 
goal: a + a = a

full_name: nsmul_eq_self
code: theorem nsmul_eq_self : ∀ {n : ℕ} (_ : n ≠ 0) (a : α), n • a = a
  
goal: n ≠ 0 → ∀ (a : α), n • a = a

full_name: add_eq_left_iff_le
code: theorem add_eq_left_iff_le : a + b = a ↔ b ≤ a 
goal: a + b = a ↔ b ≤ a

full_name: add_eq_right_iff_le
code: theorem add_eq_right_iff_le : a + b = b ↔ a ≤ b 
goal: a + b = b ↔ a ≤ b

full_name: add_le_iff
code: theorem add_le_iff : a + b ≤ c ↔ a ≤ c ∧ b ≤ c 
goal: a + b ≤ c ↔ a ≤ c ∧ b ≤ c

full_name: add_le
code: theorem add_le (ha : a ≤ c) (hb : b ≤ c) : a + b ≤ c 
goal: a + b ≤ c

full_name: IdemSemiring.toCanonicallyOrderedAddCommMonoid
code: instance (priority := 100) IdemSemiring.toCanonicallyOrderedAddCommMonoid :
    CanonicallyOrderedAddCommMonoid α 
goal: CanonicallyOrderedAddCommMonoid α

full_name: IdemSemiring.toCovariantClass_mul_le
code: instance (priority := 100) IdemSemiring.toCovariantClass_mul_le :
    CovariantClass α α (· * ·) (· ≤ ·) 
goal: CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1

full_name: IdemSemiring.toCovariantClass_swap_mul_le
code: instance (priority := 100) IdemSemiring.toCovariantClass_swap_mul_le :
    CovariantClass α α (swap (· * ·)) (· ≤ ·) 
goal: CovariantClass α α (Function.swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1

full_name: one_le_kstar
code: @[simp]
theorem one_le_kstar : 1 ≤ a∗ 
goal: 1 ≤ a∗

full_name: mul_kstar_le_kstar
code: theorem mul_kstar_le_kstar : a * a∗ ≤ a∗ 
goal: a * a∗ ≤ a∗

full_name: kstar_mul_le_kstar
code: theorem kstar_mul_le_kstar : a∗ * a ≤ a∗ 
goal: a∗ * a ≤ a∗

full_name: mul_kstar_le_self
code: theorem mul_kstar_le_self : b * a ≤ b → b * a∗ ≤ b 
goal: b * a ≤ b → b * a∗ ≤ b

full_name: kstar_mul_le_self
code: theorem kstar_mul_le_self : a * b ≤ b → a∗ * b ≤ b 
goal: a * b ≤ b → a∗ * b ≤ b

full_name: mul_kstar_le
code: theorem mul_kstar_le (hb : b ≤ c) (ha : c * a ≤ c) : b * a∗ ≤ c 
goal: b * a∗ ≤ c

full_name: kstar_mul_le
code: theorem kstar_mul_le (hb : b ≤ c) (ha : a * c ≤ c) : a∗ * b ≤ c 
goal: a∗ * b ≤ c

full_name: kstar_le_of_mul_le_left
code: theorem kstar_le_of_mul_le_left (hb : 1 ≤ b) : b * a ≤ b → a∗ ≤ b 
goal: b * a ≤ b → a∗ ≤ b

full_name: kstar_le_of_mul_le_right
code: theorem kstar_le_of_mul_le_right (hb : 1 ≤ b) : a * b ≤ b → a∗ ≤ b 
goal: a * b ≤ b → a∗ ≤ b

full_name: le_kstar
code: @[simp]
theorem le_kstar : a ≤ a∗ 
goal: a ≤ a∗

full_name: kstar_mono
code: @[mono]
theorem kstar_mono : Monotone (KStar.kstar : α → α) 
goal: Monotone KStar.kstar

full_name: kstar_eq_one
code: @[simp]
theorem kstar_eq_one : a∗ = 1 ↔ a ≤ 1 
goal: a∗ = 1 ↔ a ≤ 1

full_name: kstar_zero
code: @[simp] lemma kstar_zero : (0 : α)∗ = 1 
goal: 0∗ = 1

full_name: kstar_one
code: @[simp]
theorem kstar_one : (1 : α)∗ = 1 
goal: 1∗ = 1

full_name: kstar_mul_kstar
code: @[simp]
theorem kstar_mul_kstar (a : α) : a∗ * a∗ = a∗ 
goal: a∗ * a∗ = a∗

full_name: kstar_eq_self
code: @[simp]
theorem kstar_eq_self : a∗ = a ↔ a * a = a ∧ 1 ≤ a 
goal: a∗ = a ↔ a * a = a ∧ 1 ≤ a

full_name: kstar_idem
code: @[simp]
theorem kstar_idem (a : α) : a∗∗ = a∗ 
goal: a∗∗ = a∗

full_name: pow_le_kstar
code: @[simp]
theorem pow_le_kstar : ∀ {n : ℕ}, a ^ n ≤ a∗
  
goal: a ^ n ≤ a∗

full_name: Prod.instIdemSemiring
code: instance instIdemSemiring [IdemSemiring α] [IdemSemiring β] : IdemSemiring (α × β) 
goal: IdemSemiring (α × β)

full_name: Prod.instIdemCommSemiring
code: instance [IdemCommSemiring α] [IdemCommSemiring β] : IdemCommSemiring (α × β) 
goal: IdemCommSemiring (α × β)

full_name: Prod.instKleeneAlgebra
code: instance : KleeneAlgebra (α × β) 
goal: KleeneAlgebra (α × β)

full_name: Prod.kstar_def
code: theorem kstar_def (a : α × β) : a∗ = (a.1∗, a.2∗) 
goal: a∗ = (a.1∗, a.2∗)

full_name: Prod.fst_kstar
code: @[simp]
theorem fst_kstar (a : α × β) : a∗.1 = a.1∗ 
goal: a∗.1 = a.1∗

full_name: Prod.snd_kstar
code: @[simp]
theorem snd_kstar (a : α × β) : a∗.2 = a.2∗ 
goal: a∗.2 = a.2∗

full_name: Pi.instIdemSemiring
code: instance instIdemSemiring [∀ i, IdemSemiring (π i)] : IdemSemiring (∀ i, π i) 
goal: IdemSemiring ((i : ι) → π i)

full_name: Pi.instIdemCommSemiringForall
code: instance [∀ i, IdemCommSemiring (π i)] : IdemCommSemiring (∀ i, π i) 
goal: IdemCommSemiring ((i : ι) → π i)

full_name: Pi.instKleeneAlgebraForall
code: instance : KleeneAlgebra (∀ i, π i) 
goal: KleeneAlgebra ((i : ι) → π i)

full_name: Pi.kstar_def
code: theorem kstar_def (a : ∀ i, π i) : a∗ = fun i ↦ (a i)∗ 
goal: a∗ = fun i => (a i)∗

full_name: Pi.kstar_apply
code: @[simp]
theorem kstar_apply (a : ∀ i, π i) (i : ι) : a∗ i = (a i)∗ 
goal: a∗ i = (a i)∗

full_name: Function.Injective.idemSemiring
code: /-- Pullback an `IdemSemiring` instance along an injective function. -/
protected abbrev idemSemiring [IdemSemiring α] [Zero β] [One β] [Add β] [Mul β] [Pow β ℕ] [SMul ℕ β]
    [NatCast β] [Sup β] [Bot β] (f : β → α) (hf : Injective f) (zero : f 0 = 0) (one : f 1 = 1)
    (add : ∀ x y, f (x + y) = f x + f y) (mul : ∀ x y, f (x * y) = f x * f y)
    (nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x) (npow : ∀ (x) (n : ℕ), f (x ^ n) = f x ^ n)
    (natCast : ∀ n : ℕ, f n = n) (sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) (bot : f ⊥ = ⊥) :
    IdemSemiring β 
goal: IdemSemiring β

full_name: Function.Injective.idemCommSemiring
code: /-- Pullback an `IdemCommSemiring` instance along an injective function. -/
protected abbrev idemCommSemiring [IdemCommSemiring α] [Zero β] [One β] [Add β] [Mul β] [Pow β ℕ]
    [SMul ℕ β] [NatCast β] [Sup β] [Bot β] (f : β → α) (hf : Injective f) (zero : f 0 = 0)
    (one : f 1 = 1) (add : ∀ x y, f (x + y) = f x + f y) (mul : ∀ x y, f (x * y) = f x * f y)
    (nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x) (npow : ∀ (x) (n : ℕ), f (x ^ n) = f x ^ n)
    (natCast : ∀ n : ℕ, f n = n) (sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) (bot : f ⊥ = ⊥) :
    IdemCommSemiring β 
goal: IdemCommSemiring β

full_name: Function.Injective.kleeneAlgebra
code: /-- Pullback a `KleeneAlgebra` instance along an injective function. -/
protected abbrev kleeneAlgebra [KleeneAlgebra α] [Zero β] [One β] [Add β] [Mul β] [Pow β ℕ]
    [SMul ℕ β] [NatCast β] [Sup β] [Bot β] [KStar β] (f : β → α) (hf : Injective f) (zero : f 0 = 0)
    (one : f 1 = 1) (add : ∀ x y, f (x + y) = f x + f y) (mul : ∀ x y, f (x * y) = f x * f y)
    (nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x) (npow : ∀ (x) (n : ℕ), f (x ^ n) = f x ^ n)
    (natCast : ∀ n : ℕ, f n = n) (sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) (bot : f ⊥ = ⊥)
    (kstar : ∀ a, f a∗ = (f a)∗) : KleeneAlgebra β 
goal: KleeneAlgebra β