The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V01. The language of Mathlib

Mathlib.Logic.OpClass

15 declarations. Mathlib docs · Source

class IsSymmOp E1 #

{α : Sort u} → {β : Sort v} → (α → α → β) → Prop

IsSymmOp op where op : α → α → β says that op is a symmetric operation, i.e. op a b = op b a. It is the natural generalisation of Std.Commutative (β = α) and IsSymm (β = Prop).

ctor IsSymmOp.mk E0 #

∀ {α : Sort u} {β : Sort v} {op : α → α → β}, (∀ (a b : α), op a b = op b a) → IsSymmOp op

theorem IsSymmOp.symm_op E1 #

∀ {α : Sort u} {β : Sort v} {op : α → α → β} [self : IsSymmOp op] (a b : α), op a b = op b a

A symmetric operation satisfies op a b = op b a.

class LeftCommutative E1 #

{α : Sort u} → {β : Sort v} → (α → β → β) → Prop

LeftCommutative op where op : α → β → β says that op is a left-commutative operation, i.e. op a₁ (op a₂ b) = op a₂ (op a₁ b).

ctor LeftCommutative.mk E0 #

∀ {α : Sort u} {β : Sort v} {op : α → β → β},
  (∀ (a₁ a₂ : α) (b : β), op a₁ (op a₂ b) = op a₂ (op a₁ b)) → LeftCommutative op

theorem LeftCommutative.left_comm E1 #

∀ {α : Sort u} {β : Sort v} {op : α → β → β} [self : LeftCommutative op] (a₁ a₂ : α) (b : β),
  op a₁ (op a₂ b) = op a₂ (op a₁ b)

A left-commutative operation satisfies op a₁ (op a₂ b) = op a₂ (op a₁ b).

class RightCommutative E1 #

{α : Sort u} → {β : Sort v} → (β → α → β) → Prop

RightCommutative op where op : β → α → β says that op is a right-commutative operation, i.e. op (op b a₁) a₂ = op (op b a₂) a₁.

ctor RightCommutative.mk E0 #

∀ {α : Sort u} {β : Sort v} {op : β → α → β},
  (∀ (b : β) (a₁ a₂ : α), op (op b a₁) a₂ = op (op b a₂) a₁) → RightCommutative op

theorem RightCommutative.right_comm E1 #

∀ {α : Sort u} {β : Sort v} {op : β → α → β} [self : RightCommutative op] (b : β) (a₁ a₂ : α),
  op (op b a₁) a₂ = op (op b a₂) a₁

A right-commutative operation satisfies op (op b a₁) a₂ = op (op b a₂) a₁.

instance isSymmOp_of_isCommutative E0 #

∀ (α : Sort u) (op : α → α → α) [Std.Commutative op], IsSymmOp op

theorem IsSymmOp.flip_eq E0 #

∀ {α : Sort u} {β : Sort v} (op : α → α → β) [IsSymmOp op], flip op = op

instance instRightCommutativeOfLeftCommutative E0 #

∀ {α : Sort u} {β : Sort v} {f : α → β → β} [h : LeftCommutative f], RightCommutative fun x y ↦ f y x

instance instLeftCommutativeOfRightCommutative E0 #

∀ {α : Sort u} {β : Sort v} {f : β → α → β} [h : RightCommutative f], LeftCommutative fun x y ↦ f y x

instance instLeftCommutativeOfCommutativeOfAssociative E0 #

∀ {α : Sort u} {f : α → α → α} [hc : Std.Commutative f] [ha : Std.Associative f], LeftCommutative f

instance instRightCommutativeOfCommutativeOfAssociative E0 #

∀ {α : Sort u} {f : α → α → α} [hc : Std.Commutative f] [ha : Std.Associative f], RightCommutative f