linear_algebra.free_algebraMathlib.LinearAlgebra.FreeAlgebra

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -5,7 +5,7 @@ Authors: Eric Wieser
 -/
 import LinearAlgebra.Basis
 import Algebra.FreeAlgebra
-import LinearAlgebra.Dimension
+import LinearAlgebra.Dimension.Basic
 import LinearAlgebra.FinsuppVectorSpace
 
 #align_import linear_algebra.free_algebra from "leanprover-community/mathlib"@"814d76e2247d5ba8bc024843552da1278bfe9e5c"
Diff
@@ -3,10 +3,10 @@ Copyright (c) 2021 Eric Wieser. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
 -/
-import Mathbin.LinearAlgebra.Basis
-import Mathbin.Algebra.FreeAlgebra
-import Mathbin.LinearAlgebra.Dimension
-import Mathbin.LinearAlgebra.FinsuppVectorSpace
+import LinearAlgebra.Basis
+import Algebra.FreeAlgebra
+import LinearAlgebra.Dimension
+import LinearAlgebra.FinsuppVectorSpace
 
 #align_import linear_algebra.free_algebra from "leanprover-community/mathlib"@"814d76e2247d5ba8bc024843552da1278bfe9e5c"
 
Diff
@@ -2,17 +2,14 @@
 Copyright (c) 2021 Eric Wieser. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
-
-! This file was ported from Lean 3 source module linear_algebra.free_algebra
-! leanprover-community/mathlib commit 814d76e2247d5ba8bc024843552da1278bfe9e5c
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.LinearAlgebra.Basis
 import Mathbin.Algebra.FreeAlgebra
 import Mathbin.LinearAlgebra.Dimension
 import Mathbin.LinearAlgebra.FinsuppVectorSpace
 
+#align_import linear_algebra.free_algebra from "leanprover-community/mathlib"@"814d76e2247d5ba8bc024843552da1278bfe9e5c"
+
 /-!
 # Linear algebra properties of `free_algebra R X`
 
Diff
@@ -28,6 +28,7 @@ universe u v
 
 namespace FreeAlgebra
 
+#print FreeAlgebra.basisFreeMonoid /-
 /-- The `free_monoid X` basis on the `free_algebra R X`,
 mapping `[x₁, x₂, ..., xₙ]` to the "monomial" `1 • x₁ * x₂ * ⋯ * xₙ` -/
 @[simps]
@@ -36,12 +37,15 @@ noncomputable def basisFreeMonoid (R : Type u) (X : Type v) [CommRing R] :
   Finsupp.basisSingleOne.map
     (equivMonoidAlgebraFreeMonoid.symm.toLinearEquiv : _ ≃ₗ[R] FreeAlgebra R X)
 #align free_algebra.basis_free_monoid FreeAlgebra.basisFreeMonoid
+-/
 
+#print FreeAlgebra.rank_eq /-
 -- TODO: generalize to `X : Type v`
 theorem rank_eq {K : Type u} {X : Type max u v} [Field K] :
     Module.rank K (FreeAlgebra K X) = Cardinal.mk (List X) :=
   (Cardinal.lift_inj.mp (basisFreeMonoid K X).mk_eq_rank).symm
 #align free_algebra.rank_eq FreeAlgebra.rank_eq
+-/
 
 end FreeAlgebra
 
Diff
@@ -28,12 +28,6 @@ universe u v
 
 namespace FreeAlgebra
 
-/- warning: free_algebra.basis_free_monoid -> FreeAlgebra.basisFreeMonoid is a dubious translation:
-lean 3 declaration is
-  forall (R : Type.{u1}) (X : Type.{u2}) [_inst_1 : CommRing.{u1} R], Basis.{u2, u1, max u1 u2} (FreeMonoid.{u2} X) R (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)) (AddCommGroup.toAddCommMonoid.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (NonUnitalNonAssocRing.toAddCommGroup.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (NonAssocRing.toNonUnitalNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (Ring.toNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (FreeAlgebra.ring.{u2, u1} X R _inst_1))))) (Algebra.toModule.{u1, max u1 u2} R (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (CommRing.toCommSemiring.{u1} R _inst_1) (FreeAlgebra.semiring.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (FreeAlgebra.algebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X))
-but is expected to have type
-  forall (R : Type.{u1}) (X : Type.{u2}) [_inst_1 : CommRing.{u1} R], Basis.{u2, u1, max u2 u1} (FreeMonoid.{u2} X) R (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (NonAssocRing.toNonUnitalNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (Ring.toNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (FreeAlgebra.instRingFreeAlgebraToCommSemiring.{u2, u1} X R _inst_1))))) (Algebra.toModule.{u1, max u1 u2} R (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (CommRing.toCommSemiring.{u1} R _inst_1) (FreeAlgebra.instSemiringFreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (FreeAlgebra.instAlgebraFreeAlgebraInstSemiringFreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X))
-Case conversion may be inaccurate. Consider using '#align free_algebra.basis_free_monoid FreeAlgebra.basisFreeMonoidₓ'. -/
 /-- The `free_monoid X` basis on the `free_algebra R X`,
 mapping `[x₁, x₂, ..., xₙ]` to the "monomial" `1 • x₁ * x₂ * ⋯ * xₙ` -/
 @[simps]
@@ -43,12 +37,6 @@ noncomputable def basisFreeMonoid (R : Type u) (X : Type v) [CommRing R] :
     (equivMonoidAlgebraFreeMonoid.symm.toLinearEquiv : _ ≃ₗ[R] FreeAlgebra R X)
 #align free_algebra.basis_free_monoid FreeAlgebra.basisFreeMonoid
 
-/- warning: free_algebra.rank_eq -> FreeAlgebra.rank_eq is a dubious translation:
-lean 3 declaration is
-  forall {K : Type.{u1}} {X : Type.{max u1 u2}} [_inst_1 : Field.{u1} K], Eq.{succ (succ (max u1 u2))} Cardinal.{max u1 u2} (Module.rank.{u1, max u1 u2} K (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (Ring.toSemiring.{u1} K (DivisionRing.toRing.{u1} K (Field.toDivisionRing.{u1} K _inst_1))) (AddCommGroup.toAddCommMonoid.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (NonUnitalNonAssocRing.toAddCommGroup.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (NonAssocRing.toNonUnitalNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (Ring.toNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (FreeAlgebra.ring.{max u1 u2, u1} X K (EuclideanDomain.toCommRing.{u1} K (Field.toEuclideanDomain.{u1} K _inst_1))))))) (Algebra.toModule.{u1, max u1 u2} K (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) (FreeAlgebra.semiring.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (FreeAlgebra.algebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X))) (Cardinal.mk.{max u1 u2} (List.{max u1 u2} X))
-but is expected to have type
-  forall {K : Type.{u1}} {X : Type.{max u1 u2}} [_inst_1 : Field.{u1} K], Eq.{max (succ (succ u1)) (succ (succ u2))} Cardinal.{max u1 u2} (Module.rank.{u1, max u1 u2} K (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (NonAssocRing.toNonUnitalNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (Ring.toNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (FreeAlgebra.instRingFreeAlgebraToCommSemiring.{max u1 u2, u1} X K (EuclideanDomain.toCommRing.{u1} K (Field.toEuclideanDomain.{u1} K _inst_1))))))) (Algebra.toModule.{u1, max u1 u2} K (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) (FreeAlgebra.instSemiringFreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (FreeAlgebra.instAlgebraFreeAlgebraInstSemiringFreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X))) (Cardinal.mk.{max u1 u2} (List.{max u1 u2} X))
-Case conversion may be inaccurate. Consider using '#align free_algebra.rank_eq FreeAlgebra.rank_eqₓ'. -/
 -- TODO: generalize to `X : Type v`
 theorem rank_eq {K : Type u} {X : Type max u v} [Field K] :
     Module.rank K (FreeAlgebra K X) = Cardinal.mk (List X) :=
Diff
@@ -47,7 +47,7 @@ noncomputable def basisFreeMonoid (R : Type u) (X : Type v) [CommRing R] :
 lean 3 declaration is
   forall {K : Type.{u1}} {X : Type.{max u1 u2}} [_inst_1 : Field.{u1} K], Eq.{succ (succ (max u1 u2))} Cardinal.{max u1 u2} (Module.rank.{u1, max u1 u2} K (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (Ring.toSemiring.{u1} K (DivisionRing.toRing.{u1} K (Field.toDivisionRing.{u1} K _inst_1))) (AddCommGroup.toAddCommMonoid.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (NonUnitalNonAssocRing.toAddCommGroup.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (NonAssocRing.toNonUnitalNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (Ring.toNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (FreeAlgebra.ring.{max u1 u2, u1} X K (EuclideanDomain.toCommRing.{u1} K (Field.toEuclideanDomain.{u1} K _inst_1))))))) (Algebra.toModule.{u1, max u1 u2} K (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) (FreeAlgebra.semiring.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (FreeAlgebra.algebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X))) (Cardinal.mk.{max u1 u2} (List.{max u1 u2} X))
 but is expected to have type
-  forall {K : Type.{u1}} {X : Type.{max u1 u2}} [_inst_1 : Field.{u1} K], Eq.{max (succ (succ u1)) (succ (succ u2))} Cardinal.{max u1 u2} (Module.rank.{u1, max u1 u2} K (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (NonAssocRing.toNonUnitalNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (Ring.toNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (FreeAlgebra.instRingFreeAlgebraToCommSemiring.{max u1 u2, u1} X K (Field.toCommRing.{u1} K _inst_1)))))) (Algebra.toModule.{u1, max u1 u2} K (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) (FreeAlgebra.instSemiringFreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (FreeAlgebra.instAlgebraFreeAlgebraInstSemiringFreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X))) (Cardinal.mk.{max u1 u2} (List.{max u1 u2} X))
+  forall {K : Type.{u1}} {X : Type.{max u1 u2}} [_inst_1 : Field.{u1} K], Eq.{max (succ (succ u1)) (succ (succ u2))} Cardinal.{max u1 u2} (Module.rank.{u1, max u1 u2} K (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (NonAssocRing.toNonUnitalNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (Ring.toNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (FreeAlgebra.instRingFreeAlgebraToCommSemiring.{max u1 u2, u1} X K (EuclideanDomain.toCommRing.{u1} K (Field.toEuclideanDomain.{u1} K _inst_1))))))) (Algebra.toModule.{u1, max u1 u2} K (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) (FreeAlgebra.instSemiringFreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (FreeAlgebra.instAlgebraFreeAlgebraInstSemiringFreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X))) (Cardinal.mk.{max u1 u2} (List.{max u1 u2} X))
 Case conversion may be inaccurate. Consider using '#align free_algebra.rank_eq FreeAlgebra.rank_eqₓ'. -/
 -- TODO: generalize to `X : Type v`
 theorem rank_eq {K : Type u} {X : Type max u v} [Field K] :
Diff
@@ -32,7 +32,7 @@ namespace FreeAlgebra
 lean 3 declaration is
   forall (R : Type.{u1}) (X : Type.{u2}) [_inst_1 : CommRing.{u1} R], Basis.{u2, u1, max u1 u2} (FreeMonoid.{u2} X) R (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)) (AddCommGroup.toAddCommMonoid.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (NonUnitalNonAssocRing.toAddCommGroup.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (NonAssocRing.toNonUnitalNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (Ring.toNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (FreeAlgebra.ring.{u2, u1} X R _inst_1))))) (Algebra.toModule.{u1, max u1 u2} R (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (CommRing.toCommSemiring.{u1} R _inst_1) (FreeAlgebra.semiring.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (FreeAlgebra.algebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X))
 but is expected to have type
-  forall (R : Type.{u1}) (X : Type.{u2}) [_inst_1 : CommRing.{u1} R], Basis.{u2, u1, max u2 u1} (FreeMonoid.{u2} X) R (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (NonAssocRing.toNonUnitalNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (Ring.toNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (FreeAlgebra.instRingFreeAlgebraToCommSemiring.{u2, u1} X R _inst_1))))) (Algebra.toModule.{u1, max u1 u2} R (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (CommRing.toCommSemiring.{u1} R _inst_1) (FreeAlgebra.instSemiringFreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (FreeAlgebra.instAlgebraFreeAlgebraInstSemiringFreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X))
+  forall (R : Type.{u1}) (X : Type.{u2}) [_inst_1 : CommRing.{u1} R], Basis.{u2, u1, max u2 u1} (FreeMonoid.{u2} X) R (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (NonAssocRing.toNonUnitalNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (Ring.toNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (FreeAlgebra.instRingFreeAlgebraToCommSemiring.{u2, u1} X R _inst_1))))) (Algebra.toModule.{u1, max u1 u2} R (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (CommRing.toCommSemiring.{u1} R _inst_1) (FreeAlgebra.instSemiringFreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (FreeAlgebra.instAlgebraFreeAlgebraInstSemiringFreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X))
 Case conversion may be inaccurate. Consider using '#align free_algebra.basis_free_monoid FreeAlgebra.basisFreeMonoidₓ'. -/
 /-- The `free_monoid X` basis on the `free_algebra R X`,
 mapping `[x₁, x₂, ..., xₙ]` to the "monomial" `1 • x₁ * x₂ * ⋯ * xₙ` -/
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
 
 ! This file was ported from Lean 3 source module linear_algebra.free_algebra
-! leanprover-community/mathlib commit 039a089d2a4b93c761b234f3e5f5aeb752bac60f
+! leanprover-community/mathlib commit 814d76e2247d5ba8bc024843552da1278bfe9e5c
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -16,6 +16,9 @@ import Mathbin.LinearAlgebra.FinsuppVectorSpace
 /-!
 # Linear algebra properties of `free_algebra R X`
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file provides a `free_monoid X` basis on the `free_algebra R X`, and uses it to show the
 dimension of the algebra is the cardinality of `list X`
 -/
Diff
@@ -25,6 +25,12 @@ universe u v
 
 namespace FreeAlgebra
 
+/- warning: free_algebra.basis_free_monoid -> FreeAlgebra.basisFreeMonoid is a dubious translation:
+lean 3 declaration is
+  forall (R : Type.{u1}) (X : Type.{u2}) [_inst_1 : CommRing.{u1} R], Basis.{u2, u1, max u1 u2} (FreeMonoid.{u2} X) R (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)) (AddCommGroup.toAddCommMonoid.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (NonUnitalNonAssocRing.toAddCommGroup.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (NonAssocRing.toNonUnitalNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (Ring.toNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (FreeAlgebra.ring.{u2, u1} X R _inst_1))))) (Algebra.toModule.{u1, max u1 u2} R (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (CommRing.toCommSemiring.{u1} R _inst_1) (FreeAlgebra.semiring.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (FreeAlgebra.algebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X))
+but is expected to have type
+  forall (R : Type.{u1}) (X : Type.{u2}) [_inst_1 : CommRing.{u1} R], Basis.{u2, u1, max u2 u1} (FreeMonoid.{u2} X) R (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (NonAssocRing.toNonUnitalNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (Ring.toNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (FreeAlgebra.instRingFreeAlgebraToCommSemiring.{u2, u1} X R _inst_1))))) (Algebra.toModule.{u1, max u1 u2} R (FreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (CommRing.toCommSemiring.{u1} R _inst_1) (FreeAlgebra.instSemiringFreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X) (FreeAlgebra.instAlgebraFreeAlgebraInstSemiringFreeAlgebra.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) X))
+Case conversion may be inaccurate. Consider using '#align free_algebra.basis_free_monoid FreeAlgebra.basisFreeMonoidₓ'. -/
 /-- The `free_monoid X` basis on the `free_algebra R X`,
 mapping `[x₁, x₂, ..., xₙ]` to the "monomial" `1 • x₁ * x₂ * ⋯ * xₙ` -/
 @[simps]
@@ -34,6 +40,12 @@ noncomputable def basisFreeMonoid (R : Type u) (X : Type v) [CommRing R] :
     (equivMonoidAlgebraFreeMonoid.symm.toLinearEquiv : _ ≃ₗ[R] FreeAlgebra R X)
 #align free_algebra.basis_free_monoid FreeAlgebra.basisFreeMonoid
 
+/- warning: free_algebra.rank_eq -> FreeAlgebra.rank_eq is a dubious translation:
+lean 3 declaration is
+  forall {K : Type.{u1}} {X : Type.{max u1 u2}} [_inst_1 : Field.{u1} K], Eq.{succ (succ (max u1 u2))} Cardinal.{max u1 u2} (Module.rank.{u1, max u1 u2} K (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (Ring.toSemiring.{u1} K (DivisionRing.toRing.{u1} K (Field.toDivisionRing.{u1} K _inst_1))) (AddCommGroup.toAddCommMonoid.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (NonUnitalNonAssocRing.toAddCommGroup.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (NonAssocRing.toNonUnitalNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (Ring.toNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (FreeAlgebra.ring.{max u1 u2, u1} X K (EuclideanDomain.toCommRing.{u1} K (Field.toEuclideanDomain.{u1} K _inst_1))))))) (Algebra.toModule.{u1, max u1 u2} K (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) (FreeAlgebra.semiring.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (FreeAlgebra.algebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X))) (Cardinal.mk.{max u1 u2} (List.{max u1 u2} X))
+but is expected to have type
+  forall {K : Type.{u1}} {X : Type.{max u1 u2}} [_inst_1 : Field.{u1} K], Eq.{max (succ (succ u1)) (succ (succ u2))} Cardinal.{max u1 u2} (Module.rank.{u1, max u1 u2} K (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (NonAssocRing.toNonUnitalNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (Ring.toNonAssocRing.{max u1 u2} (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (FreeAlgebra.instRingFreeAlgebraToCommSemiring.{max u1 u2, u1} X K (Field.toCommRing.{u1} K _inst_1)))))) (Algebra.toModule.{u1, max u1 u2} K (FreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) (FreeAlgebra.instSemiringFreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X) (FreeAlgebra.instAlgebraFreeAlgebraInstSemiringFreeAlgebra.{u1, max u1 u2} K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_1)) X))) (Cardinal.mk.{max u1 u2} (List.{max u1 u2} X))
+Case conversion may be inaccurate. Consider using '#align free_algebra.rank_eq FreeAlgebra.rank_eqₓ'. -/
 -- TODO: generalize to `X : Type v`
 theorem rank_eq {K : Type u} {X : Type max u v} [Field K] :
     Module.rank K (FreeAlgebra K X) = Cardinal.mk (List X) :=
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
 
 ! This file was ported from Lean 3 source module linear_algebra.free_algebra
-! leanprover-community/mathlib commit 59628387770d82eb6f6dd7b7107308aa2509ec95
+! leanprover-community/mathlib commit 039a089d2a4b93c761b234f3e5f5aeb752bac60f
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -35,10 +35,10 @@ noncomputable def basisFreeMonoid (R : Type u) (X : Type v) [CommRing R] :
 #align free_algebra.basis_free_monoid FreeAlgebra.basisFreeMonoid
 
 -- TODO: generalize to `X : Type v`
-theorem dim_eq {K : Type u} {X : Type max u v} [Field K] :
+theorem rank_eq {K : Type u} {X : Type max u v} [Field K] :
     Module.rank K (FreeAlgebra K X) = Cardinal.mk (List X) :=
-  (Cardinal.lift_inj.mp (basisFreeMonoid K X).mk_eq_dim).symm
-#align free_algebra.dim_eq FreeAlgebra.dim_eq
+  (Cardinal.lift_inj.mp (basisFreeMonoid K X).mk_eq_rank).symm
+#align free_algebra.rank_eq FreeAlgebra.rank_eq
 
 end FreeAlgebra
 
Diff
@@ -4,12 +4,13 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
 
 ! This file was ported from Lean 3 source module linear_algebra.free_algebra
-! leanprover-community/mathlib commit cd3434749bf1f6a8155cb53b2705f08b74371f2a
+! leanprover-community/mathlib commit 59628387770d82eb6f6dd7b7107308aa2509ec95
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.LinearAlgebra.Basis
 import Mathbin.Algebra.FreeAlgebra
+import Mathbin.LinearAlgebra.Dimension
 import Mathbin.LinearAlgebra.FinsuppVectorSpace
 
 /-!

Changes in mathlib4

mathlib3
mathlib4
chore: Reorganize results about rank and finrank. (#9349)

The files Mathlib.LinearAlgebra.FreeModule.Rank, Mathlib.LinearAlgebra.FreeModule.Finite.Rank, Mathlib.LinearAlgebra.Dimension and Mathlib.LinearAlgebra.Finrank were reorganized into a folder Mathlib.LinearAlgebra.Dimension, containing the following files

  • Basic.lean: Contains the definition of Module.rank.
  • Finrank.lean: Contains the definition of FiniteDimensional.finrank.
  • StrongRankCondition.lean: Contains results about rank and finrank over rings satisfying strong rank condition
  • Free.lean: Contains results about rank and finrank of free modules
  • Finite.lean: Contains conditions or consequences for rank to be finite or zero
  • Constructions.lean: Contains the calculation of the rank of various constructions.
  • DivisionRing.lean: Contains results about rank and finrank of spaces over division rings.
  • LinearMap.lean: Contains results about LinearMap.rank

API changes: IsNoetherian.rank_lt_aleph0 and FiniteDimensional.rank_lt_aleph0 are replaced with rank_lt_aleph0. Module.Free.finite_basis was renamed to Module.Finite.finite_basis. FiniteDimensional.finrank_eq_rank was renamed to finrank_eq_rank. rank_eq_cardinal_basis and rank_eq_cardinal_basis' were removed in favour of Basis.mk_eq_mk and Basis.mk_eq_mk''.

Co-authored-by: Andrew Yang <36414270+erdOne@users.noreply.github.com>

Diff
@@ -5,7 +5,6 @@ Authors: Eric Wieser
 -/
 import Mathlib.LinearAlgebra.Basis
 import Mathlib.Algebra.FreeAlgebra
-import Mathlib.LinearAlgebra.Dimension
 import Mathlib.LinearAlgebra.FinsuppVectorSpace
 import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition
 
chore: space after (#8178)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -43,7 +43,7 @@ end
 
 theorem rank_eq [CommRing R] [Nontrivial R] :
     Module.rank R (FreeAlgebra R X) = Cardinal.lift.{u} (Cardinal.mk (List X)) := by
-  rw [←(Basis.mk_eq_rank'.{_,_,_,u} (basisFreeMonoid R X)).trans (Cardinal.lift_id _),
+  rw [← (Basis.mk_eq_rank'.{_,_,_,u} (basisFreeMonoid R X)).trans (Cardinal.lift_id _),
     Cardinal.lift_umax'.{v,u}, FreeMonoid]
 #align free_algebra.rank_eq FreeAlgebra.rank_eq
 
feat(LinearAlgebra/TensorAlgebra/Basis): the free and tensor algebras are free modules (#6680)

The main result here is Basis.tensorAlgebra (b : Basis κ R M) : Basis (FreeMonoid κ) R (TensorAlgebra R M) from which everything else follows without much work.

Diff
@@ -7,6 +7,7 @@ import Mathlib.LinearAlgebra.Basis
 import Mathlib.Algebra.FreeAlgebra
 import Mathlib.LinearAlgebra.Dimension
 import Mathlib.LinearAlgebra.FinsuppVectorSpace
+import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition
 
 #align_import linear_algebra.free_algebra from "leanprover-community/mathlib"@"039a089d2a4b93c761b234f3e5f5aeb752bac60f"
 
@@ -22,21 +23,28 @@ universe u v
 
 namespace FreeAlgebra
 
+variable (R : Type u) (X : Type v)
+
+section
+variable [CommSemiring R]
+
 /-- The `FreeMonoid X` basis on the `FreeAlgebra R X`,
 mapping `[x₁, x₂, ..., xₙ]` to the "monomial" `1 • x₁ * x₂ * ⋯ * xₙ` -/
 -- @[simps]
-noncomputable def basisFreeMonoid (R : Type u) (X : Type v) [CommRing R] :
-    Basis (FreeMonoid X) R (FreeAlgebra R X) :=
+noncomputable def basisFreeMonoid : Basis (FreeMonoid X) R (FreeAlgebra R X) :=
   Finsupp.basisSingleOne.map (equivMonoidAlgebraFreeMonoid (R := R) (X := X)).symm.toLinearEquiv
 #align free_algebra.basis_free_monoid FreeAlgebra.basisFreeMonoid
 
--- TODO: generalize to `X : Type v`
-theorem rank_eq {K : Type u} {X : Type max u v} [Field K] :
-    Module.rank K (FreeAlgebra K X) = Cardinal.mk (List X) :=
-  -- Porting note: the type class inference was no longer automatic.
-  -- was: (Cardinal.lift_inj.mp (basisFreeMonoid K X).mk_eq_rank).symm
-  Cardinal.lift_inj.mp (@Basis.mk_eq_rank _ _ _ _ _ _ (inferInstance : Module K (FreeAlgebra K X))
-  (basisFreeMonoid K X)).symm
+instance : Module.Free R (FreeAlgebra R X) :=
+  have : Module.Free R (MonoidAlgebra R (FreeMonoid X)) := Module.Free.finsupp _ _ _
+  Module.Free.of_equiv (equivMonoidAlgebraFreeMonoid (R := R) (X := X)).symm.toLinearEquiv
+
+end
+
+theorem rank_eq [CommRing R] [Nontrivial R] :
+    Module.rank R (FreeAlgebra R X) = Cardinal.lift.{u} (Cardinal.mk (List X)) := by
+  rw [←(Basis.mk_eq_rank'.{_,_,_,u} (basisFreeMonoid R X)).trans (Cardinal.lift_id _),
+    Cardinal.lift_umax'.{v,u}, FreeMonoid]
 #align free_algebra.rank_eq FreeAlgebra.rank_eq
 
 end FreeAlgebra
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,17 +2,14 @@
 Copyright (c) 2021 Eric Wieser. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
-
-! This file was ported from Lean 3 source module linear_algebra.free_algebra
-! leanprover-community/mathlib commit 039a089d2a4b93c761b234f3e5f5aeb752bac60f
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.LinearAlgebra.Basis
 import Mathlib.Algebra.FreeAlgebra
 import Mathlib.LinearAlgebra.Dimension
 import Mathlib.LinearAlgebra.FinsuppVectorSpace
 
+#align_import linear_algebra.free_algebra from "leanprover-community/mathlib"@"039a089d2a4b93c761b234f3e5f5aeb752bac60f"
+
 /-!
 # Linear algebra properties of `FreeAlgebra R X`
 
chore: reenable eta, bump to nightly 2023-05-16 (#3414)

Now that leanprover/lean4#2210 has been merged, this PR:

  • removes all the set_option synthInstance.etaExperiment true commands (and some etaExperiment% term elaborators)
  • removes many but not quite all set_option maxHeartbeats commands
  • makes various other changes required to cope with leanprover/lean4#2210.

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Matthew Ballard <matt@mrb.email>

Diff
@@ -25,7 +25,6 @@ universe u v
 
 namespace FreeAlgebra
 
-set_option synthInstance.etaExperiment true in
 /-- The `FreeMonoid X` basis on the `FreeAlgebra R X`,
 mapping `[x₁, x₂, ..., xₙ]` to the "monomial" `1 • x₁ * x₂ * ⋯ * xₙ` -/
 -- @[simps]
chore: use etaExperiment rather than hacking with instances (#3668)

This is to fix timeouts in https://github.com/leanprover-community/mathlib4/pull/3552.

See discussion at https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/!4.233552.20.28LinearAlgebra.2EMatrix.2EToLin.29.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -25,6 +25,7 @@ universe u v
 
 namespace FreeAlgebra
 
+set_option synthInstance.etaExperiment true in
 /-- The `FreeMonoid X` basis on the `FreeAlgebra R X`,
 mapping `[x₁, x₂, ..., xₙ]` to the "monomial" `1 • x₁ * x₂ * ⋯ * xₙ` -/
 -- @[simps]
chore: fix #align lines (#3640)

This PR fixes two things:

  • Most align statements for definitions and theorems and instances that are separated by two newlines from the relevant declaration (s/\n\n#align/\n#align). This is often seen in the mathport output after ending calc blocks.
  • All remaining more-than-one-line #align statements. (This was needed for a script I wrote for #3630.)
Diff
@@ -31,7 +31,6 @@ mapping `[x₁, x₂, ..., xₙ]` to the "monomial" `1 • x₁ * x₂ * ⋯ * x
 noncomputable def basisFreeMonoid (R : Type u) (X : Type v) [CommRing R] :
     Basis (FreeMonoid X) R (FreeAlgebra R X) :=
   Finsupp.basisSingleOne.map (equivMonoidAlgebraFreeMonoid (R := R) (X := X)).symm.toLinearEquiv
-
 #align free_algebra.basis_free_monoid FreeAlgebra.basisFreeMonoid
 
 -- TODO: generalize to `X : Type v`
feat: port linear algebra.free algebra (#3385)

Dependencies 8 + 511

512 files ported (98.5%)
214111 lines ported (98.6%)
Show graph

The unported dependencies are