# Mathlib conventions and deviations The repository contains two libraries: `ErgodicTheory` (sources in `ErgodicTheory/`) and `OperatorEntropy` (sources in `OperatorEntropy/`, finite-dimensional quantum entropy). The `OperatorEntropy` library does not import `ErgodicTheory`; within `ErgodicTheory` only the modules in `ErgodicTheory/Quantum/` import `OperatorEntropy`. Both are built with Mathlib's standard linter set (`-Dweak.linter.mathlibStandardSet=true`) and with warnings promoted to errors (`-DwarningAsError=true`, see `lakefile.toml`), so style regressions fail `lake build`. Naming, docstrings and file headers follow the Mathlib conventions. This note records the places where the libraries deviate from what a Mathlib PR would require. Paths below are relative to `ErgodicTheory/`, except those starting with `OperatorEntropy/`, which are relative to the repository root. ## `maxHeartbeats` bumps (7) Each has a comment at the use site. | File | Value | Reason | |---|---|---| | `Lyapunov/OseledetsLimit/ProjectorIncrement.lean` (3×) | 1.6M, 1.6M, 3.2M | elaboration of `⋀^k`-indexed compound / Plücker statements | | `Lyapunov/ExteriorNorm/Plucker.lean` | 1.6M | same | | `Livsic/Flow/HolderConstRoof.lean` | 1.6M | long four-way case analysis | | `Livsic/Flow/HolderVarRoof.lean` | 3.2M | four-way case analysis with change of variables | | `Examples/CatMap/AdlerWeiss/Geometry.lean` | 1.6M | `nlinarith` over 4 regions × 9 lattice candidates | ## Linter disables (28 `set_option linter.* false`) - `linter.unusedSimpArgs` (12, all in `OperatorEntropy/DephasingNoRecovery.lean`): branchy `fin_cases`/`simp` matrix computations in which each branch uses a different subset of the simp set. - `linter.unusedFintypeInType` (9), `linter.unusedDecidableInType` (5), `linter.unusedSectionVars` (2), in `OperatorEntropy/` (`DataProcessing/Twirl`, `DataProcessing/Channels`, `Petz/KadisonSchwarz`, `Petz/Support`), `Multifractal/` (`Renyi/Rate`, `Renyi/Bernoulli`, `Bernoulli/Suspension/FlowEntropy`, `Bernoulli/Suspension/CondEntropy`) and `Livsic/BiShift/UnstableOscillation.lean`: instances that the proofs need (for `cfc`, `Matrix.trace`, finite sums or entropy bounds) but that do not occur syntactically in the statements. Every disable carries a one-line justification at the use site. ## Environment linter `lake exe runLinter OperatorEntropy` and `lake exe runLinter ErgodicTheory` (Mathlib's `#lint` set; `make lint` runs both) report no findings. No `@[nolint]` attributes are used; typeclass arguments that a declaration does not use (such as `[NeZero d]`, `[IsProbabilityMeasure μ]` or `[Fintype n]`) are not present, with `omit [...] in` where the argument comes from a section `variable`. ## Module system Every file of both libraries (and the two root files) is a Lean `module`, written as Mathlib writes its files: copyright header, `module`, `public import` lines, the module docstring, then `@[expose] public section` over the whole file, so that definition bodies stay unfoldable downstream and every non-`private` declaration is public. `private` declarations keep their old scope (their file). Points where the migration needed more than the header change: - In a module only `public import`s are re-exported, while a non-module importer of Mathlib received every transitive import. Files that used Mathlib declarations reachable only through a private import of some Mathlib module now import the defining module directly. - A public statement may not mention a `private` declaration. Six such definitions are therefore public: `cexVec` (`OperatorEntropy/AlickiFannes/AbelianRestriction.lean`), `hodgeForm` (`Lyapunov/ExteriorNorm/Basic.lean`), `growthSeq` (`Lyapunov/GrowthFunction.lean`), `Aclm` (`Lyapunov/Filtration.lean`), `diagMap` (`Entropy/Ruelle/SharpCovering.lean`) and `makerSum` (`Krieger/SMB/ChungMaker.lean`, marked `@[no_expose]` because its body uses private definitions). - `MeasureTheory.AnalyticSet` is `@[no_expose]` in Mathlib; the two files that unfold it (`MeasureTheory/AnalyticUniversallyMeasurable.lean`, `MeasureTheory/NovikovSeparation.lean`) use `import all Mathlib.MeasureTheory.Constructions.Polish.Basic`, as Mathlib does for such unfoldings. - `test/AxiomAudit.lean` stays a plain (non-module) file. A non-module importer loads the full proofs, so `#print axioms` reports the same axiom sets as before the migration. ## Declarations in Mathlib namespaces Project declarations live in the `ErgodicTheory` and `OperatorEntropy` namespaces (one per library). A few lemmas about Mathlib objects stay in Mathlib namespaces so that dot notation works; they are marked `-- candidate for Mathlib`: - `Matrix`: `rank_eq_card_iff_det_ne_zero`, `le_rank_of_submatrix_det_ne_zero`, `exists_submatrix_id_rank_eq`, `exists_submatrix_det_ne_zero_of_le_rank`, `le_rank_iff_exists_submatrix_det_ne_zero`, `l2_opNorm_le_sum_norm_basisFun`; - `LinearMap`: `singularValues_le_opNorm`, `norm_apply_eigenvectorBasis_eq_singularValues`, `norm_apply_le_top_singularValue`; - `MeasureTheory.AnalyticSet`: `cap_eq_iSup_isCompact`, `compactCap_eq`, and the closure lemmas `inter`, `union`, `prod` (`MeasureTheory/AnalyticSetLemmas.lean`); - `Metric.IsSeparated.pairwiseDisjoint_closedBall`, `isCompletelyMetrizableSpace_of_compactSpace`, the joint continuity of `(f, ν) ↦ f_* ν` on probability measures (`MeasureTheory/PushforwardContinuous.lean`), and the instance `IsProbabilityMeasure (volume : Measure UnitAddCircle)`. ## Other deviations - All files are below Mathlib's 1500-line limit. - Module docstrings cite references in prose (`## References`); the corresponding BibTeX entries are in `blueprint/src/references.bib`. - The axiom audit (`test/AxiomAudit.lean`) uses `#print axioms`, which Mathlib forbids in library code; it is therefore a separate, unlinted Lean library.