Skip to content

Proof obligation for minDist_eq_minDist in ArkLib/Data/CodingTheory/InterleavedCode.lean #225

Description

@alexanderlhicks

A proof in ArkLib/Data/CodingTheory/InterleavedCode.lean contains a sorry.

🤖 AI Analysis:

Statement Explanation

This theorem claims that the minimum distance of a LawfulInterleavedCode is equal to the minimum distance of its underlying linear code LC.

The left-hand side, Code.minDist (IC.1.LC : Set (ι → F)), refers to the standard minimum Hamming distance of the linear code LC. This is the smallest number of positions in which any two distinct codewords from LC differ.

The right-hand side, minDist IC.1.MF, is the minimum distance defined for the interleaved code. The InterleavedCode consists of a submodule of matrices, IC.1.MF. The distance between two matrices is defined as the number of columns in which they are not identical (distCodewords). Thus, minDist IC.1.MF is the minimum number of differing columns between any two distinct matrices in the submodule MF.

The hypothesis IC : LawfulInterleavedCode provides the crucial link: IC.isInterleaved guarantees that every row of any matrix in MF is a codeword in LC.

Context

This lemma is a fundamental result connecting the two main components of an InterleavedCode structure: the matrix submodule MF and the linear code LC. It essentially states that, for a lawfully constructed interleaved code, the minimum distance property is preserved from the underlying linear code.

The proof will likely involve unfolding the definitions of minDist for both types of codes and relating them using the properties of submodules and the isInterleaved condition. Note that for linear codes (which are submodules), the minimum distance between distinct codewords is equal to the minimum weight of a non-zero codeword. You will likely find it easier to work with weights instead of distances.

A potential subtlety lies in the generality of the type {IC : LawfulInterleavedCode κ ι F}. The proof for one direction of the equality () holds for any LawfulInterleavedCode. However, the other direction () seems to require that the matrix submodule MF is "rich" enough to contain specific matrices constructed from single codewords of LC. This property is guaranteed if IC is built using the canonical constructor lawfulInterleavedCodeOfLinearCode, but it might not hold for an arbitrary LawfulInterleavedCode. You may also need to handle the edge case where κ is an empty type, perhaps by adding a [Nonempty κ] hypothesis.

Proof Suggestion

A standard way to prove an equality is to show both inequalities. The le_antisymm tactic is useful here. The proof can be structured as follows, reasoning about minimum weights instead of minimum distances.

  1. Proof for Code.minDist (IC.1.LC) ≤ minDist (IC.1.MF):

    • Let d_MF be the minimum weight of a non-zero matrix in IC.1.MF. By definition, there is a matrix W ∈ IC.1.MF with W ≠ 0 and distCodewords W 0 = d_MF.
    • Since W is non-zero, it must have at least one non-zero row. Let's call it w, where w = W i for some row index i.
    • Using the isInterleaved property (IC.2), you can deduce that this row w is a non-zero codeword in IC.1.LC.
    • The minimum distance (or weight) of LC must be less than or equal to the weight of any of its non-zero codewords. Thus, Code.minDist (IC.1.LC) ≤ Code.wt w.
    • Relate the weight of the row w to the weight of the matrix W. The set of indices where w is non-zero is a subset of the set of indices of non-zero columns of W. This implies Code.wt w ≤ distCodewords W 0.
    • Combine these inequalities to conclude this direction of the proof.
  2. Proof for minDist (IC.1.MF) ≤ Code.minDist (IC.1.LC):

    • This part is more subtle and may require you to assume [Nonempty κ].
    • Let d_LC be the minimum distance of IC.1.LC. Let w be a codeword in LC with Code.wt w = d_LC.
    • The goal is to find a matrix W ∈ IC.1.MF whose weight is d_LC. A good candidate is a matrix that has w as one of its rows and is zero everywhere else.
    • Pick an arbitrary i₀ : κ (which is possible if κ is non-empty). Construct a matrix W such that W i₀ = w and W i = 0 for all i ≠ i₀.
    • You need to show this W is in IC.1.MF. This is where the structure of MF matters. If IC is constructed via codeOfLinearCode, then MF is matrixSubmoduleOfLinearCode κ (IC.1.LC), which is the span of all matrices whose rows are in LC. Your constructed W is one of these generating matrices, so it is in MF.
    • Calculate the weight of W: distCodewords W 0. Show that it is exactly equal to Code.wt w, which is d_LC.
    • Since you've found a matrix in MF with weight d_LC, the minimum weight of MF can be no larger. This establishes minDist (IC.1.MF) ≤ d_LC.

Goal: Replace the sorry with a complete proof.

Link to the sorry on GitHub

Code Snippet:

lemma minDist_eq_minDist [DecidableEq F] {IC : LawfulInterleavedCode κ ι F} :
  Code.minDist (IC.1.LC : Set (ι → F)) = minDist IC.1.MF := by sorry

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions