Skip to content

Learn group ring and field from a rust programming language perspective.

License

Notifications You must be signed in to change notification settings

HaroldGin931/abstract_algebra_manual

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Abstract Algebra Manual

Learn group, ring, and field structures from a Rust programming language perspective.

Motivation

To understand the algebraic structures commonly used in cryptography, we often need to apply knowledge of abstract algebra. However, this knowledge is typically written in mathematical language, which can present challenges for developers. In essence, though, abstract algebra is about using abstract thinking to analyze and identify properties of mathematical objects, classifying and systematically discussing these properties. Once this perspective is understood, abstract algebra becomes much easier to grasp.

Rust, as a language with many excellent features, allows us to use traits and generics to define these abstract algebraic interfaces. By leveraging the compiler and test functions, we can create an introductory book on abstract algebra from a Rust perspective.

Usage

  1. cargo run, then play with it
  2. Reading the code
    1. algebra_trait
    2. algebra_checker
    3. algebra_struct
    4. examples folder
  3. Play it with ZKlings(Not implemented)

Challenge

The key challenge is that the target audience differs from that of traditional cryptography libraries.

In traditional cryptographic libraries, the operations defined are derived and proven to satisfy the relevant algebraic structure axioms. These libraries primarily focus on implementing these operations/algorithms in code and optimizing them as much as possible.

However, the goal of this project is to provide a set of traits related to algebraic structures, along with instances implemented based on these traits. It also offers exercises for users to try implementing some simple algebraic structures.

The project therefore needs to complete the relevant interfaces and test functions. However, the traits should not be overly restrictive; instead, users should be allowed the space to make mistakes. The test functions will then help check these implementations, showing them which axioms their defined operations fail to satisfy, and prompting them to reflect on the properties of these operations.

Roadmap

  • Stage 1: Implement a basic Group trait with finite groups and an axiom-check function.

  • Stage 2: Implement a basic Field trait with finite groups.

    • Group Axiom Checker
    • Field Axiom Checker
  • Stage 3: Traits should be defined more precisely.

    • Element inverse trait with defaut implement
    • Remove mut checker new structure should be
      • checker_close_associative(set, op) --> simigroup,
      • check_exist_id(simigroup) --> monoid,
      • check_inverse(monoid) --> group,
      • check_commutative(group) --> abelian group
  • Stage 4:

    • Element type, eg 'group.sample(0) --> group_element, group_element::new'
    • Define self::one and self::zero, ensuring they exist within the set.
    • Sub group
    • Gennerator
    • Order of group, order of element.
    • Option: default inverse operation of some common operation such like + *
    • graph example/group product,
  • Stage 5:

    • Ring Axiom Checker
    • Field extension
  • Stage 6:

    • Polynomial modulator
    • Linear combination
    • EC Curve example
    • Intergrate with ZKling

About

Learn group ring and field from a rust programming language perspective.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages