Mathlib.Algebra.Free
246 declarations. Mathlib docs · Source
theorem FreeSemigroup.mk.injEq E0 #
∀ {α : Type u} (head : α) (tail : List α) (head_1 : α) (tail_1 : List α),
({ head := head, tail := tail } = { head := head_1, tail := tail_1 }) = (head = head_1 ∧ tail = tail_1)
theorem FreeMagma.liftAux.match_1.congr_eq_1 E1 #
∀ {α : Type u_1} (motive : FreeMagma α → Sort u_2) (x : FreeMagma α) (h_1 : (x : α) → motive (FreeMagma.of x))
(h_2 : (x y : FreeMagma α) → motive (x.mul y)) (x_1 : α),
x = FreeMagma.of x_1 →
(match x with
| FreeMagma.of x => h_1 x
| x.mul y => h_2 x y) ≍
h_1 x_1
theorem FreeAddSemigroup.mk.inj E1 #
∀ {α : Type u} {head : α} {tail : List α} {head_1 : α} {tail_1 : List α},
{ head := head, tail := tail } = { head := head_1, tail := tail_1 } → head = head_1 ∧ tail = tail_1
theorem FreeMagma.liftAux.match_1.congr_eq_2 E1 #
∀ {α : Type u_1} (motive : FreeMagma α → Sort u_2) (x : FreeMagma α) (h_1 : (x : α) → motive (FreeMagma.of x))
(h_2 : (x y : FreeMagma α) → motive (x.mul y)) (x_1 y : FreeMagma α),
x = x_1.mul y →
(match x with
| FreeMagma.of x => h_1 x
| x.mul y => h_2 x y) ≍
h_2 x_1 y
abbrev FreeMagma.brecOn.go E1 #
{α : Type u} →
{motive : FreeMagma α → Sort u_1} →
(t : FreeMagma α) → ((t : FreeMagma α) → FreeMagma.below t → motive t) → motive t ×' FreeMagma.below t
def FreeSemigroup.ctorIdx E1 #
{α : Type u} → FreeSemigroup α → ℕ
theorem FreeAddSemigroup.mk.injEq E0 #
∀ {α : Type u} (head : α) (tail : List α) (head_1 : α) (tail_1 : List α),
({ head := head, tail := tail } = { head := head_1, tail := tail_1 }) = (head = head_1 ∧ tail = tail_1)
abbrev FreeAddMagma.ctorElimType E1 #
{α : Type u} → {motive : FreeAddMagma α → Sort u_1} → ℕ → Sort (max 1 (imax (u + 1) u_1) (imax (u + 1) (u + 1) u_1))
theorem FreeAddMagma.liftAux.match_1.congr_eq_2 E1 #
∀ {α : Type u_1} (motive : FreeAddMagma α → Sort u_2) (x : FreeAddMagma α) (h_1 : (x : α) → motive (FreeAddMagma.of x))
(h_2 : (x y : FreeAddMagma α) → motive (x.add y)) (x_1 y : FreeAddMagma α),
x = x_1.add y →
(match x with
| FreeAddMagma.of x => h_1 x
| x.add y => h_2 x y) ≍
h_2 x_1 y
def FreeAddSemigroup.ctorIdx E1 #
{α : Type u} → FreeAddSemigroup α → ℕ
abbrev FreeMagma.ctorElimType E1 #
{α : Type u} → {motive : FreeMagma α → Sort u_1} → ℕ → Sort (max 1 (imax (u + 1) u_1) (imax (u + 1) (u + 1) u_1))
def FreeMagma.ctorIdx E1 #
{α : Type u} → FreeMagma α → ℕ
theorem FreeAddMagma.brecOn.eq E1 #
∀ {α : Type u} {motive : FreeAddMagma α → Sort u_1} (t : FreeAddMagma α)
(F_1 : (t : FreeAddMagma α) → FreeAddMagma.below t → motive t),
FreeAddMagma.brecOn t F_1 = F_1 t (FreeAddMagma.brecOn.go t F_1).2
abbrev FreeAddMagma.brecOn.go E1 #
{α : Type u} →
{motive : FreeAddMagma α → Sort u_1} →
(t : FreeAddMagma α) → ((t : FreeAddMagma α) → FreeAddMagma.below t → motive t) → motive t ×' FreeAddMagma.below t
theorem FreeSemigroup.mk.inj E1 #
∀ {α : Type u} {head : α} {tail : List α} {head_1 : α} {tail_1 : List α},
{ head := head, tail := tail } = { head := head_1, tail := tail_1 } → head = head_1 ∧ tail = tail_1
theorem FreeAddMagma.liftAux.match_1.congr_eq_1 E1 #
∀ {α : Type u_1} (motive : FreeAddMagma α → Sort u_2) (x : FreeAddMagma α) (h_1 : (x : α) → motive (FreeAddMagma.of x))
(h_2 : (x y : FreeAddMagma α) → motive (x.add y)) (x_1 : α),
x = FreeAddMagma.of x_1 →
(match x with
| FreeAddMagma.of x => h_1 x
| x.add y => h_2 x y) ≍
h_1 x_1
def FreeAddMagma.ctorIdx E1 #
{α : Type u} → FreeAddMagma α → ℕ
theorem FreeMagma.brecOn.eq E1 #
∀ {α : Type u} {motive : FreeMagma α → Sort u_1} (t : FreeMagma α)
(F_1 : (t : FreeMagma α) → FreeMagma.below t → motive t), FreeMagma.brecOn t F_1 = F_1 t (FreeMagma.brecOn.go t F_1).2
inductive FreeAddMagma E1 #
Type u → Type u
If α is a type, then FreeAddMagma α is the free additive magma generated by α.
This is an additive magma equipped with a function FreeAddMagma.of : α → FreeAddMagma α which has
the following universal property: if M is any magma, and f : α → M is any function,
then this function is the composite of FreeAddMagma.of and a unique additive homomorphism
FreeAddMagma.lift f : FreeAddMagma α →ₙ+ M.
A typical element of FreeAddMagma α is a formal non-associative sum of
elements of α. For example if x and y are terms of type α then x + ((y + y) + x) is a
"typical" element of FreeAddMagma α.
One can think of FreeAddMagma α as the type of binary trees with leaves labelled by α.
In general, no pair of distinct elements in FreeAddMagma α will commute.
ctor FreeAddMagma.of E0 #
{α : Type u} → α → FreeAddMagma α
ctor FreeAddMagma.add E0 #
{α : Type u} → FreeAddMagma α → FreeAddMagma α → FreeAddMagma α
def instDecidableEqFreeAddMagma.decEq E1 #
{α : Type u_1} → [DecidableEq α] → (x x_1 : FreeAddMagma α) → Decidable (x = x_1)
instance instDecidableEqFreeAddMagma E0 #
{α : Type u_1} → [DecidableEq α] → DecidableEq (FreeAddMagma α)
inductive FreeMagma E1 #
Type u → Type u
If α is a type, then FreeMagma α is the free magma generated by α.
This is a magma equipped with a function FreeMagma.of : α → FreeMagma α which has
the following universal property: if M is any magma, and f : α → M is any function,
then this function is the composite of FreeMagma.of and a unique multiplicative homomorphism
FreeMagma.lift f : FreeMagma α →ₙ* M.
A typical element of FreeMagma α is a formal non-associative product of
elements of α. For example if x and y are terms of type α then x * ((y * y) * x) is a
"typical" element of FreeMagma α.
One can think of FreeMagma α as the type of binary trees with leaves labelled by α.
In general, no pair of distinct elements in FreeMagma α will commute.
ctor FreeMagma.of E0 #
{α : Type u} → α → FreeMagma α
ctor FreeMagma.mul E0 #
{α : Type u} → FreeMagma α → FreeMagma α → FreeMagma α
instance instDecidableEqFreeMagma E0 #
{α : Type u_1} → [DecidableEq α] → DecidableEq (FreeMagma α)
def instDecidableEqFreeMagma.decEq E1 #
{α : Type u_1} → [DecidableEq α] → (x x_1 : FreeMagma α) → Decidable (x = x_1)
instance FreeAddMagma.instInhabited E0 #
{α : Type u} → [Inhabited α] → Inhabited (FreeAddMagma α)
instance FreeMagma.instInhabited E0 #
{α : Type u} → [Inhabited α] → Inhabited (FreeMagma α)
instance FreeAddMagma.instAdd E0 #
{α : Type u} → Add (FreeAddMagma α)
instance FreeMagma.instMul E0 #
{α : Type u} → Mul (FreeMagma α)
theorem FreeAddMagma.add_eq E0 #
∀ {α : Type u} (x y : FreeAddMagma α), x.add y = x + y
theorem FreeMagma.mul_eq E0 #
∀ {α : Type u} (x y : FreeMagma α), x.mul y = x * y
def FreeMagma.recOnMul E1 #
{α : Type u} →
{C : FreeMagma α → Sort l} →
(x : FreeMagma α) → ((x : α) → C (FreeMagma.of x)) → ((x y : FreeMagma α) → C x → C y → C (x * y)) → C x
Recursor for FreeMagma using x * y instead of FreeMagma.mul x y.
def FreeAddMagma.recOnAdd E1 #
{α : Type u} →
{C : FreeAddMagma α → Sort l} →
(x : FreeAddMagma α) → ((x : α) → C (FreeAddMagma.of x)) → ((x y : FreeAddMagma α) → C x → C y → C (x + y)) → C x
Recursor for FreeAddMagma using x + y instead of FreeAddMagma.add x y.
theorem FreeMagma.hom_ext_iff E0 #
∀ {α : Type u} {β : Type v} [inst : Mul β] {f g : FreeMagma α →ₙ* β}, f = g ↔ ⇑f ∘ FreeMagma.of = ⇑g ∘ FreeMagma.of
theorem FreeAddMagma.hom_ext E1 #
∀ {α : Type u} {β : Type v} [inst : Add β] {f g : FreeAddMagma α →ₙ+ β},
⇑f ∘ FreeAddMagma.of = ⇑g ∘ FreeAddMagma.of → f = g
theorem FreeMagma.hom_ext E1 #
∀ {α : Type u} {β : Type v} [inst : Mul β] {f g : FreeMagma α →ₙ* β}, ⇑f ∘ FreeMagma.of = ⇑g ∘ FreeMagma.of → f = g
theorem FreeAddMagma.hom_ext_iff E0 #
∀ {α : Type u} {β : Type v} [inst : Add β] {f g : FreeAddMagma α →ₙ+ β},
f = g ↔ ⇑f ∘ FreeAddMagma.of = ⇑g ∘ FreeAddMagma.of
def FreeMagma.liftAux E0 #
{α : Type u} → {β : Type v} → [Mul β] → (α → β) → FreeMagma α → β
Lifts a function α → β to a magma homomorphism FreeMagma α → β given a magma β.
def FreeAddMagma.liftAux E0 #
{α : Type u} → {β : Type v} → [Add β] → (α → β) → FreeAddMagma α → β
Lifts a function α → β to an additive magma homomorphism FreeAddMagma α → β given
an additive magma β.
def FreeMagma.lift E1 #
{α : Type u} → {β : Type v} → [inst : Mul β] → (α → β) ≃ (FreeMagma α →ₙ* β)
The universal property of the free magma expressing its adjointness.
theorem FreeMagma.lift_symm_apply E0 #
∀ {α : Type u} {β : Type v} [inst : Mul β] (F : FreeMagma α →ₙ* β) (a : α),
FreeMagma.lift.symm F a = (⇑F ∘ FreeMagma.of) a
theorem FreeAddMagma.lift_symm_apply E0 #
∀ {α : Type u} {β : Type v} [inst : Add β] (F : FreeAddMagma α →ₙ+ β) (a : α),
FreeAddMagma.lift.symm F a = (⇑F ∘ FreeAddMagma.of) a
def FreeAddMagma.lift E1 #
{α : Type u} → {β : Type v} → [inst : Add β] → (α → β) ≃ (FreeAddMagma α →ₙ+ β)
The universal property of the free additive magma expressing its adjointness.
theorem FreeMagma.lift_of E0 #
∀ {α : Type u} {β : Type v} [inst : Mul β] (f : α → β) (x : α), (FreeMagma.lift f) (FreeMagma.of x) = f x
theorem FreeAddMagma.lift_of E0 #
∀ {α : Type u} {β : Type v} [inst : Add β] (f : α → β) (x : α), (FreeAddMagma.lift f) (FreeAddMagma.of x) = f x
theorem FreeAddMagma.lift_comp_of E0 #
∀ {α : Type u} {β : Type v} [inst : Add β] (f : α → β), ⇑(FreeAddMagma.lift f) ∘ FreeAddMagma.of = f
theorem FreeMagma.lift_comp_of E0 #
∀ {α : Type u} {β : Type v} [inst : Mul β] (f : α → β), ⇑(FreeMagma.lift f) ∘ FreeMagma.of = f
theorem FreeAddMagma.lift_comp_of' E0 #
∀ {α : Type u} {β : Type v} [inst : Add β] (f : FreeAddMagma α →ₙ+ β), FreeAddMagma.lift (⇑f ∘ FreeAddMagma.of) = f
theorem FreeMagma.lift_comp_of' E0 #
∀ {α : Type u} {β : Type v} [inst : Mul β] (f : FreeMagma α →ₙ* β), FreeMagma.lift (⇑f ∘ FreeMagma.of) = f
def FreeMagma.map E1 #
{α : Type u} → {β : Type v} → (α → β) → FreeMagma α →ₙ* FreeMagma β
The unique magma homomorphism FreeMagma α →ₙ* FreeMagma β that sends
each of x to of (f x).
def FreeAddMagma.map E1 #
{α : Type u} → {β : Type v} → (α → β) → FreeAddMagma α →ₙ+ FreeAddMagma β
The unique additive magma homomorphism FreeAddMagma α → FreeAddMagma β that
sends each of x to of (f x).
theorem FreeAddMagma.map_of E0 #
∀ {α : Type u} {β : Type v} (f : α → β) (x : α), (FreeAddMagma.map f) (FreeAddMagma.of x) = FreeAddMagma.of (f x)
theorem FreeMagma.map_of E0 #
∀ {α : Type u} {β : Type v} (f : α → β) (x : α), (FreeMagma.map f) (FreeMagma.of x) = FreeMagma.of (f x)
instance FreeMagma.instMonad E0 #
Monad FreeMagma
instance FreeAddMagma.instMonad E0 #
Monad FreeAddMagma
def FreeMagma.recOnPure E1 #
{α : Type u} →
{C : FreeMagma α → Sort l} →
(x : FreeMagma α) → ((x : α) → C (pure x)) → ((x y : FreeMagma α) → C x → C y → C (x * y)) → C x
Recursor on FreeMagma using pure instead of of.
def FreeAddMagma.recOnPure E1 #
{α : Type u} →
{C : FreeAddMagma α → Sort l} →
(x : FreeAddMagma α) → ((x : α) → C (pure x)) → ((x y : FreeAddMagma α) → C x → C y → C (x + y)) → C x
Recursor on FreeAddMagma using pure instead of of.
theorem FreeAddMagma.map_pure E0 #
∀ {α β : Type u} (f : α → β) (x : α), f <$> pure x = pure (f x)
theorem FreeMagma.map_pure E0 #
∀ {α β : Type u} (f : α → β) (x : α), f <$> pure x = pure (f x)
theorem FreeMagma.map_mul' E0 #
∀ {α β : Type u} (f : α → β) (x y : FreeMagma α), f <$> (x * y) = f <$> x * f <$> y
theorem FreeAddMagma.map_add' E0 #
∀ {α β : Type u} (f : α → β) (x y : FreeAddMagma α), f <$> (x + y) = f <$> x + f <$> y
theorem FreeMagma.pure_bind E0 #
∀ {α β : Type u} (f : α → FreeMagma β) (x : α), pure x >>= f = f x
theorem FreeAddMagma.pure_bind E0 #
∀ {α β : Type u} (f : α → FreeAddMagma β) (x : α), pure x >>= f = f x
theorem FreeAddMagma.add_bind E0 #
∀ {α β : Type u} (f : α → FreeAddMagma β) (x y : FreeAddMagma α), x + y >>= f = (x >>= f) + (y >>= f)
theorem FreeMagma.mul_bind E0 #
∀ {α β : Type u} (f : α → FreeMagma β) (x y : FreeMagma α), x * y >>= f = (x >>= f) * (y >>= f)
theorem FreeMagma.pure_seq E0 #
∀ {α β : Type u} {f : α → β} {x : FreeMagma α}, pure f <*> x = f <$> x
theorem FreeAddMagma.pure_seq E0 #
∀ {α β : Type u} {f : α → β} {x : FreeAddMagma α}, pure f <*> x = f <$> x
theorem FreeAddMagma.add_seq E0 #
∀ {α β : Type u} {f g : FreeAddMagma (α → β)} {x : FreeAddMagma α}, f + g <*> x = (f <*> x) + (g <*> x)
theorem FreeMagma.mul_seq E0 #
∀ {α β : Type u} {f g : FreeMagma (α → β)} {x : FreeMagma α}, f * g <*> x = (f <*> x) * (g <*> x)
instance FreeMagma.instLawfulMonad E0 #
LawfulMonad FreeMagma
instance FreeAddMagma.instLawfulMonad E0 #
LawfulMonad FreeAddMagma
def FreeMagma.traverse E1 #
{m : Type u → Type u} → [Applicative m] → {α β : Type u} → (α → m β) → FreeMagma α → m (FreeMagma β)
FreeMagma is traversable.
def FreeAddMagma.traverse E1 #
{m : Type u → Type u} → [Applicative m] → {α β : Type u} → (α → m β) → FreeAddMagma α → m (FreeAddMagma β)
FreeAddMagma is traversable.
instance FreeMagma.instTraversable E0 #
Traversable FreeMagma
instance FreeAddMagma.instTraversable E0 #
Traversable FreeAddMagma
theorem FreeMagma.traverse_pure E0 #
∀ {α β : Type u} {m : Type u → Type u} [inst : Applicative m] (F : α → m β) (x : α), traverse F (pure x) = pure <$> F x
theorem FreeAddMagma.traverse_pure E0 #
∀ {α β : Type u} {m : Type u → Type u} [inst : Applicative m] (F : α → m β) (x : α), traverse F (pure x) = pure <$> F x
theorem FreeAddMagma.traverse_pure' E0 #
∀ {α β : Type u} {m : Type u → Type u} [inst : Applicative m] (F : α → m β), traverse F ∘ pure = fun x ↦ pure <$> F x
theorem FreeMagma.traverse_pure' E0 #
∀ {α β : Type u} {m : Type u → Type u} [inst : Applicative m] (F : α → m β), traverse F ∘ pure = fun x ↦ pure <$> F x
theorem FreeAddMagma.traverse_add E0 #
∀ {α β : Type u} {m : Type u → Type u} [inst : Applicative m] (F : α → m β) (x y : FreeAddMagma α),
traverse F (x + y) = (fun x1 x2 ↦ x1 + x2) <$> traverse F x <*> traverse F y
theorem FreeMagma.traverse_mul E0 #
∀ {α β : Type u} {m : Type u → Type u} [inst : Applicative m] (F : α → m β) (x y : FreeMagma α),
traverse F (x * y) = (fun x1 x2 ↦ x1 * x2) <$> traverse F x <*> traverse F y
theorem FreeAddMagma.traverse_add' E0 #
∀ {α β : Type u} {m : Type u → Type u} [inst : Applicative m] (F : α → m β),
Function.comp (traverse F) ∘ HAdd.hAdd = fun x y ↦ (fun x1 x2 ↦ x1 + x2) <$> traverse F x <*> traverse F y
theorem FreeMagma.traverse_mul' E0 #
∀ {α β : Type u} {m : Type u → Type u} [inst : Applicative m] (F : α → m β),
Function.comp (traverse F) ∘ HMul.hMul = fun x y ↦ (fun x1 x2 ↦ x1 * x2) <$> traverse F x <*> traverse F y
theorem FreeAddMagma.traverse_eq E0 #
∀ {α β : Type u} {m : Type u → Type u} [inst : Applicative m] (F : α → m β) (x : FreeAddMagma α),
FreeAddMagma.traverse F x = traverse F x
theorem FreeMagma.traverse_eq E0 #
∀ {α β : Type u} {m : Type u → Type u} [inst : Applicative m] (F : α → m β) (x : FreeMagma α),
FreeMagma.traverse F x = traverse F x
instance FreeMagma.instLawfulTraversable E0 #
LawfulTraversable FreeMagma
instance FreeAddMagma.instLawfulTraversable E0 #
LawfulTraversable FreeAddMagma
def FreeMagma.repr E1 #
{α : Type u} → [Repr α] → FreeMagma α → Std.Format
Representation of an element of a free magma.
def FreeAddMagma.repr E1 #
{α : Type u} → [Repr α] → FreeAddMagma α → Std.Format
Representation of an element of a free additive magma.
instance instReprFreeAddMagma E0 #
{α : Type u} → [Repr α] → Repr (FreeAddMagma α)
instance instReprFreeMagma E0 #
{α : Type u} → [Repr α] → Repr (FreeMagma α)
def FreeMagma.length E1 #
{α : Type u} → FreeMagma α → ℕ
Length of an element of a free magma.
def FreeAddMagma.length E1 #
{α : Type u} → FreeAddMagma α → ℕ
Length of an element of a free additive magma.
theorem FreeMagma.length_pos E1 #
∀ {α : Type u} (x : FreeMagma α), 0 < x.length
The length of an element of a free magma is positive.
theorem FreeAddMagma.length_pos E1 #
∀ {α : Type u} (x : FreeAddMagma α), 0 < x.length
The length of an element of a free additive magma is positive.
inductive AddMagma.AssocRel E1 #
(α : Type u) → [Add α] → α → α → Prop
Associativity relations for an additive magma.
ctor AddMagma.AssocRel.intro E0 #
∀ {α : Type u} [inst : Add α] (x y z : α), AddMagma.AssocRel α (x + y + z) (x + (y + z))
ctor AddMagma.AssocRel.left E0 #
∀ {α : Type u} [inst : Add α] (w x y z : α), AddMagma.AssocRel α (w + (x + y + z)) (w + (x + (y + z)))
inductive Magma.AssocRel E1 #
(α : Type u) → [Mul α] → α → α → Prop
Associativity relations for a magma.
ctor Magma.AssocRel.intro E0 #
∀ {α : Type u} [inst : Mul α] (x y z : α), Magma.AssocRel α (x * y * z) (x * (y * z))
ctor Magma.AssocRel.left E0 #
∀ {α : Type u} [inst : Mul α] (w x y z : α), Magma.AssocRel α (w * (x * y * z)) (w * (x * (y * z)))
def Magma.AssocQuotient E1 #
(α : Type u) → [Mul α] → Type u
Semigroup quotient of a magma.
def AddMagma.FreeAddSemigroup E1 #
(α : Type u) → [Add α] → Type u
Additive semigroup quotient of an additive magma.
theorem AddMagma.FreeAddSemigroup.quot_mk_assoc E1 #
∀ {α : Type u} [inst : Add α] (x y z : α),
Quot.mk (AddMagma.AssocRel α) (x + y + z) = Quot.mk (AddMagma.AssocRel α) (x + (y + z))
theorem Magma.AssocQuotient.quot_mk_assoc E1 #
∀ {α : Type u} [inst : Mul α] (x y z : α),
Quot.mk (Magma.AssocRel α) (x * y * z) = Quot.mk (Magma.AssocRel α) (x * (y * z))
theorem AddMagma.FreeAddSemigroup.quot_mk_assoc_left E1 #
∀ {α : Type u} [inst : Add α] (x y z w : α),
Quot.mk (AddMagma.AssocRel α) (x + (y + z + w)) = Quot.mk (AddMagma.AssocRel α) (x + (y + (z + w)))
theorem Magma.AssocQuotient.quot_mk_assoc_left E1 #
∀ {α : Type u} [inst : Mul α] (x y z w : α),
Quot.mk (Magma.AssocRel α) (x * (y * z * w)) = Quot.mk (Magma.AssocRel α) (x * (y * (z * w)))
instance Magma.AssocQuotient.instSemigroup E0 #
{α : Type u} → [inst : Mul α] → Semigroup (Magma.AssocQuotient α)
instance AddMagma.FreeAddSemigroup.instAddSemigroup E0 #
{α : Type u} → [inst : Add α] → AddSemigroup (AddMagma.FreeAddSemigroup α)
def Magma.AssocQuotient.of E1 #
{α : Type u} → [inst : Mul α] → α →ₙ* Magma.AssocQuotient α
Embedding from magma to its free semigroup.
def AddMagma.FreeAddSemigroup.of E1 #
{α : Type u} → [inst : Add α] → α →ₙ+ AddMagma.FreeAddSemigroup α
Embedding from additive magma to its free additive semigroup.
instance AddMagma.FreeAddSemigroup.instInhabited E0 #
{α : Type u} → [inst : Add α] → [Inhabited α] → Inhabited (AddMagma.FreeAddSemigroup α)
instance Magma.AssocQuotient.instInhabited E0 #
{α : Type u} → [inst : Mul α] → [Inhabited α] → Inhabited (Magma.AssocQuotient α)
theorem Magma.AssocQuotient.induction_on E1 #
∀ {α : Type u} [inst : Mul α] {C : Magma.AssocQuotient α → Prop} (x : Magma.AssocQuotient α),
(∀ (x : α), C (Magma.AssocQuotient.of x)) → C x
theorem AddMagma.FreeAddSemigroup.induction_on E1 #
∀ {α : Type u} [inst : Add α] {C : AddMagma.FreeAddSemigroup α → Prop} (x : AddMagma.FreeAddSemigroup α),
(∀ (x : α), C (AddMagma.FreeAddSemigroup.of x)) → C x
theorem Magma.AssocQuotient.hom_ext E1 #
∀ {α : Type u} [inst : Mul α] {β : Type v} [inst_1 : Semigroup β] {f g : Magma.AssocQuotient α →ₙ* β},
f.comp Magma.AssocQuotient.of = g.comp Magma.AssocQuotient.of → f = g
theorem AddMagma.FreeAddSemigroup.hom_ext E1 #
∀ {α : Type u} [inst : Add α] {β : Type v} [inst_1 : AddSemigroup β] {f g : AddMagma.FreeAddSemigroup α →ₙ+ β},
f.comp AddMagma.FreeAddSemigroup.of = g.comp AddMagma.FreeAddSemigroup.of → f = g
theorem Magma.AssocQuotient.hom_ext_iff E0 #
∀ {α : Type u} [inst : Mul α] {β : Type v} [inst_1 : Semigroup β] {f g : Magma.AssocQuotient α →ₙ* β},
f = g ↔ f.comp Magma.AssocQuotient.of = g.comp Magma.AssocQuotient.of
theorem AddMagma.FreeAddSemigroup.hom_ext_iff E0 #
∀ {α : Type u} [inst : Add α] {β : Type v} [inst_1 : AddSemigroup β] {f g : AddMagma.FreeAddSemigroup α →ₙ+ β},
f = g ↔ f.comp AddMagma.FreeAddSemigroup.of = g.comp AddMagma.FreeAddSemigroup.of
def Magma.AssocQuotient.lift E1 #
{α : Type u} → [inst : Mul α] → {β : Type v} → [inst_1 : Semigroup β] → (α →ₙ* β) ≃ (Magma.AssocQuotient α →ₙ* β)
Lifts a magma homomorphism α → β to a semigroup homomorphism Magma.AssocQuotient α → β
given a semigroup β.
theorem AddMagma.FreeAddSemigroup.lift_symm_apply E0 #
∀ {α : Type u} [inst : Add α] {β : Type v} [inst_1 : AddSemigroup β] (f : AddMagma.FreeAddSemigroup α →ₙ+ β),
AddMagma.FreeAddSemigroup.lift.symm f = f.comp AddMagma.FreeAddSemigroup.of
def AddMagma.FreeAddSemigroup.lift E1 #
{α : Type u} →
[inst : Add α] → {β : Type v} → [inst_1 : AddSemigroup β] → (α →ₙ+ β) ≃ (AddMagma.FreeAddSemigroup α →ₙ+ β)
Lifts an additive magma homomorphism α → β to an
additive semigroup homomorphism AddMagma.AssocQuotient α → β given an additive semigroup β.
theorem Magma.AssocQuotient.lift_symm_apply E0 #
∀ {α : Type u} [inst : Mul α] {β : Type v} [inst_1 : Semigroup β] (f : Magma.AssocQuotient α →ₙ* β),
Magma.AssocQuotient.lift.symm f = f.comp Magma.AssocQuotient.of
theorem Magma.AssocQuotient.lift_of E0 #
∀ {α : Type u} [inst : Mul α] {β : Type v} [inst_1 : Semigroup β] (f : α →ₙ* β) (x : α),
(Magma.AssocQuotient.lift f) (Magma.AssocQuotient.of x) = f x
theorem AddMagma.FreeAddSemigroup.lift_of E0 #
∀ {α : Type u} [inst : Add α] {β : Type v} [inst_1 : AddSemigroup β] (f : α →ₙ+ β) (x : α),
(AddMagma.FreeAddSemigroup.lift f) (AddMagma.FreeAddSemigroup.of x) = f x
theorem AddMagma.FreeAddSemigroup.lift_comp_of E0 #
∀ {α : Type u} [inst : Add α] {β : Type v} [inst_1 : AddSemigroup β] (f : α →ₙ+ β),
(AddMagma.FreeAddSemigroup.lift f).comp AddMagma.FreeAddSemigroup.of = f
theorem Magma.AssocQuotient.lift_comp_of E0 #
∀ {α : Type u} [inst : Mul α] {β : Type v} [inst_1 : Semigroup β] (f : α →ₙ* β),
(Magma.AssocQuotient.lift f).comp Magma.AssocQuotient.of = f
theorem Magma.AssocQuotient.lift_comp_of' E0 #
∀ {α : Type u} [inst : Mul α] {β : Type v} [inst_1 : Semigroup β] (f : Magma.AssocQuotient α →ₙ* β),
Magma.AssocQuotient.lift (f.comp Magma.AssocQuotient.of) = f
theorem AddMagma.FreeAddSemigroup.lift_comp_of' E0 #
∀ {α : Type u} [inst : Add α] {β : Type v} [inst_1 : AddSemigroup β] (f : AddMagma.FreeAddSemigroup α →ₙ+ β),
AddMagma.FreeAddSemigroup.lift (f.comp AddMagma.FreeAddSemigroup.of) = f
def Magma.AssocQuotient.map E1 #
{α : Type u} →
[inst : Mul α] → {β : Type v} → [inst_1 : Mul β] → (α →ₙ* β) → Magma.AssocQuotient α →ₙ* Magma.AssocQuotient β
From a magma homomorphism α →ₙ* β to a semigroup homomorphism
Magma.AssocQuotient α →ₙ* Magma.AssocQuotient β.
def AddMagma.FreeAddSemigroup.map E1 #
{α : Type u} →
[inst : Add α] →
{β : Type v} → [inst_1 : Add β] → (α →ₙ+ β) → AddMagma.FreeAddSemigroup α →ₙ+ AddMagma.FreeAddSemigroup β
From an additive magma homomorphism α → β to an additive semigroup homomorphism
AddMagma.AssocQuotient α → AddMagma.AssocQuotient β.
theorem Magma.AssocQuotient.map_of E0 #
∀ {α : Type u} [inst : Mul α] {β : Type v} [inst_1 : Mul β] (f : α →ₙ* β) (x : α),
(Magma.AssocQuotient.map f) (Magma.AssocQuotient.of x) = Magma.AssocQuotient.of (f x)
theorem AddMagma.FreeAddSemigroup.map_of E0 #
∀ {α : Type u} [inst : Add α] {β : Type v} [inst_1 : Add β] (f : α →ₙ+ β) (x : α),
(AddMagma.FreeAddSemigroup.map f) (AddMagma.FreeAddSemigroup.of x) = AddMagma.FreeAddSemigroup.of (f x)
structure FreeAddSemigroup E1 #
Type u → Type u
If α is a type, then FreeAddSemigroup α is the free additive semigroup generated by α.
This is an additive semigroup equipped with a function
FreeAddSemigroup.of : α → FreeAddSemigroup α which has the following universal property:
if M is any additive semigroup, and f : α → M is any function,
then this function is the composite of FreeAddSemigroup.of and a unique semigroup homomorphism
FreeAddSemigroup.lift f : FreeAddSemigroup α →ₙ+ M.
A typical element of FreeAddSemigroup α is a nonempty formal sum of elements of α.
For example if x and y are terms of type α then x + y + y + x is a
"typical" element of FreeAddSemigroup α. In particular if α is empty
then FreeAddSemigroup α is also empty, and if α has one term
then FreeAddSemigroup α is isomorphic to ℕ+.
If α has two or more terms then FreeAddSemigroup α is not commutative.
One can think of FreeAddSemigroup α as the type of nonempty lists of α, with addition
given by concatenation.
ctor FreeAddSemigroup.mk E0 #
{α : Type u} → α → List α → FreeAddSemigroup α
abbrev FreeAddSemigroup.head E1 #
{α : Type u} → FreeAddSemigroup α → α
The head of the element
abbrev FreeAddSemigroup.tail E1 #
{α : Type u} → FreeAddSemigroup α → List α
The tail of the element
structure FreeSemigroup E1 #
Type u → Type u
If α is a type, then FreeSemigroup α is the free semigroup generated by α.
This is a semigroup equipped with a function FreeSemigroup.of : α → FreeSemigroup α which has
the following universal property: if M is any semigroup, and f : α → M is any function,
then this function is the composite of FreeSemigroup.of and a unique semigroup homomorphism
FreeSemigroup.lift f : FreeSemigroup α →ₙ* M.
A typical element of FreeSemigroup α is a nonempty formal product of elements of α.
For example if x and y are terms of type α then x * y * y * x is a
"typical" element of FreeSemigroup α. In particular if α is empty
then FreeSemigroup α is also empty, and if α has one term
then FreeSemigroup α is isomorphic to Multiplicative ℕ+.
If α has two or more terms then FreeSemigroup α is not commutative.
One can think of FreeSemigroup α as the type of nonempty lists of α, with multiplication
given by concatenation.
theorem FreeAddSemigroup.ext_iff E0 #
∀ {α : Type u} {x y : FreeAddSemigroup α}, x = y ↔ x.head = y.head ∧ x.tail = y.tail
theorem FreeSemigroup.ext E1 #
∀ {α : Type u} {x y : FreeSemigroup α}, x.head = y.head → x.tail = y.tail → x = y
theorem FreeSemigroup.ext_iff E0 #
∀ {α : Type u} {x y : FreeSemigroup α}, x = y ↔ x.head = y.head ∧ x.tail = y.tail
theorem FreeAddSemigroup.ext E1 #
∀ {α : Type u} {x y : FreeAddSemigroup α}, x.head = y.head → x.tail = y.tail → x = y
ctor FreeSemigroup.mk E0 #
{α : Type u} → α → List α → FreeSemigroup α
abbrev FreeSemigroup.head E1 #
{α : Type u} → FreeSemigroup α → α
The head of the element
abbrev FreeSemigroup.tail E1 #
{α : Type u} → FreeSemigroup α → List α
The tail of the element
instance FreeSemigroup.instSemigroup E0 #
{α : Type u} → Semigroup (FreeSemigroup α)
instance FreeAddSemigroup.instAddSemigroup E0 #
{α : Type u} → AddSemigroup (FreeAddSemigroup α)
theorem FreeSemigroup.head_mul E0 #
∀ {α : Type u} (x y : FreeSemigroup α), (x * y).head = x.head
theorem FreeAddSemigroup.head_add E0 #
∀ {α : Type u} (x y : FreeAddSemigroup α), (x + y).head = x.head
theorem FreeSemigroup.tail_mul E0 #
∀ {α : Type u} (x y : FreeSemigroup α), (x * y).tail = x.tail ++ y.head :: y.tail
theorem FreeAddSemigroup.tail_add E0 #
∀ {α : Type u} (x y : FreeAddSemigroup α), (x + y).tail = x.tail ++ y.head :: y.tail
theorem FreeAddSemigroup.mk_add_mk E0 #
∀ {α : Type u} (x y : α) (L1 L2 : List α),
{ head := x, tail := L1 } + { head := y, tail := L2 } = { head := x, tail := L1 ++ y :: L2 }
theorem FreeSemigroup.mk_mul_mk E0 #
∀ {α : Type u} (x y : α) (L1 L2 : List α),
{ head := x, tail := L1 } * { head := y, tail := L2 } = { head := x, tail := L1 ++ y :: L2 }
def FreeSemigroup.of E1 #
{α : Type u} → α → FreeSemigroup α
The embedding α → FreeSemigroup α.
def FreeAddSemigroup.of E1 #
{α : Type u} → α → FreeAddSemigroup α
The embedding α → FreeAddSemigroup α.
theorem FreeSemigroup.of_tail E0 #
∀ {α : Type u} (x : α), (FreeSemigroup.of x).tail = []
theorem FreeSemigroup.of_head E0 #
∀ {α : Type u} (x : α), (FreeSemigroup.of x).head = x
theorem FreeAddSemigroup.of_head E0 #
∀ {α : Type u} (x : α), (FreeAddSemigroup.of x).head = x
theorem FreeAddSemigroup.of_tail E0 #
∀ {α : Type u} (x : α), (FreeAddSemigroup.of x).tail = []
def FreeSemigroup.length E1 #
{α : Type u} → FreeSemigroup α → ℕ
Length of an element of free semigroup.
def FreeAddSemigroup.length E1 #
{α : Type u} → FreeAddSemigroup α → ℕ
Length of an element of free additive semigroup
theorem FreeAddSemigroup.length_add E0 #
∀ {α : Type u} (x y : FreeAddSemigroup α), (x + y).length = x.length + y.length
theorem FreeSemigroup.length_mul E0 #
∀ {α : Type u} (x y : FreeSemigroup α), (x * y).length = x.length + y.length
theorem FreeAddSemigroup.length_of E0 #
∀ {α : Type u} (x : α), (FreeAddSemigroup.of x).length = 1
theorem FreeSemigroup.length_of E0 #
∀ {α : Type u} (x : α), (FreeSemigroup.of x).length = 1
instance FreeAddSemigroup.instInhabited E0 #
{α : Type u} → [Inhabited α] → Inhabited (FreeAddSemigroup α)
instance FreeSemigroup.instInhabited E0 #
{α : Type u} → [Inhabited α] → Inhabited (FreeSemigroup α)
def FreeSemigroup.recOnMul E1 #
{α : Type u} →
{C : FreeSemigroup α → Sort l} →
(x : FreeSemigroup α) →
((x : α) → C (FreeSemigroup.of x)) →
((x : α) → (y : FreeSemigroup α) → C (FreeSemigroup.of x) → C y → C (FreeSemigroup.of x * y)) → C x
Recursor for free semigroup using of and *.
def FreeAddSemigroup.recOnAdd E1 #
{α : Type u} →
{C : FreeAddSemigroup α → Sort l} →
(x : FreeAddSemigroup α) →
((x : α) → C (FreeAddSemigroup.of x)) →
((x : α) → (y : FreeAddSemigroup α) → C (FreeAddSemigroup.of x) → C y → C (FreeAddSemigroup.of x + y)) → C x
Recursor for free additive semigroup using of and +.
theorem FreeSemigroup.hom_ext E1 #
∀ {α : Type u} {β : Type v} [inst : Mul β] {f g : FreeSemigroup α →ₙ* β},
⇑f ∘ FreeSemigroup.of = ⇑g ∘ FreeSemigroup.of → f = g
theorem FreeAddSemigroup.hom_ext E1 #
∀ {α : Type u} {β : Type v} [inst : Add β] {f g : FreeAddSemigroup α →ₙ+ β},
⇑f ∘ FreeAddSemigroup.of = ⇑g ∘ FreeAddSemigroup.of → f = g
theorem FreeAddSemigroup.hom_ext_iff E0 #
∀ {α : Type u} {β : Type v} [inst : Add β] {f g : FreeAddSemigroup α →ₙ+ β},
f = g ↔ ⇑f ∘ FreeAddSemigroup.of = ⇑g ∘ FreeAddSemigroup.of
theorem FreeSemigroup.hom_ext_iff E0 #
∀ {α : Type u} {β : Type v} [inst : Mul β] {f g : FreeSemigroup α →ₙ* β},
f = g ↔ ⇑f ∘ FreeSemigroup.of = ⇑g ∘ FreeSemigroup.of
def FreeSemigroup.lift E1 #
{α : Type u} → {β : Type v} → [inst : Semigroup β] → (α → β) ≃ (FreeSemigroup α →ₙ* β)
Lifts a function α → β to a semigroup homomorphism FreeSemigroup α → β given
a semigroup β.
theorem FreeAddSemigroup.lift_symm_apply E0 #
∀ {α : Type u} {β : Type v} [inst : AddSemigroup β] (f : FreeAddSemigroup α →ₙ+ β) (a : α),
FreeAddSemigroup.lift.symm f a = (⇑f ∘ FreeAddSemigroup.of) a
theorem FreeSemigroup.lift_symm_apply E0 #
∀ {α : Type u} {β : Type v} [inst : Semigroup β] (f : FreeSemigroup α →ₙ* β) (a : α),
FreeSemigroup.lift.symm f a = (⇑f ∘ FreeSemigroup.of) a
def FreeAddSemigroup.lift E1 #
{α : Type u} → {β : Type v} → [inst : AddSemigroup β] → (α → β) ≃ (FreeAddSemigroup α →ₙ+ β)
Lifts a function α → β to an additive semigroup
homomorphism FreeAddSemigroup α → β given an additive semigroup β.
theorem FreeAddSemigroup.lift_mk_eq_foldl E1 #
∀ {α : Type u} {β : Type v} [inst : AddSemigroup β] {f : α → β} {x : α} {xs : List α},
(FreeAddSemigroup.lift f) { head := x, tail := xs } = List.foldl (fun x1 x2 ↦ x1 + f x2) (f x) xs
theorem FreeSemigroup.lift_mk_eq_foldl E1 #
∀ {α : Type u} {β : Type v} [inst : Semigroup β] {f : α → β} {x : α} {xs : List α},
(FreeSemigroup.lift f) { head := x, tail := xs } = List.foldl (fun x1 x2 ↦ x1 * f x2) (f x) xs
theorem FreeAddSemigroup.lift_of E0 #
∀ {α : Type u} {β : Type v} [inst : AddSemigroup β] (f : α → β) (x : α),
(FreeAddSemigroup.lift f) (FreeAddSemigroup.of x) = f x
theorem FreeSemigroup.lift_of E0 #
∀ {α : Type u} {β : Type v} [inst : Semigroup β] (f : α → β) (x : α), (FreeSemigroup.lift f) (FreeSemigroup.of x) = f x
theorem FreeAddSemigroup.lift_comp_of E0 #
∀ {α : Type u} {β : Type v} [inst : AddSemigroup β] (f : α → β), ⇑(FreeAddSemigroup.lift f) ∘ FreeAddSemigroup.of = f
theorem FreeSemigroup.lift_comp_of E0 #
∀ {α : Type u} {β : Type v} [inst : Semigroup β] (f : α → β), ⇑(FreeSemigroup.lift f) ∘ FreeSemigroup.of = f
theorem FreeSemigroup.lift_comp_of' E0 #
∀ {α : Type u} {β : Type v} [inst : Semigroup β] (f : FreeSemigroup α →ₙ* β),
FreeSemigroup.lift (⇑f ∘ FreeSemigroup.of) = f
theorem FreeAddSemigroup.lift_comp_of' E0 #
∀ {α : Type u} {β : Type v} [inst : AddSemigroup β] (f : FreeAddSemigroup α →ₙ+ β),
FreeAddSemigroup.lift (⇑f ∘ FreeAddSemigroup.of) = f
theorem FreeAddSemigroup.lift_of_add E1 #
∀ {α : Type u} {β : Type v} [inst : AddSemigroup β] (f : α → β) (x : α) (y : FreeAddSemigroup α),
(FreeAddSemigroup.lift f) (FreeAddSemigroup.of x + y) = f x + (FreeAddSemigroup.lift f) y
theorem FreeSemigroup.lift_of_mul E1 #
∀ {α : Type u} {β : Type v} [inst : Semigroup β] (f : α → β) (x : α) (y : FreeSemigroup α),
(FreeSemigroup.lift f) (FreeSemigroup.of x * y) = f x * (FreeSemigroup.lift f) y
def FreeSemigroup.map E1 #
{α : Type u} → {β : Type v} → (α → β) → FreeSemigroup α →ₙ* FreeSemigroup β
The unique semigroup homomorphism that sends of x to of (f x).
def FreeAddSemigroup.map E1 #
{α : Type u} → {β : Type v} → (α → β) → FreeAddSemigroup α →ₙ+ FreeAddSemigroup β
The unique additive semigroup homomorphism that sends of x to of (f x).
theorem FreeAddSemigroup.map_of E0 #
∀ {α : Type u} {β : Type v} (f : α → β) (x : α),
(FreeAddSemigroup.map f) (FreeAddSemigroup.of x) = FreeAddSemigroup.of (f x)
theorem FreeSemigroup.map_of E0 #
∀ {α : Type u} {β : Type v} (f : α → β) (x : α), (FreeSemigroup.map f) (FreeSemigroup.of x) = FreeSemigroup.of (f x)
theorem FreeAddSemigroup.length_map E0 #
∀ {α : Type u} {β : Type v} (f : α → β) (x : FreeAddSemigroup α), ((FreeAddSemigroup.map f) x).length = x.length
theorem FreeSemigroup.length_map E0 #
∀ {α : Type u} {β : Type v} (f : α → β) (x : FreeSemigroup α), ((FreeSemigroup.map f) x).length = x.length
instance FreeAddSemigroup.instMonad E0 #
Monad FreeAddSemigroup
instance FreeSemigroup.instMonad E0 #
Monad FreeSemigroup
def FreeSemigroup.recOnPure E1 #
{α : Type u} →
{C : FreeSemigroup α → Sort l} →
(x : FreeSemigroup α) →
((x : α) → C (pure x)) → ((x : α) → (y : FreeSemigroup α) → C (pure x) → C y → C (pure x * y)) → C x
Recursor that uses pure instead of of.
def FreeAddSemigroup.recOnPure E1 #
{α : Type u} →
{C : FreeAddSemigroup α → Sort l} →
(x : FreeAddSemigroup α) →
((x : α) → C (pure x)) → ((x : α) → (y : FreeAddSemigroup α) → C (pure x) → C y → C (pure x + y)) → C x
Recursor that uses pure instead of of.
theorem FreeAddSemigroup.map_pure E0 #
∀ {α β : Type u} (f : α → β) (x : α), f <$> pure x = pure (f x)
theorem FreeSemigroup.map_pure E0 #
∀ {α β : Type u} (f : α → β) (x : α), f <$> pure x = pure (f x)
theorem FreeAddSemigroup.map_add' E0 #
∀ {α β : Type u} (f : α → β) (x y : FreeAddSemigroup α), f <$> (x + y) = f <$> x + f <$> y
theorem FreeSemigroup.map_mul' E0 #
∀ {α β : Type u} (f : α → β) (x y : FreeSemigroup α), f <$> (x * y) = f <$> x * f <$> y
theorem FreeAddSemigroup.pure_bind E0 #
∀ {α β : Type u} (f : α → FreeAddSemigroup β) (x : α), pure x >>= f = f x
theorem FreeSemigroup.pure_bind E0 #
∀ {α β : Type u} (f : α → FreeSemigroup β) (x : α), pure x >>= f = f x
theorem FreeSemigroup.mul_bind E0 #
∀ {α β : Type u} (f : α → FreeSemigroup β) (x y : FreeSemigroup α), x * y >>= f = (x >>= f) * (y >>= f)
theorem FreeAddSemigroup.add_bind E0 #
∀ {α β : Type u} (f : α → FreeAddSemigroup β) (x y : FreeAddSemigroup α), x + y >>= f = (x >>= f) + (y >>= f)
theorem FreeAddSemigroup.pure_seq E0 #
∀ {α β : Type u} {f : α → β} {x : FreeAddSemigroup α}, pure f <*> x = f <$> x
theorem FreeSemigroup.pure_seq E0 #
∀ {α β : Type u} {f : α → β} {x : FreeSemigroup α}, pure f <*> x = f <$> x
theorem FreeAddSemigroup.add_seq E0 #
∀ {α β : Type u} {f g : FreeAddSemigroup (α → β)} {x : FreeAddSemigroup α}, f + g <*> x = (f <*> x) + (g <*> x)
theorem FreeSemigroup.mul_seq E0 #
∀ {α β : Type u} {f g : FreeSemigroup (α → β)} {x : FreeSemigroup α}, f * g <*> x = (f <*> x) * (g <*> x)
instance FreeAddSemigroup.instLawfulMonad E0 #
LawfulMonad FreeAddSemigroup
instance FreeSemigroup.instLawfulMonad E0 #
LawfulMonad FreeSemigroup
def FreeSemigroup.traverse E1 #
{m : Type u → Type u} → [Applicative m] → {α β : Type u} → (α → m β) → FreeSemigroup α → m (FreeSemigroup β)
FreeSemigroup is traversable.
def FreeAddSemigroup.traverse E1 #
{m : Type u → Type u} → [Applicative m] → {α β : Type u} → (α → m β) → FreeAddSemigroup α → m (FreeAddSemigroup β)
FreeAddSemigroup is traversable.
instance FreeSemigroup.instTraversable E0 #
Traversable FreeSemigroup
instance FreeAddSemigroup.instTraversable E0 #
Traversable FreeAddSemigroup
theorem FreeSemigroup.traverse_pure E0 #
∀ {α β : Type u} {m : Type u → Type u} [inst : Applicative m] (F : α → m β) (x : α), traverse F (pure x) = pure <$> F x
theorem FreeAddSemigroup.traverse_pure E0 #
∀ {α β : Type u} {m : Type u → Type u} [inst : Applicative m] (F : α → m β) (x : α), traverse F (pure x) = pure <$> F x
theorem FreeSemigroup.traverse_pure' E0 #
∀ {α β : Type u} {m : Type u → Type u} [inst : Applicative m] (F : α → m β), traverse F ∘ pure = fun x ↦ pure <$> F x
theorem FreeAddSemigroup.traverse_pure' E0 #
∀ {α β : Type u} {m : Type u → Type u} [inst : Applicative m] (F : α → m β), traverse F ∘ pure = fun x ↦ pure <$> F x
theorem FreeSemigroup.traverse_mul E0 #
∀ {α β : Type u} {m : Type u → Type u} [inst : Applicative m] (F : α → m β) [LawfulApplicative m]
(x y : FreeSemigroup α), traverse F (x * y) = (fun x1 x2 ↦ x1 * x2) <$> traverse F x <*> traverse F y
theorem FreeAddSemigroup.traverse_add E0 #
∀ {α β : Type u} {m : Type u → Type u} [inst : Applicative m] (F : α → m β) [LawfulApplicative m]
(x y : FreeAddSemigroup α), traverse F (x + y) = (fun x1 x2 ↦ x1 + x2) <$> traverse F x <*> traverse F y
theorem FreeSemigroup.traverse_mul' E0 #
∀ {α β : Type u} {m : Type u → Type u} [inst : Applicative m] (F : α → m β) [LawfulApplicative m],
Function.comp (traverse F) ∘ HMul.hMul = fun x y ↦ (fun x1 x2 ↦ x1 * x2) <$> traverse F x <*> traverse F y
theorem FreeAddSemigroup.traverse_add' E0 #
∀ {α β : Type u} {m : Type u → Type u} [inst : Applicative m] (F : α → m β) [LawfulApplicative m],
Function.comp (traverse F) ∘ HAdd.hAdd = fun x y ↦ (fun x1 x2 ↦ x1 + x2) <$> traverse F x <*> traverse F y
theorem FreeSemigroup.traverse_eq E0 #
∀ {α β : Type u} {m : Type u → Type u} [inst : Applicative m] (F : α → m β) (x : FreeSemigroup α),
FreeSemigroup.traverse F x = traverse F x
theorem FreeAddSemigroup.traverse_eq E0 #
∀ {α β : Type u} {m : Type u → Type u} [inst : Applicative m] (F : α → m β) (x : FreeAddSemigroup α),
FreeAddSemigroup.traverse F x = traverse F x
instance FreeSemigroup.instLawfulTraversable E0 #
LawfulTraversable FreeSemigroup
instance FreeAddSemigroup.instLawfulTraversable E0 #
LawfulTraversable FreeAddSemigroup
instance FreeAddSemigroup.instDecidableEq E0 #
{α : Type u} → [DecidableEq α] → DecidableEq (FreeAddSemigroup α)
instance FreeSemigroup.instDecidableEq E0 #
{α : Type u} → [DecidableEq α] → DecidableEq (FreeSemigroup α)
def FreeMagma.toFreeSemigroup E1 #
{α : Type u} → FreeMagma α →ₙ* FreeSemigroup α
The canonical multiplicative morphism from FreeMagma α to FreeSemigroup α.
def FreeAddMagma.toFreeAddSemigroup E1 #
{α : Type u} → FreeAddMagma α →ₙ+ FreeAddSemigroup α
The canonical additive morphism from FreeAddMagma α to FreeAddSemigroup α.
theorem FreeMagma.toFreeSemigroup_of E0 #
∀ {α : Type u} (x : α), FreeMagma.toFreeSemigroup (FreeMagma.of x) = FreeSemigroup.of x
theorem FreeAddMagma.toFreeAddSemigroup_of E0 #
∀ {α : Type u} (x : α), FreeAddMagma.toFreeAddSemigroup (FreeAddMagma.of x) = FreeAddSemigroup.of x
theorem FreeAddMagma.toFreeAddSemigroup_comp_of E0 #
∀ {α : Type u}, ⇑FreeAddMagma.toFreeAddSemigroup ∘ FreeAddMagma.of = FreeAddSemigroup.of
theorem FreeMagma.toFreeSemigroup_comp_of E0 #
∀ {α : Type u}, ⇑FreeMagma.toFreeSemigroup ∘ FreeMagma.of = FreeSemigroup.of
theorem FreeAddMagma.toFreeAddSemigroup_comp_map E1 #
∀ {α : Type u} {β : Type v} (f : α → β),
FreeAddMagma.toFreeAddSemigroup.comp (FreeAddMagma.map f) =
(FreeAddSemigroup.map f).comp FreeAddMagma.toFreeAddSemigroup
theorem FreeMagma.toFreeSemigroup_comp_map E1 #
∀ {α : Type u} {β : Type v} (f : α → β),
FreeMagma.toFreeSemigroup.comp (FreeMagma.map f) = (FreeSemigroup.map f).comp FreeMagma.toFreeSemigroup
theorem FreeAddMagma.toFreeAddSemigroup_map E1 #
∀ {α : Type u} {β : Type v} (f : α → β) (x : FreeAddMagma α),
FreeAddMagma.toFreeAddSemigroup ((FreeAddMagma.map f) x) =
(FreeAddSemigroup.map f) (FreeAddMagma.toFreeAddSemigroup x)
theorem FreeMagma.toFreeSemigroup_map E1 #
∀ {α : Type u} {β : Type v} (f : α → β) (x : FreeMagma α),
FreeMagma.toFreeSemigroup ((FreeMagma.map f) x) = (FreeSemigroup.map f) (FreeMagma.toFreeSemigroup x)
theorem FreeMagma.length_toFreeSemigroup E0 #
∀ {α : Type u} (x : FreeMagma α), (FreeMagma.toFreeSemigroup x).length = x.length
theorem FreeAddMagma.length_toFreeAddSemigroup E0 #
∀ {α : Type u} (x : FreeAddMagma α), (FreeAddMagma.toFreeAddSemigroup x).length = x.length
def FreeMagmaAssocQuotientEquiv E1 #
(α : Type u) → Magma.AssocQuotient (FreeMagma α) ≃* FreeSemigroup α
Isomorphism between Magma.AssocQuotient (FreeMagma α) and FreeSemigroup α.
def FreeAddMagmaAssocQuotientEquiv E1 #
(α : Type u) → AddMagma.FreeAddSemigroup (FreeAddMagma α) ≃+ FreeAddSemigroup α
Isomorphism between AddMagma.AssocQuotient (FreeAddMagma α) and
FreeAddSemigroup α.