Skip to content

Commit 0429dca

Browse files
committed
chore: defer a lemma, to avoid needing Cardinal in LinearIndependent (#19626)
1 parent 1e85f24 commit 0429dca

File tree

9 files changed

+25
-21
lines changed

9 files changed

+25
-21
lines changed

Mathlib/Algebra/Category/ModuleCat/Adjunctions.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ the forgetful functor from `R`-modules to types.
1515
-/
1616

1717

18+
assert_not_exists Cardinal
19+
1820
noncomputable section
1921

2022
open CategoryTheory

Mathlib/Analysis/Convex/Cone/Basic.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ While `Convex 𝕜` is a predicate on sets, `ConvexCone 𝕜 E` is a bundled con
3939

4040
assert_not_exists NormedSpace
4141
assert_not_exists Real
42+
assert_not_exists Cardinal
4243

4344
open Set LinearMap
4445

Mathlib/Analysis/LocallyConvex/Polar.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ any bilinear form `B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜`, where `𝕜` is a no
3434
polar
3535
-/
3636

37-
3837
variable {𝕜 E F : Type*}
3938

4039
open Topology

Mathlib/LinearAlgebra/Dimension/Basic.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Mario Carneiro, Johannes Hölzl, Sander Dahmen, Kim Morrison
55
-/
66
import Mathlib.LinearAlgebra.LinearIndependent
7+
import Mathlib.SetTheory.Cardinal.Basic
78

89
/-!
910
# Dimension of modules and vector spaces

Mathlib/LinearAlgebra/Dimension/Finite.lean

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,19 @@ attribute [local instance] nontrivial_of_invariantBasisNumber
2929

3030
open Basis Cardinal Function Module Set Submodule
3131

32+
/-- If every finite set of linearly independent vectors has cardinality at most `n`,
33+
then the same is true for arbitrary sets of linearly independent vectors.
34+
-/
35+
theorem linearIndependent_bounded_of_finset_linearIndependent_bounded {n : ℕ}
36+
(H : ∀ s : Finset M, (LinearIndependent R fun i : s => (i : M)) → s.card ≤ n) :
37+
∀ s : Set M, LinearIndependent R ((↑) : s → M) → #s ≤ n := by
38+
intro s li
39+
apply Cardinal.card_le_of
40+
intro t
41+
rw [← Finset.card_map (Embedding.subtype s)]
42+
apply H
43+
apply linearIndependent_finset_map_embedding_subtype _ li
44+
3245
theorem rank_le {n : ℕ}
3346
(H : ∀ s : Finset M, (LinearIndependent R fun i : s => (i : M)) → s.card ≤ n) :
3447
Module.rank R M ≤ n := by

Mathlib/LinearAlgebra/Finsupp/VectorSpace.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ This file contains results on the `R`-module structure on functions of finite su
1919
noncomputable section
2020

2121
open Set LinearMap Submodule
22-
open scoped Cardinal
2322

2423
universe u v w
2524

Mathlib/LinearAlgebra/FreeModule/Basic.lean

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Mathlib.Data.Finsupp.Fintype
77
import Mathlib.Data.Matrix.Defs
88
import Mathlib.LinearAlgebra.Basis.Basic
99
import Mathlib.LinearAlgebra.TensorProduct.Basis
10+
import Mathlib.Logic.Small.Basic
1011

1112
/-!
1213
# Free modules
@@ -37,6 +38,10 @@ variable [Semiring R] [AddCommMonoid M] [Module R M]
3738
class Module.Free : Prop where
3839
exists_basis : Nonempty <| (I : Type v) × Basis I R M
3940

41+
theorem Module.free_iff_set : Module.Free R M ↔ ∃ S : Set M, Nonempty (Basis S R M) :=
42+
fun h => ⟨Set.range h.exists_basis.some.2, ⟨Basis.reindexRange h.exists_basis.some.2⟩⟩,
43+
fun ⟨S, hS⟩ => ⟨nonempty_sigma.2 ⟨S, hS⟩⟩⟩
44+
4045
/-- If `M` fits in universe `w`, then freeness is equivalent to existence of a basis in that
4146
universe.
4247
@@ -49,10 +54,6 @@ theorem Module.free_def [Small.{w,v} M] :
4954
⟨(Basis.reindexRange h.exists_basis.some.2).reindex (equivShrink _)⟩⟩,
5055
fun h => ⟨(nonempty_sigma.2 h).map fun ⟨_, b⟩ => ⟨Set.range b, b.reindexRange⟩⟩⟩
5156

52-
theorem Module.free_iff_set : Module.Free R M ↔ ∃ S : Set M, Nonempty (Basis S R M) :=
53-
fun h => ⟨Set.range h.exists_basis.some.2, ⟨Basis.reindexRange h.exists_basis.some.2⟩⟩,
54-
fun ⟨S, hS⟩ => ⟨nonempty_sigma.2 ⟨S, hS⟩⟩⟩
55-
5657
variable {R M}
5758

5859
theorem Module.Free.of_basis {ι : Type w} (b : Basis ι R M) : Module.Free R M :=

Mathlib/LinearAlgebra/LinearIndependent.lean

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import Mathlib.Algebra.BigOperators.Fin
77
import Mathlib.Data.Set.Subsingleton
88
import Mathlib.Lean.Expr.ExtraRecognizers
99
import Mathlib.LinearAlgebra.Prod
10-
import Mathlib.SetTheory.Cardinal.Basic
1110
import Mathlib.Tactic.FinCases
1211
import Mathlib.Tactic.LinearCombination
1312
import Mathlib.Tactic.Module
@@ -82,13 +81,12 @@ linearly dependent, linear dependence, linearly independent, linear independence
8281
8382
-/
8483

84+
assert_not_exists Cardinal
8585

8686
noncomputable section
8787

8888
open Function Set Submodule
8989

90-
open Cardinal
91-
9290
universe u' u
9391

9492
variable {ι : Type u'} {ι' : Type*} {R : Type*} {K : Type*}
@@ -402,18 +400,6 @@ theorem linearIndependent_finset_map_embedding_subtype (s : Set M)
402400
obtain ⟨b, _hb, rfl⟩ := hy
403401
simp only [f, imp_self, Subtype.mk_eq_mk]
404402

405-
/-- If every finite set of linearly independent vectors has cardinality at most `n`,
406-
then the same is true for arbitrary sets of linearly independent vectors.
407-
-/
408-
theorem linearIndependent_bounded_of_finset_linearIndependent_bounded {n : ℕ}
409-
(H : ∀ s : Finset M, (LinearIndependent R fun i : s => (i : M)) → s.card ≤ n) :
410-
∀ s : Set M, LinearIndependent R ((↑) : s → M) → #s ≤ n := by
411-
intro s li
412-
apply Cardinal.card_le_of
413-
intro t
414-
rw [← Finset.card_map (Embedding.subtype s)]
415-
apply H
416-
apply linearIndependent_finset_map_embedding_subtype _ li
417403

418404
section Subtype
419405

Mathlib/RingTheory/TensorProduct/Free.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ and deducde that `Module.Free` is stable under base change.
2222
2323
-/
2424

25+
assert_not_exists Cardinal
26+
2527
suppress_compilation
2628

2729
open scoped TensorProduct

0 commit comments

Comments
 (0)