Skip to content
  •  
  •  
  •  
55 changes: 55 additions & 0 deletions LeanPool/FiniteIntegralRelationAlgebras.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/-
Copyright (c) 2026 Chris Henson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Henson
-/

/-
Adapted from chenson2018/finite-integral-ra at 5620a22cc48127b592bca85b1aaf013e55d4f6df.
The relation-algebra foundations are adapted from CSLib at 910210f7d155e22a2244591e394bd16fbb0ddbb3.
The upstream Rust generator supplies certificate data, and Lean checks that data in the kernel.
-/

module

public import LeanPool.FiniteIntegralRelationAlgebras.Atoms1.Symm0Nsymm0
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms1.Total
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms2.Symm1Nsymm0
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms2.Total
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms3.Symm0Nsymm1
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms3.Symm2Nsymm0
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms3.Total
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms4.Symm1Nsymm1
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms4.Symm3Nsymm0
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms4.Total
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms5.Symm0Nsymm2
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms5.Symm2Nsymm1
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms5.Symm4Nsymm0
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms5.Total
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms6.Symm1Nsymm2
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms6.Symm3Nsymm1
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms6.Symm5Nsymm0
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms6.Total
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms7.Symm0Nsymm3
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms7.Symm2Nsymm2
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms7.Symm4Nsymm1
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms7.Symm6Nsymm0
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms7.Total

/-!
# Enumeration of finite integral relation algebras through seven atoms

Source: url:https://www1.chapman.edu/~jipsen/gap/ramaddux.html
Authors: Chris Henson
Status: verified
Main declarations:
`FiniteIntegralRelationAlgebras.RelationAlgebra.IntegralAtom.IsoClass.card_ofAtoms_one`,
`FiniteIntegralRelationAlgebras.RelationAlgebra.IntegralAtom.IsoClass.card_ofAtoms_two`,
`FiniteIntegralRelationAlgebras.RelationAlgebra.IntegralAtom.IsoClass.card_ofAtoms_three`,
`FiniteIntegralRelationAlgebras.RelationAlgebra.IntegralAtom.IsoClass.card_ofAtoms_four`,
`FiniteIntegralRelationAlgebras.RelationAlgebra.IntegralAtom.IsoClass.card_ofAtoms_five`,
`FiniteIntegralRelationAlgebras.RelationAlgebra.IntegralAtom.IsoClass.card_ofAtoms_six`,
`FiniteIntegralRelationAlgebras.RelationAlgebra.IntegralAtom.IsoClass.card_ofAtoms_seven`
Tags: relation-algebras, enumeration, isomorphism-classes, proof-certificates
MSC: 03G15, 05A15, 68V20
-/
42 changes: 42 additions & 0 deletions LeanPool/FiniteIntegralRelationAlgebras/Atoms1/S0N0/C0.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/-
Copyright (c) 2026 Chris Henson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Henson
-/

module

public import LeanPool.FiniteIntegralRelationAlgebras.Cert.Eval

/-! Generated certificate (see `certgen`): symmetry class 0 of type (0, 0). -/

@[expose] public section

namespace RACert.S0N0.C0

open RACert RACert.Problem

/-- The counting problem of this class. -/
def P : Problem where
s := 0
n := 0
perm := [0]
pinv := [0]
V := 0
cls := [[[1]]]
reps := []
path := [[[0]]]
quads := []
wit := [[[[0]]]]

theorem check : P.check = true := by decide +kernel

theorem rows : P.checkRows = true := by decide +kernel

theorem total : P.sumLeaves 0 0 1 = 1 := by decide +kernel

/-- The number of lawful cycle sets invariant under the symmetry of this class. -/
theorem count : fixCountL 0 0 [0] = 1 :=
fixCountL_of_total (P := P) check rows (by decide +kernel) (by decide +kernel) total

end RACert.S0N0.C0
37 changes: 37 additions & 0 deletions LeanPool/FiniteIntegralRelationAlgebras/Atoms1/S0N0/Group.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/-
Copyright (c) 2026 Chris Henson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Henson
-/

module

public import LeanPool.FiniteIntegralRelationAlgebras.Cert.Group
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms1.S0N0.C0

/-! Generated certificate (see `certgen`): Burnside count for type (0, 0). -/

@[expose] public section

namespace RACert.S0N0

open RACert

/-- Representatives of the conjugacy classes of the symmetry group. -/
def reps : List (List ℕ) :=
[[0]]

/-- All elements of the symmetry group, with their class and a conjugator. -/
def elems : List (List ℕ × ℕ × List ℕ) :=
[([0], 0, [0])]

theorem groupCert : checkGroup 0 0 reps elems = true := by decide +kernel

/-- The number of isomorphism classes of integral relation algebras of type (0, 0). -/
theorem count : Nat.card
(FiniteIntegralRelationAlgebras.RelationAlgebra.IntegralAtom.IsoClass.ofSymmNsymm 0 0) = 1 :=
card_ofSymmNsymm_of_groupCert' 0 0 1 reps elems [1] groupCert
(.cons C0.count (.nil))
(by decide +kernel)

end RACert.S0N0
21 changes: 21 additions & 0 deletions LeanPool/FiniteIntegralRelationAlgebras/Atoms1/Symm0Nsymm0.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/-
Copyright (c) 2026 Chris Henson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Henson
-/

module

public import LeanPool.FiniteIntegralRelationAlgebras.Foundations.RelationAlgebra.IntegralAtomStructure
import LeanPool.FiniteIntegralRelationAlgebras.Atoms1.S0N0.Group

/-! Count the isomorphism classes with the specified symmetric and nonsymmetric atoms. -/

public section

namespace FiniteIntegralRelationAlgebras.RelationAlgebra.IntegralAtom.IsoClass

theorem card_ofSymmNsymm_zero_zero : Nat.card (ofSymmNsymm 0 0) = 1 :=
RACert.S0N0.count

end FiniteIntegralRelationAlgebras.RelationAlgebra.IntegralAtom.IsoClass
20 changes: 20 additions & 0 deletions LeanPool/FiniteIntegralRelationAlgebras/Atoms1/Total.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/-
Copyright (c) 2026 Chris Henson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Henson
-/

module

public import LeanPool.FiniteIntegralRelationAlgebras.Atoms1.Symm0Nsymm0

/-! Combine the counts by symmetry type for relation algebras with 1 atoms. -/

public section

namespace FiniteIntegralRelationAlgebras.RelationAlgebra.IntegralAtom.IsoClass

theorem card_ofAtoms_one : Nat.card (ofAtoms 1) = 1 := by
simpa [card_ofAtoms_succ_eq_sum_ofSymmNsymm] using card_ofSymmNsymm_zero_zero

end FiniteIntegralRelationAlgebras.RelationAlgebra.IntegralAtom.IsoClass
47 changes: 47 additions & 0 deletions LeanPool/FiniteIntegralRelationAlgebras/Atoms2/S1N0/C0.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/-
Copyright (c) 2026 Chris Henson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Henson
-/

module

public import LeanPool.FiniteIntegralRelationAlgebras.Cert.Eval

/-! Generated certificate (see `certgen`): symmetry class 0 of type (1, 0). -/

@[expose] public section

namespace RACert.S1N0.C0

open RACert RACert.Problem

/-- The counting problem of this class. -/
def P : Problem where
s := 1
n := 0
perm := [0, 1]
pinv := [0, 1]
V := 1
cls := [[[1, 0], [0, 1]],
[[0, 1], [1, 2]]]
reps := [7]
path := [[[0, 0], [0, 0]],
[[0, 0], [0, 0]]]
quads := [15]
wit := [[[[0, 0], [0, 0]],
[[0, 0], [0, 0]]],
[[[0, 0], [0, 0]],
[[0, 0], [0, 0]]]]

theorem check : P.check = true := by decide +kernel

theorem rows : P.checkRows = true := by decide +kernel

theorem total : P.sumLeaves 1 0 1 = 2 := by decide +kernel

/-- The number of lawful cycle sets invariant under the symmetry of this class. -/
theorem count : fixCountL 1 0 [0, 1] = 2 :=
fixCountL_of_total (P := P) check rows (by decide +kernel) (by decide +kernel) total

end RACert.S1N0.C0
37 changes: 37 additions & 0 deletions LeanPool/FiniteIntegralRelationAlgebras/Atoms2/S1N0/Group.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/-
Copyright (c) 2026 Chris Henson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Henson
-/

module

public import LeanPool.FiniteIntegralRelationAlgebras.Cert.Group
public import LeanPool.FiniteIntegralRelationAlgebras.Atoms2.S1N0.C0

/-! Generated certificate (see `certgen`): Burnside count for type (1, 0). -/

@[expose] public section

namespace RACert.S1N0

open RACert

/-- Representatives of the conjugacy classes of the symmetry group. -/
def reps : List (List ℕ) :=
[[0, 1]]

/-- All elements of the symmetry group, with their class and a conjugator. -/
def elems : List (List ℕ × ℕ × List ℕ) :=
[([0, 1], 0, [0, 1])]

theorem groupCert : checkGroup 1 0 reps elems = true := by decide +kernel

/-- The number of isomorphism classes of integral relation algebras of type (1, 0). -/
theorem count : Nat.card
(FiniteIntegralRelationAlgebras.RelationAlgebra.IntegralAtom.IsoClass.ofSymmNsymm 1 0) = 2 :=
card_ofSymmNsymm_of_groupCert' 1 0 2 reps elems [2] groupCert
(.cons C0.count (.nil))
(by decide +kernel)

end RACert.S1N0
21 changes: 21 additions & 0 deletions LeanPool/FiniteIntegralRelationAlgebras/Atoms2/Symm1Nsymm0.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/-
Copyright (c) 2026 Chris Henson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Henson
-/

module

public import LeanPool.FiniteIntegralRelationAlgebras.Foundations.RelationAlgebra.IntegralAtomStructure
import LeanPool.FiniteIntegralRelationAlgebras.Atoms2.S1N0.Group

/-! Count the isomorphism classes with the specified symmetric and nonsymmetric atoms. -/

public section

namespace FiniteIntegralRelationAlgebras.RelationAlgebra.IntegralAtom.IsoClass

theorem card_ofSymmNsymm_one_zero : Nat.card (ofSymmNsymm 1 0) = 2 :=
RACert.S1N0.count

end FiniteIntegralRelationAlgebras.RelationAlgebra.IntegralAtom.IsoClass
20 changes: 20 additions & 0 deletions LeanPool/FiniteIntegralRelationAlgebras/Atoms2/Total.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/-
Copyright (c) 2026 Chris Henson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Henson
-/

module

public import LeanPool.FiniteIntegralRelationAlgebras.Atoms2.Symm1Nsymm0

/-! Combine the counts by symmetry type for relation algebras with 2 atoms. -/

public section

namespace FiniteIntegralRelationAlgebras.RelationAlgebra.IntegralAtom.IsoClass

theorem card_ofAtoms_two : Nat.card (ofAtoms 2) = 2 := by
simpa [card_ofAtoms_succ_eq_sum_ofSymmNsymm] using card_ofSymmNsymm_one_zero

end FiniteIntegralRelationAlgebras.RelationAlgebra.IntegralAtom.IsoClass
54 changes: 54 additions & 0 deletions LeanPool/FiniteIntegralRelationAlgebras/Atoms3/S0N1/C0.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/-
Copyright (c) 2026 Chris Henson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Henson
-/

module

public import LeanPool.FiniteIntegralRelationAlgebras.Cert.Eval

/-! Generated certificate (see `certgen`): symmetry class 0 of type (0, 1). -/

@[expose] public section

namespace RACert.S0N1.C0

open RACert RACert.Problem

/-- The counting problem of this class. -/
def P : Problem where
s := 0
n := 1
perm := [0, 1, 2]
pinv := [0, 1, 2]
V := 2
cls := [[[1, 0, 0], [0, 1, 0], [0, 0, 1]],
[[0, 1, 0], [0, 2, 3], [1, 2, 2]],
[[0, 0, 1], [1, 2, 2], [0, 3, 2]]]
reps := [13, 14]
path := [[[0, 0, 0], [0, 0, 0], [0, 0, 0]],
[[0, 0, 0], [0, 0, 0], [0, 2, 10]],
[[0, 0, 0], [0, 1, 17], [0, 1, 81]]]
quads := [40, 41, 43, 49]
wit := [[[[0, 0, 0], [0, 0, 0], [0, 0, 0]],
[[0, 0, 0], [0, 0, 0], [0, 0, 0]],
[[0, 0, 0], [0, 0, 0], [0, 0, 0]]],
[[[0, 0, 0], [0, 0, 0], [0, 0, 0]],
[[0, 0, 0], [0, 0, 0], [0, 0, 21]],
[[0, 0, 0], [0, 0, 5], [0, 9, 2]]],
[[[0, 0, 0], [0, 0, 0], [0, 0, 0]],
[[0, 0, 0], [0, 1, 1], [0, 22, 1]],
[[0, 0, 0], [0, 6, 5], [0, 2, 2]]]]

theorem check : P.check = true := by decide +kernel

theorem rows : P.checkRows = true := by decide +kernel

theorem total : P.sumLeaves 2 0 1 = 3 := by decide +kernel

/-- The number of lawful cycle sets invariant under the symmetry of this class. -/
theorem count : fixCountL 0 1 [0, 1, 2] = 3 :=
fixCountL_of_total (P := P) check rows (by decide +kernel) (by decide +kernel) total

end RACert.S0N1.C0
Loading
Loading