mathlib documentation


Racks and Quandles #

THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.

This file defines racks and quandles, algebraic structures for sets that bijectively act on themselves with a self-distributivity property. If R is a rack and act : R → (R ≃ R) is the self-action, then the self-distributivity is, equivalently, that

act (act x y) = act x * act y * (act x)⁻¹

where multiplication is composition in R ≃ R as a group. Quandles are racks such that act x x = x for all x.

One example of a quandle (not yet in mathlib) is the action of a Lie algebra on itself, defined by act x y = Ad (exp x) y.

Quandles and racks were independently developed by multiple mathematicians. David Joyce introduced quandles in his thesis [Joy82] to define an algebraic invariant of knot and link complements that is analogous to the fundamental group of the exterior, and he showed that the quandle associated to an oriented knot is invariant up to orientation-reversed mirror image. Racks were used by Fenn and Rourke for framed codimension-2 knots and links in [FR92]. Unital shelves are discussed in [CMP17].

The name "rack" came from wordplay by Conway and Wraith for the "wrack and ruin" of forgetting everything but the conjugation operation for a group.

Main definitions #

Main statements #

Implementation notes #

"Unital racks" are uninteresting (see rack.assoc_iff_id, unital_shelf.assoc), so we do not define them.

Notation #

The following notation is localized in quandles:

Use open_locale quandles to use these.

Todo #

Tags #

rack, quandle

structure shelf (α : Type u) :

A shelf is a structure with a self-distributive binary operation. The binary operation is regarded as a left action of the type on itself.

Instances of this typeclass
Instances of other typeclasses for shelf
  • shelf.has_sizeof_inst
structure unital_shelf (α : Type u) :

A unital shelf is a shelf equipped with an element 1 such that, for all elements x, we have both x ◃ 1 and 1 ◃ x equal x.

Instances for unital_shelf
  • unital_shelf.has_sizeof_inst
theorem shelf_hom.ext {S₁ : Type u_1} {S₂ : Type u_2} {_inst_1 : shelf S₁} {_inst_2 : shelf S₂} (x y : shelf_hom S₁ S₂) (h : x.to_fun = y.to_fun) :
x = y
structure shelf_hom (S₁ : Type u_1) (S₂ : Type u_2) [shelf S₁] [shelf S₂] :
Type (max u_1 u_2)

The type of homomorphisms between shelves. This is also the notion of rack and quandle homomorphisms.

Instances for shelf_hom
theorem shelf_hom.ext_iff {S₁ : Type u_1} {S₂ : Type u_2} {_inst_1 : shelf S₁} {_inst_2 : shelf S₂} (x y : shelf_hom S₁ S₂) :
x = y x.to_fun = y.to_fun
structure rack (α : Type u) :

A rack is an automorphic set (a set with an action on itself by bijections) that is self-distributive. It is a shelf such that each element's action is invertible.

The notations x ◃ y and x ◃⁻¹ y denote the action and the inverse action, respectively, and they are right associative.

Instances of this typeclass
Instances of other typeclasses for rack
  • rack.has_sizeof_inst
theorem unital_shelf.act_act_self_eq {S : Type u_1} [unital_shelf S] (x y : S) :

A monoid is graphic if, for all x and y, the graphic identity (x * y) * x = x * y holds. For a unital shelf, this graphic identity holds.

theorem unital_shelf.act_idem {S : Type u_1} [unital_shelf S] (x : S) :
shelf.act x x = x
theorem unital_shelf.act_self_act_eq {S : Type u_1} [unital_shelf S] (x y : S) :
theorem unital_shelf.assoc {S : Type u_1} [unital_shelf S] (x y z : S) :

The associativity of a unital shelf comes for free.

theorem rack.self_distrib {R : Type u_1} [rack R] {x y z : R} :
def rack.act {R : Type u_1} [rack R] (x : R) :

A rack acts on itself by equivalences.

theorem rack.act_apply {R : Type u_1} [rack R] (x y : R) :
theorem rack.act_symm_apply {R : Type u_1} [rack R] (x y : R) :
theorem rack.inv_act_apply {R : Type u_1} [rack R] (x y : R) :
theorem rack.inv_act_act_eq {R : Type u_1} [rack R] (x y : R) :
theorem rack.act_inv_act_eq {R : Type u_1} [rack R] (x y : R) :
theorem rack.left_cancel {R : Type u_1} [rack R] (x : R) {y y' : R} :
shelf.act x y = shelf.act x y' y = y'
theorem rack.left_cancel_inv {R : Type u_1} [rack R] (x : R) {y y' : R} :
theorem rack.self_distrib_inv {R : Type u_1} [rack R] {x y z : R} :
theorem rack.ad_conj {R : Type u_1} [rack R] (x y : R) :

The adjoint action of a rack on itself is op', and the adjoint action of x ◃ y is the conjugate of the action of y by the action of x. It is another way to understand the self-distributivity axiom.

This is used in the natural rack homomorphism to_conj from R to conj (R ≃ R) defined by op'.

@[protected, instance]
def rack.opposite_rack {R : Type u_1} [rack R] :

The opposite rack, swapping the roles of and ◃⁻¹.

theorem rack.self_act_act_eq {R : Type u_1} [rack R] {x y : R} :
theorem rack.self_inv_act_inv_act_eq {R : Type u_1} [rack R] {x y : R} :
theorem rack.self_act_inv_act_eq {R : Type u_1} [rack R] {x y : R} :
theorem rack.self_inv_act_act_eq {R : Type u_1} [rack R] {x y : R} :
theorem rack.self_act_eq_iff_eq {R : Type u_1} [rack R] {x y : R} :
shelf.act x x = shelf.act y y x = y
theorem rack.self_inv_act_eq_iff_eq {R : Type u_1} [rack R] {x y : R} :
def rack.self_apply_equiv (R : Type u_1) [rack R] :

The map x ↦ x ◃ x is a bijection. (This has applications for the regular isotopy version of the Reidemeister I move for knot diagrams.)

def rack.is_involutory (R : Type u_1) [rack R] :

An involutory rack is one for which rack.op R x is an involution for every x.

theorem rack.involutory_inv_act_eq_act {R : Type u_1} [rack R] (h : rack.is_involutory R) (x y : R) :
def rack.is_abelian (R : Type u_1) [rack R] :

An abelian rack is one for which the mediality axiom holds.

theorem rack.assoc_iff_id {R : Type u_1} [rack R] {x y z : R} :

Associative racks are uninteresting.

@[protected, instance]
def shelf_hom.has_coe_to_fun {S₁ : Type u_1} {S₂ : Type u_2} [shelf S₁] [shelf S₂] :
has_coe_to_fun (shelf_hom S₁ S₂) (λ (_x : shelf_hom S₁ S₂), S₁ S₂)
theorem shelf_hom.to_fun_eq_coe {S₁ : Type u_1} {S₂ : Type u_2} [shelf S₁] [shelf S₂] (f : shelf_hom S₁ S₂) :
theorem shelf_hom.map_act {S₁ : Type u_1} {S₂ : Type u_2} [shelf S₁] [shelf S₂] (f : shelf_hom S₁ S₂) {x y : S₁} :
f (shelf.act x y) = shelf.act (f x) (f y)
def (S : Type u_1) [shelf S] :

The identity homomorphism

@[protected, instance]
def shelf_hom.inhabited (S : Type u_1) [shelf S] :
def shelf_hom.comp {S₁ : Type u_1} {S₂ : Type u_2} {S₃ : Type u_3} [shelf S₁] [shelf S₂] [shelf S₃] (g : shelf_hom S₂ S₃) (f : shelf_hom S₁ S₂) :
shelf_hom S₁ S₃

The composition of shelf homomorphisms

theorem shelf_hom.comp_apply {S₁ : Type u_1} {S₂ : Type u_2} {S₃ : Type u_3} [shelf S₁] [shelf S₂] [shelf S₃] (g : shelf_hom S₂ S₃) (f : shelf_hom S₁ S₂) (x : S₁) :
(g.comp f) x = g (f x)
structure quandle (α : Type u_1) :
Type u_1

A quandle is a rack such that each automorphism fixes its corresponding element.

Instances of this typeclass
Instances of other typeclasses for quandle
  • quandle.has_sizeof_inst
theorem quandle.fix_inv {Q : Type u_1} [quandle Q] {x : Q} :
def quandle.conj (G : Type u_1) :
Type u_1

The conjugation quandle of a group. Each element of the group acts by the corresponding inner automorphism.

Instances for quandle.conj
@[protected, instance]
theorem quandle.conj_act_eq_conj {G : Type u_1} [group G] (x y : quandle.conj G) :
shelf.act x y = x * y * x⁻¹
theorem quandle.conj_swap {G : Type u_1} [group G] (x y : quandle.conj G) :
shelf.act x y = y shelf.act y x = x
def {G : Type u_1} {H : Type u_2} [group G] [group H] (f : G →* H) :

conj is functorial

@[protected, instance]
def quandle.shelf_hom.has_lift {G : Type u_1} {H : Type u_2} [group G] [group H] :
def quandle.dihedral (n : ) :

The dihedral quandle. This is the conjugation quandle of the dihedral group restrict to flips.

Used for Fox n-colorings of knots.

Instances for quandle.dihedral
def quandle.dihedral_act (n : ) (a : zmod n) :

The operation for the dihedral quandle. It does not need to be an equivalence because it is an involution (see dihedral_act.inv).

def rack.to_conj (R : Type u_1) [rack R] :

This is the natural rack homomorphism to the conjugation quandle of the group R ≃ R that acts on the rack.


Universal enveloping group of a rack #

The universal enveloping group envel_group R of a rack R is the universal group such that every rack homomorphism R →◃ conj G is induced by a unique group homomorphism envel_group R →* G. For quandles, Joyce called this group AdConj R.

The envel_group functor is left adjoint to the conj forgetful functor, and the way we construct the enveloping group is via a technique that should work for left adjoints of forgetful functors in general. It involves thinking a little about 2-categories, but the payoff is that the map envel_group R →* G has a nice description.

Let's think of a group as being a one-object category. The first step is to define pre_envel_group, which gives formal expressions for all the 1-morphisms and includes the unit element, elements of R, multiplication, and inverses. To introduce relations, the second step is to define pre_envel_group_rel', which gives formal expressions for all 2-morphisms between the 1-morphisms. The 2-morphisms include associativity, multiplication by the unit, multiplication by inverses, compatibility with multiplication and inverses (congr_mul and congr_inv), the axioms for an equivalence relation, and, importantly, the relationship between conjugation and the rack action (see rack.ad_conj).

None of this forms a 2-category yet, for example due to lack of associativity of trans. The pre_envel_group_rel relation is a Prop-valued version of pre_envel_group_rel', and making it Prop-valued essentially introduces enough 3-isomorphisms so that every pair of compatible 2-morphisms is isomorphic. Now, while composition in pre_envel_group does not strictly satisfy the category axioms, pre_envel_group and pre_envel_group_rel' do form a weak 2-category.

Since we just want a 1-category, the last step is to quotient pre_envel_group by pre_envel_group_rel', and the result is the group envel_group.

For a homomorphism f : R →◃ conj G, how does f : envel_group R →* G work? Let's think of G as being a 2-category with one object, a 1-morphism per element of G, and a single 2-morphism called eq.refl for each 1-morphism. We define the map using a "higher quotient.lift" -- not only do we evaluate elements of pre_envel_group as expressions in G (this is to_envel_group.map_aux), but we evaluate elements of pre_envel_group' as expressions of 2-morphisms of G (this is to_envel_group.map_aux.well_def). That is to say, to_envel_group.map_aux.well_def recursively evaluates formal expressions of 2-morphisms as equality proofs in G. Now that all morphisms are accounted for, the map descends to a homomorphism envel_group R →* G.

Note: Type-valued relations are not common. The fact it is Type-valued is what makes to_envel_group.map_aux.well_def have well-founded recursion.

inductive rack.pre_envel_group (R : Type u) :

Free generators of the enveloping group.

Instances for rack.pre_envel_group

Relations for the enveloping group. This is a type-valued relation because to_envel_group.map_aux.well_def inducts on it to show is well-defined. The relation pre_envel_group_rel is the Prop-valued version, which is used to define envel_group itself.

Instances for rack.pre_envel_group_rel'

The pre_envel_group_rel relation as a Prop. Used as the relation for pre_envel_group.setoid.

A quick way to convert a pre_envel_group_rel' to a pre_envel_group_rel.

@[protected, instance]
def rack.envel_group (R : Type u_1) [rack R] :
Type u_1

The universal enveloping group for the rack R.

Instances for rack.envel_group
@[protected, instance]

The canonical homomorphism from a rack to its enveloping group. Satisfies universal properties given by and to_envel_group.univ.


Show that to_envel_group.map_aux sends equivalent expressions to equal terms.

def {R : Type u_1} [rack R] {G : Type u_2} [group G] :

Given a map from a rack to a group, lift it to being a map from the enveloping group. More precisely, the envel_group functor is left adjoint to quandle.conj.


Given a homomorphism from a rack to a group, it factors through the enveloping group.

The homomorphism f is the unique map that fits into the commutative triangle in to_envel_group.univ.

def rack.envel_action {R : Type u_1} [rack R] :

The induced group homomorphism from the enveloping group into bijections of the rack, using rack.to_conj. Satisfies the property envel_action_prop.

This gives the rack R the structure of an augmented rack over envel_group R.

theorem rack.envel_action_prop {R : Type u_1} [rack R] (x y : R) :