The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V34. The tactics of Mathlib

Mathlib.Tactic.Linter.DirectoryDependency

3 declarations. Mathlib docs · Source

The directoryDependency linter

The directoryDependency linter detects imports between directories that are supposed to be independent. By specifying that one directory does not import from another, we can improve the modularity of Mathlib.

def findImports E1 #

System.FilePath → IO (Array Lean.Name)

Parse all imports in a text file at path and return just their names: this is just a thin wrapper around Lean.parseImports'. Omit Init (which is part of the prelude).

opaque Mathlib.Linter.linter.directoryDependency E1 #

Lean.Option Bool

The directoryDependency linter detects imports between directories that are supposed to be independent. If this is the case, it emits a warning.

def Mathlib.Linter.directoryDependencyCheck E1 #

System.FilePath → Lean.Name → Lean.Elab.Command.CommandElabM (Array Lean.MessageData)

Runs the directoryDependency linter on the current module, assuming that it is called mainModule. Detects imports between directories that are supposed to be independent. If this is the case, it emits a warning.

Note: we look in srcDir for scripts/forbiddenDirs.json and, if in mathlib, for Mathlib.Init. srcDir is thus typically expected to be the package directory (e.g. {path}/mathlib4).