Module docstring
{"# Invariant basis number property
Main definitions
Let R be a (not necessary commutative) ring.
InvariantBasisNumber Ris a type class stating that(Fin n → R) ≃ₗ[R] (Fin m → R)impliesn = m, a property known as the invariant basis number property.This assumption implies that there is a well-defined notion of the rank of a finitely generated free (left)
R-module.
It is also useful to consider the following stronger conditions:
The rank condition, witnessed by the type class
RankCondition R, states that the existence of a surjective linear map(Fin n → R) →ₗ[R] (Fin m → R)impliesm ≤ n.The strong rank condition, witnessed by the type class
StrongRankCondition R, states that the existence of an injective linear map(Fin n → R) →ₗ[R] (Fin m → R)impliesn ≤ m.OrzechProperty R, defined inMathlib/RingTheory/OrzechProperty.lean, states that for any finitely generatedR-moduleM, any surjective homomorphismf : N → Mfrom a submoduleNofMtoMis injective.
Instances
IsNoetherianRing.orzechProperty(defined inMathlib/RingTheory/Noetherian.lean) : any left-noetherian ring satisfies the Orzech property. This applies in particular to division rings.strongRankCondition_of_orzechProperty: the Orzech property implies the strong rank condition (for non trivial rings).IsNoetherianRing.strongRankCondition: every nontrivial left-noetherian ring satisfies the strong rank condition (and so in particular every division ring or field).rankCondition_of_strongRankCondition: the strong rank condition implies the rank condition.invariantBasisNumber_of_rankCondition: the rank condition implies the invariant basis number property.invariantBasisNumber_of_nontrivial_of_commRing: a nontrivial commutative ring satisfies the invariant basis number property.
More generally, every commutative ring satisfies the Orzech property,
hence the strong rank condition, which is proved in Mathlib/RingTheory/FiniteType.lean.
We keep invariantBasisNumber_of_nontrivial_of_commRing here since it imports fewer files.
Counterexamples to converse results
The following examples can be found in the book of Lam [lam_1999] (see also https://math.stackexchange.com/questions/4711904):
- Let 
kbe a field, then the free (non-commutative) algebrak⟨x, y⟩satisfies the rank condition but not the strong rank condition. - The free (non-commutative) algebra 
ℚ⟨a, b, c, d⟩quotient by the two-sided ideal(ac − 1, bd − 1, ab, cd)satisfies the invariant basis number property but not the rank condition. 
Future work
So far, there is no API at all for the InvariantBasisNumber class. There are several natural
ways to formulate that a module M is finitely generated and free, for example
M ≃ₗ[R] (Fin n → R), M ≃ₗ[R] (ι → R), where ι is a fintype, or providing a basis indexed by
a finite type. There should be lemmas applying the invariant basis number property to each
situation.
The finite version of the invariant basis number property implies the infinite analogue, i.e., that
(ι →₀ R) ≃ₗ[R] (ι' →₀ R) implies that Cardinal.mk ι = Cardinal.mk ι'. This fact (and its
variants) should be formalized.
References
- https://en.wikipedia.org/wiki/Invariantbasisnumber
 - https://mathoverflow.net/a/2574/
 - [Lam, T. Y. Lectures on Modules and Rings][lam_1999]
 - [Orzech, Morris. Onto endomorphisms are isomorphisms][orzech1971]
 - [Djoković, D. Ž. Epimorphisms of modules which must be isomorphisms][djokovic1973]
 - [Ribenboim, Paulo. Épimorphismes de modules qui sont nécessairement des isomorphismes][ribenboim1971]
 
Tags
free module, rank, Orzech property, (strong) rank condition, invariant basis number, IBN
","We want to show that nontrivial commutative rings have invariant basis number. The idea is to
  take a maximal ideal I of R and use an isomorphism R^n ≃ R^m of R modules to produce an
  isomorphism (R/I)^n ≃ (R/I)^m of R/I-modules, which will imply n = m since R/I is a field
  and we know that fields have invariant basis number.
We construct the isomorphism in two steps:
  1. We construct the ring R^n/I^n, show that it is an R/I-module and show that there is an
     isomorphism of R/I-modules R^n/I^n ≃ (R/I)^n. This isomorphism is called
    Ideal.piQuotEquiv and is located in the file RingTheory/Ideals.lean.
  2. We construct an isomorphism of R/I-modules R^n/I^n ≃ R^m/I^m using the isomorphism
     R^n ≃ R^m.
"}