AFTD Auto-Formalizing Theoretical Domains

FixedLengthCode

structureimported Lean

A FixedLengthCode is a Code whose output lengths don't depend on the input content, only the input length.

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
variable (A I O : Type*) in
structure FixedLengthCode extends Code A I O
Defined in
QuantumInfo, `FixedLengthCode`
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.
Verified
17 Oct 2026
Axioms
none listed
Built on 1
  • CodeHere we define a *Code* by an encdoder and a decoder. The encoder is a function that takes strings (Lists) of any length over an…

Lean source view module on GitHub

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
variable (A I O : Type*) in
/-- A `FixedLengthCode` is a `Code` whose output lengths don't depend on the input content, only the input length. -/
structure FixedLengthCode extends Code A I O where
  enc_length : ℕ → ℕ
  enc_maps_length : ∀ as, (encoder as).length = enc_length (as.length)
  dec_length : ℕ → ℕ
  dec_maps_length : ∀ is, (decoder is).length = dec_length (is.length)
See it in the graphDiscuss this resultChallenge it