Documentation

TauCeti.InformationTheory.Coding.Puncture.Basic

Puncturing and shortening additive and linear codes #

An additive code is an additive subgroup of the word space; its puncture is the image under restriction, and its shortening is the inverse image under extension by zero. These operations require only an abelian alphabet. Forgetting scalar closure commutes with both operations.

A linear code on coordinates ι is a submodule of the word space ι → F, as defined in TauCeti/InformationTheory/Coding/Basic.lean. Given a set s of coordinates to retain, puncturing restricts every codeword to s. Shortening first restricts to the codewords which vanish outside s, and then forgets those zero coordinates.

Neither the field nor the coordinate type is assumed finite; finiteness enters only in the dimension bounds. The API records membership, order preservation, the zero and whole-space cases, the comparison between shortening and puncturing, and dimension control. Restriction to the deleted coordinates has the shortened code as its kernel, so dim shorten C s + dim puncture C sᶜ = dim C. For a single deleted coordinate i this gives the exact dimensions: shortening at i drops the dimension by one precisely when some codeword is nonzero at i, and puncturing at i drops it by one precisely when the unit word at i is a codeword.

Main declarations #

References #

def TauCeti.AdditiveCode.puncture {A : Type u_1} {ι : Type u_2} [AddCommGroup A] (C : AdditiveCode A ι) (s : Set ι) :

Puncturing an additive code retains precisely the coordinates in s.

Instances For
    theorem TauCeti.AdditiveCode.puncture_def {A : Type u_1} {ι : Type u_2} [AddCommGroup A] (C : AdditiveCode A ι) (s : Set ι) :
    C.puncture s = AddSubgroup.map (AddMonoidHom.pi fun (i : ↑s) => Pi.evalAddMonoidHom (fun (x : ι) => A) ↑i) C

    Puncturing is the image under the coordinate restriction homomorphism.

    noncomputable def TauCeti.AdditiveCode.shorten {A : Type u_1} {ι : Type u_2} [AddCommGroup A] (C : AdditiveCode A ι) (s : Set ι) :

    Shortening retains the words whose extension by zero is a codeword.

    Instances For

      Shortening is the inverse image under extension by zero.

      @[simp]
      theorem TauCeti.AdditiveCode.mem_puncture {A : Type u_1} {ι : Type u_2} [AddCommGroup A] {C : AdditiveCode A ι} {s : Set ι} {y : ↑s → A} :
      y ∈ C.puncture s ↔ ∃ x ∈ C, ∀ (i : ↑s), x ↑i = y i

      A word belongs to the punctured code exactly when it restricts a codeword.

      @[simp]
      theorem TauCeti.AdditiveCode.mem_shorten_iff_extend_mem {A : Type u_1} {ι : Type u_2} [AddCommGroup A] {C : AdditiveCode A ι} {s : Set ι} {y : ↑s → A} :

      A word belongs to the shortened code exactly when its extension by zero belongs to the original code.

      theorem TauCeti.AdditiveCode.mem_shorten {A : Type u_1} {ι : Type u_2} [AddCommGroup A] {C : AdditiveCode A ι} {s : Set ι} {y : ↑s → A} :
      y ∈ C.shorten s ↔ ∃ x ∈ C, (∀ i ∉ s, x i = 0) ∧ ∀ (j : ↑s), x ↑j = y j

      Equivalently, shortening restricts the codewords that vanish outside the retained set.

      theorem TauCeti.AdditiveCode.shorten_le_puncture {A : Type u_1} {ι : Type u_2} [AddCommGroup A] (C : AdditiveCode A ι) (s : Set ι) :

      Every shortened word is a punctured word.

      theorem TauCeti.AdditiveCode.puncture_mono {A : Type u_1} {ι : Type u_2} [AddCommGroup A] {C D : AdditiveCode A ι} (h : C ≤ D) (s : Set ι) :

      Puncturing preserves inclusion of additive codes.

      theorem TauCeti.AdditiveCode.shorten_mono {A : Type u_1} {ι : Type u_2} [AddCommGroup A] {C D : AdditiveCode A ι} (h : C ≤ D) (s : Set ι) :

      Shortening preserves inclusion of additive codes.

      @[simp]
      theorem TauCeti.AdditiveCode.puncture_bot {A : Type u_1} {ι : Type u_2} [AddCommGroup A] (s : Set ι) :

      Puncturing the zero code gives the zero code.

      @[simp]
      theorem TauCeti.AdditiveCode.shorten_bot {A : Type u_1} {ι : Type u_2} [AddCommGroup A] (s : Set ι) :

      Shortening the zero code gives the zero code.

      @[simp]
      theorem TauCeti.AdditiveCode.puncture_top {A : Type u_1} {ι : Type u_2} [AddCommGroup A] (s : Set ι) :

      Puncturing the whole word space gives the whole retained word space.

      @[simp]
      theorem TauCeti.AdditiveCode.shorten_top {A : Type u_1} {ι : Type u_2} [AddCommGroup A] (s : Set ι) :

      Shortening the whole word space gives the whole retained word space.

      noncomputable def TauCeti.puncture {F : Type u_1} [Field F] {ι : Type u_2} (C : LinearCode F ι) (s : Set ι) :
      LinearCode F ↑s

      Puncturing a code at s retains precisely the coordinates in s.

      Instances For
        theorem TauCeti.puncture_def {F : Type u_1} [Field F] {ι : Type u_2} (C : LinearCode F ι) (s : Set ι) :

        Puncturing is the image under restriction to the retained coordinates.

        noncomputable def TauCeti.shorten {F : Type u_1} [Field F] {ι : Type u_2} (C : LinearCode F ι) (s : Set ι) :
        LinearCode F ↑s

        Shortening a code at s first imposes zero outside s, then retains the coordinates in s.

        Instances For
          theorem TauCeti.shorten_def {F : Type u_1} [Field F] {ι : Type u_2} (C : LinearCode F ι) (s : Set ι) :

          Shortening is the image under restriction of the words supported on the retained set.

          @[simp]

          Forgetting scalar closure commutes with puncturing a linear code.

          @[simp]

          Forgetting scalar closure commutes with shortening a linear code.

          @[simp]
          theorem TauCeti.mem_puncture {F : Type u_1} [Field F] {ι : Type u_2} {C : LinearCode F ι} {s : Set ι} {y : ↑s → F} :
          y ∈ puncture C s ↔ ∃ x ∈ C, ∀ (j : ↑s), x ↑j = y j

          A word belongs to the punctured code exactly when it is the restriction of a codeword.

          @[simp]
          theorem TauCeti.mem_shorten {F : Type u_1} [Field F] {ι : Type u_2} {C : LinearCode F ι} {s : Set ι} {y : ↑s → F} :
          y ∈ shorten C s ↔ ∃ x ∈ C, (∀ i ∉ s, x i = 0) ∧ ∀ (j : ↑s), x ↑j = y j

          A word belongs to the shortened code exactly when its extension by zero is a codeword: equivalently, it is the restriction of a codeword which vanishes off the retained set.

          theorem TauCeti.mem_shorten_iff_extend_mem {F : Type u_1} [Field F] {ι : Type u_2} {C : LinearCode F ι} {s : Set ι} {y : ↑s → F} :

          A word on the retained coordinates belongs to the shortened code exactly when its extension by zero belongs to the original code.

          theorem TauCeti.mem_puncture_singleton {F : Type u_1} [Field F] {ι : Type u_2} {C : LinearCode F ι} {i : ι} {y : ↑{i} → F} :
          y ∈ puncture C {i} ↔ ∃ x ∈ C, x i = y ⟨i, ⋯⟩

          Membership in a puncture retaining one coordinate is determined by that coordinate.

          theorem TauCeti.mem_shorten_singleton {F : Type u_1} [Field F] {ι : Type u_2} {C : LinearCode F ι} {i : ι} {y : ↑{i} → F} :
          y ∈ shorten C {i} ↔ ∃ x ∈ C, (∀ (j : ι), j ≠ i → x j = 0) ∧ x i = y ⟨i, ⋯⟩

          Membership in a shortening retaining one coordinate is determined by a codeword supported at that coordinate.

          noncomputable def TauCeti.punctureAt {F : Type u_1} [Field F] {ι : Type u_2} (C : LinearCode F ι) (i : ι) :

          Puncturing at i deletes that coordinate and retains all the others.

          Instances For
            theorem TauCeti.punctureAt_def {F : Type u_1} [Field F] {ι : Type u_2} (C : LinearCode F ι) (i : ι) :

            Puncturing at one coordinate is puncturing with its singleton complement retained.

            noncomputable def TauCeti.shortenAt {F : Type u_1} [Field F] {ι : Type u_2} (C : LinearCode F ι) (i : ι) :

            Shortening at i imposes zero there and retains all the other coordinates.

            Instances For
              theorem TauCeti.shortenAt_def {F : Type u_1} [Field F] {ι : Type u_2} (C : LinearCode F ι) (i : ι) :

              Shortening at one coordinate is shortening with its singleton complement retained.

              @[simp]
              theorem TauCeti.mem_punctureAt {F : Type u_1} [Field F] {ι : Type u_2} {C : LinearCode F ι} {i : ι} {y : ↑{i}ᶜ → F} :
              y ∈ punctureAt C i ↔ ∃ x ∈ C, ∀ (j : ↑{i}ᶜ), x ↑j = y j

              A word belongs to the code punctured at i exactly when it is the restriction of a codeword to the other coordinates.

              @[simp]
              theorem TauCeti.mem_shortenAt {F : Type u_1} [Field F] {ι : Type u_2} {C : LinearCode F ι} {i : ι} {y : ↑{i}ᶜ → F} :
              y ∈ shortenAt C i ↔ ∃ x ∈ C, x i = 0 ∧ ∀ (j : ↑{i}ᶜ), x ↑j = y j

              A word belongs to the code shortened at i exactly when it extends to a codeword which is zero at i.

              theorem TauCeti.shorten_le_puncture {F : Type u_1} [Field F] {ι : Type u_2} (C : LinearCode F ι) (s : Set ι) :

              Every shortened word is a punctured word.

              theorem TauCeti.puncture_mono {F : Type u_1} [Field F] {ι : Type u_2} {C D : LinearCode F ι} (h : C ≤ D) (s : Set ι) :

              Puncturing is monotone in the code.

              theorem TauCeti.shorten_mono {F : Type u_1} [Field F] {ι : Type u_2} {C D : LinearCode F ι} (h : C ≤ D) (s : Set ι) :

              Shortening is monotone in the code.

              @[simp]
              theorem TauCeti.puncture_bot {F : Type u_1} [Field F] {ι : Type u_2} (s : Set ι) :

              Puncturing sends the zero code to the zero code.

              @[simp]
              theorem TauCeti.shorten_bot {F : Type u_1} [Field F] {ι : Type u_2} (s : Set ι) :

              Shortening sends the zero code to the zero code.

              @[simp]
              theorem TauCeti.puncture_top {F : Type u_1} [Field F] {ι : Type u_2} (s : Set ι) :

              Puncturing the whole word space gives the whole word space on the retained coordinates.

              @[simp]
              theorem TauCeti.shorten_top {F : Type u_1} [Field F] {ι : Type u_2} (s : Set ι) :

              Shortening the whole word space gives the whole word space on the retained coordinates.

              theorem TauCeti.puncture_singleton_eq_top_iff {F : Type u_1} [Field F] {ι : Type u_2} {C : LinearCode F ι} {i : ι} :
              puncture C {i} = ⊤ ↔ ∃ x ∈ C, x i ≠ 0

              Puncturing to a single retained coordinate i gives the whole word space on {i} exactly when some codeword is nonzero at i.

              theorem TauCeti.shorten_singleton_eq_top_iff {F : Type u_1} [Field F] {ι : Type u_2} [DecidableEq ι] {C : LinearCode F ι} {i : ι} :

              Shortening to a single retained coordinate i gives the whole word space on {i} exactly when the unit word at i is a codeword.

              @[simp]
              theorem TauCeti.puncture_sup {F : Type u_1} [Field F] {ι : Type u_2} (C D : LinearCode F ι) (s : Set ι) :
              puncture (C ⊔ D) s = puncture C s ⊔ puncture D s

              Puncturing commutes with sums of codes.

              @[simp]
              theorem TauCeti.shorten_inf {F : Type u_1} [Field F] {ι : Type u_2} (C D : LinearCode F ι) (s : Set ι) :
              shorten (C ⊓ D) s = shorten C s ⊓ shorten D s

              Shortening commutes with intersections.

              theorem TauCeti.finrank_puncture_le {F : Type u_1} [Field F] {ι : Type u_2} (C : LinearCode F ι) [FiniteDimensional F ↥C] (s : Set ι) :

              Puncturing cannot increase dimension.

              theorem TauCeti.finrank_puncture_eq {F : Type u_1} [Field F] {ι : Type u_2} (C : LinearCode F ι) (s : Set ι) (h : ∀ x ∈ C, (∀ (j : ↑s), x ↑j = 0) → x = 0) :

              Puncturing preserves dimension when the only codeword vanishing at every retained coordinate is zero.

              theorem TauCeti.finrank_shorten_eq {F : Type u_1} [Field F] {ι : Type u_2} (C : LinearCode F ι) (s : Set ι) :
              Module.finrank F ↥(shorten C s) = Module.finrank F ↥(C ⊓ Submodule.pi sᶜ fun (x : ι) => ⊥)

              Shortening preserves the dimension of the subcode of words supported on the retained coordinates.

              theorem TauCeti.finrank_shorten_le {F : Type u_1} [Field F] {ι : Type u_2} (C : LinearCode F ι) [FiniteDimensional F ↥C] (s : Set ι) :

              Shortening cannot increase dimension.

              theorem TauCeti.finrank_shorten_add_finrank_puncture_compl {F : Type u_1} [Field F] {ι : Type u_2} (C : LinearCode F ι) [FiniteDimensional F ↥C] (s : Set ι) :

              Rank–nullity for shortening and puncturing. Restricting a code to the deleted coordinates sᶜ has kernel the words vanishing off s, which is the shortened code; so the dimensions of shorten C s and puncture C sᶜ add up to the dimension of C.

              theorem TauCeti.finrank_puncture_add_finrank_shorten_compl {F : Type u_1} [Field F] {ι : Type u_2} (C : LinearCode F ι) [FiniteDimensional F ↥C] (s : Set ι) :

              The dimensions of puncture C s and shorten C sᶜ add up to the dimension of C.

              theorem TauCeti.finrank_le_finrank_shorten_add_ncard_compl {F : Type u_1} [Field F] {ι : Type u_2} [Finite ι] (C : LinearCode F ι) (s : Set ι) :

              The dimension lost by shortening is at most the number of deleted coordinates.

              theorem TauCeti.finrank_le_finrank_puncture_add_ncard_compl {F : Type u_1} [Field F] {ι : Type u_2} [Finite ι] (C : LinearCode F ι) (s : Set ι) :

              The dimension lost by puncturing is at most the number of deleted coordinates.

              Deleting one coordinate #

              theorem TauCeti.finrank_shortenAt_add_one_of_exists_ne_zero {F : Type u_1} [Field F] {ι : Type u_2} (C : LinearCode F ι) [FiniteDimensional F ↥C] {i : ι} (h : ∃ x ∈ C, x i ≠ 0) :

              Shortening at i lowers the dimension by exactly one when some codeword is nonzero at i.

              theorem TauCeti.finrank_shortenAt_of_forall_eq_zero {F : Type u_1} [Field F] {ι : Type u_2} (C : LinearCode F ι) {i : ι} (h : ∀ x ∈ C, x i = 0) :

              Shortening at i preserves the dimension when every codeword vanishes at i.

              theorem TauCeti.finrank_punctureAt_add_one_of_single_mem {F : Type u_1} [Field F] {ι : Type u_2} [DecidableEq ι] (C : LinearCode F ι) [FiniteDimensional F ↥C] {i : ι} (h : Pi.single i 1 ∈ C) :

              Puncturing at i lowers the dimension by exactly one when the unit word at i is a codeword.

              theorem TauCeti.finrank_punctureAt_of_single_notMem {F : Type u_1} [Field F] {ι : Type u_2} [DecidableEq ι] (C : LinearCode F ι) {i : ι} (h : Pi.single i 1 ∉ C) :

              Puncturing at i preserves the dimension when the unit word at i is not a codeword.