Code
structureimported Lean
Here we define a *Code* by an encdoder and a decoder. The encoder is a function that takes strings (Lists) of any length over an alphabet A, and returns strings over I; the decoder takes O and gives back strings over A. The idea is that a channel would map from strings of I to O. Important special cases are where I=O (the channel doesn't change the symbol set), and FixedLengthCode where the output lengths only depend on input lengths.
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in variable (A I O : Type*) in structure Code
- Defined in
- QuantumInfo, `Code`
- Lean proof
- By Alex Meiburg, from github.com/leanprover-community/physlib at
e411c6e89692(Copyright (c) 2025 Alex Meiburg. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.34.1.Code← Code (QuantumInfo/ClassicalInfo/Capacity.lean:26): verbatim
- Verified
- 17 Oct 2026
- Axioms
- none listed
- Used by 1
- FixedLengthCodeA
FixedLengthCodeis aCodewhose output lengths don't depend on the input content, only the input length.
- FixedLengthCodeA
Lean source view module on GitHub
set_option autoImplicit true in set_option relaxedAutoImplicit true in variable (A I O : Type*) in /-- Here we define a *Code* by an encdoder and a decoder. The encoder is a function that takes strings (`List`s) of any length over an alphabet `A`, and returns strings over `I`; the decoder takes `O` and gives back strings over `A`. The idea is that a channel would map from strings of `I` to `O`. Important special cases are where `I=O` (the channel doesn't change the symbol set), and `FixedLengthCode` where the output lengths only depend on input lengths. -/ structure Code where encoder : List A → List I decoder : List O → List A