Documentation

TCSlib.CodingTheory.Basic

Coding Theory — Core Definitions #

This file provides the foundational definitions for coding theory over a finite alphabet α.

Main Definitions #

Main Results #

@[reducible, inline]
abbrev CodingTheory.Codeword (n : ) (α : Type u_2) [Fintype α] [DecidableEq α] :
Type u_2

A codeword of block-length n over alphabet α. Concretely, a function Fin n → α.

Equations
Instances For
    def CodingTheory.Codeword.add {α : Type u_1} [Fintype α] [DecidableEq α] [Field α] {n : } (c₁ c₂ : Codeword n α) :

    Pointwise addition of two codewords.

    Equations
    • c₁.add c₂ i = c₁ i + c₂ i
    Instances For
      def CodingTheory.Codeword.sub {α : Type u_1} [Fintype α] [DecidableEq α] [Field α] {n : } (c₁ c₂ : Codeword n α) :

      Pointwise subtraction of two codewords.

      Equations
      • c₁.sub c₂ i = c₁ i - c₂ i
      Instances For
        def CodingTheory.Codeword.zero {α : Type u_1} [Fintype α] [DecidableEq α] [Field α] {n : } :

        The all-zeros codeword.

        Equations
        Instances For
          @[reducible, inline]
          abbrev CodingTheory.Codeword.Code (n : ) (α : Type u_2) [Fintype α] [DecidableEq α] :
          Type u_2

          A code of block-length n over α: a finite set of codewords.

          Equations
          Instances For
            def CodingTheory.Codeword.Linear_Code {α : Type u_1} [Fintype α] [DecidableEq α] [Field α] {n m : } (C : Code n α) (G : Matrix (Fin n) (Fin m) α) :

            A code C is linear with generator matrix G : Fin n × Fin m → α if C is exactly the image of the linear map G · -.

            Equations
            Instances For
              def CodingTheory.Codeword.Linear_Code' {α : Type u_1} [Fintype α] [DecidableEq α] [Field α] {n : } (C : Code n α) (m : ) :

              Existential variant of Linear_Code: C is the image of some n×m generator matrix.

              Equations
              Instances For
                noncomputable def CodingTheory.Codeword.qaryEntropy (q : ) (p : ) :

                The q-ary entropy function H_q(p) = p·log_q(q-1) - p·log_q(p) - (1-p)·log_q(1-p).

                Equations
                Instances For
                  def CodingTheory.Codeword.hamming_distance {α : Type u_1} [Fintype α] [DecidableEq α] {n : } (c1 c2 : Codeword n α) :

                  The Hamming distance between two codewords.

                  Equations
                  Instances For
                    def CodingTheory.Codeword.distance {α : Type u_1} [Fintype α] [DecidableEq α] {n : } (C : Code n α) (d : ) :

                    distance C d holds when d is the minimum Hamming distance of code C: there exist two distinct codewords at distance exactly d, and no two distinct codewords are closer.

                    Equations
                    Instances For
                      noncomputable def CodingTheory.Codeword.rate {α : Type u_1} [Fintype α] [DecidableEq α] {n : } (C : Code n α) :

                      The rate of a code: log_{|α|}(|C|) / n.

                      Equations
                      Instances For
                        def CodingTheory.Codeword.weight {α : Type u_1} [Fintype α] [DecidableEq α] [Field α] {n : } (c : Codeword n α) :

                        The Hamming weight of a codeword: its distance from the all-zeros word.

                        Equations
                        Instances For
                          def CodingTheory.Codeword.max_size {α : Type u_1} [Fintype α] [DecidableEq α] (n d A : ) :

                          max_size n d A asserts that A is the maximum size of any code of block-length n and minimum distance d.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            theorem CodingTheory.Codeword.dist_le_length {α : Type u_1} [Fintype α] [Nonempty α] [DecidableEq α] [Field α] {n : } (C : Code n α) (d : ) (h : distance C d) :
                            d n

                            The minimum distance of a code is at most the block length.

                            def CodingTheory.Codeword.hamming_ball {α : Type u_1} [Fintype α] [DecidableEq α] {n : } (l : ) (c : Codeword n α) :

                            The Hamming ball of radius l centred at codeword c: the set of codewords within Hamming distance l of c.

                            Equations
                            Instances For