Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 79148c1

Browse files
committed
dimension theorem
1 parent 56c4919 commit 79148c1

File tree

3 files changed

+132
-4
lines changed

3 files changed

+132
-4
lines changed

linear_algebra/dimension.lean

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Author: Mario Carneiro
55
66
Dimension of modules and vector spaces.
77
-/
8-
import linear_algebra.basic set_theory.cardinal
8+
import linear_algebra.basic set_theory.ordinal
99
noncomputable theory
1010

1111
local attribute [instance] classical.prop_decidable
@@ -23,12 +23,53 @@ cardinal.min
2323
(λ b, cardinal.mk b.1)
2424
variables {α β}
2525

26-
/-
26+
include α
27+
theorem basis_le_span (I J : set β) (h1 : is_basis I) (h2 : ∀x, x ∈ span J) : cardinal.mk I ≤ cardinal.mk J :=
28+
or.cases_on (le_or_lt cardinal.omega $ cardinal.mk J)
29+
(assume h4 : cardinal.omega ≤ cardinal.mk J,
30+
le_of_not_lt $ assume h3 : cardinal.mk I > cardinal.mk J,
31+
let h5 : J → set β := λ j, (h1.1.repr j).support.to_set in
32+
have h6 : ¬I ⊆ ⋃ j, h5 j,
33+
from λ H, @not_lt_of_le _ _ (cardinal.mk I) (cardinal.mk (⋃ j, h5 j))
34+
(⟨set.embedding_of_subset H⟩) $
35+
calc cardinal.mk (⋃ j, h5 j)
36+
≤ cardinal.mk J * cardinal.omega : cardinal.mk_union_le_mk_mul_omega $ λ j, finset.finite_to_set _
37+
... = max (cardinal.mk J) (cardinal.omega) : cardinal.mul_eq_max h4 (le_refl _)
38+
... = cardinal.mk J : max_eq_left h4
39+
... < cardinal.mk I : h3,
40+
let ⟨i₀, h7⟩ := not_forall.1 h6 in
41+
let ⟨h7, h8⟩ := not_imp.1 h7 in
42+
have h9 : _ := λ j : J, not_exists.1 (mt set.mem_Union.2 h8) j,
43+
have h9 : _ := λ j : J, by_contradiction $ mt (finsupp.mem_support_iff (h1.1.repr j) i₀).2 $ h9 j,
44+
let ⟨h10, h11, h12⟩ := h2 i₀ in
45+
have h13 : _ := (repr_eq_single h1.1 h7).symm.trans $
46+
(congr_arg h1.1.repr h12).trans $
47+
repr_finsupp_sum _ $ λ j _, h1.2 _,
48+
have h14 : ((finsupp.single i₀ (1:α) : lc α β) : β → α) i₀ = _,
49+
from congr_fun (congr_arg finsupp.to_fun h13) i₀,
50+
begin
51+
rw [finsupp.sum_apply, finsupp.single_eq_same, finsupp.sum] at h14,
52+
rw [← finset.sum_subset (finset.empty_subset _), finset.sum_empty] at h14,
53+
{ exact zero_ne_one h14.symm },
54+
intros v h15 h16,
55+
have h17 := by_contradiction (mt (h11 v) ((finsupp.mem_support_iff _ _).1 h15)),
56+
have h18 : (linear_independent.repr (h1.left) v) i₀ = 0 := h9 ⟨v, h17⟩,
57+
rw [repr_smul h1.1 (h1.2 _), finsupp.smul_apply, h18, smul_eq_mul, mul_zero]
58+
end)
59+
(assume h4 : cardinal.mk J < cardinal.omega,
60+
let ⟨h5, h6⟩ := exists_finite_card_le_of_finite_of_linear_independent_of_span
61+
(cardinal.lt_omega_iff_finite.1 h4) h1.1 (λ _ _, h2 _) in
62+
cardinal.mk_le_mk_of_finset_card_to_finset_le h6)
63+
64+
theorem dimension_theorem {I J : set β} (h1 : is_basis I) (h2 : is_basis J) : cardinal.mk I = cardinal.mk J :=
65+
le_antisymm (basis_le_span _ _ h1 h2.2) (basis_le_span _ _ h2 h1.2)
66+
2767
theorem mk_basis {b : set β} (h : is_basis b) : cardinal.mk b = dim α β :=
2868
begin
2969
cases (show ∃ b', dim α β = _, from cardinal.min_eq _ _) with b' e,
30-
refine quotient.sound
70+
refine dimension_theorem h _,
71+
generalize : classical.some _ = b1,
72+
exact b1.2,
3173
end
32-
-/
3374

3475
end vector_space

set_theory/cardinal.lean

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,4 +651,67 @@ lt_of_not_ge $ λ ⟨F⟩, begin
651651
hc i a (congr_fun h _),
652652
end
653653

654+
theorem mk_le_mk_finset (α : Type u) : mk α ≤ mk (finset α) :=
655+
⟨⟨finset.singleton, λ _ _, finset.singleton_inj.1⟩⟩
656+
657+
theorem mk_finset_le_mk_list (α : Type u) : mk (finset α) ≤ mk (list α) :=
658+
⟨⟨quotient.out ∘ finset.val, λ x y H, finset.val_inj.1 $
659+
calc x.1 = _ : (quotient.out_eq x.1).symm ... = _ : congr_arg _ H
660+
... = _ : quotient.out_eq y.1⟩⟩
661+
662+
def vector_equiv_fin_fn (α : Type u) (n : ℕ) : vector α n ≃ (ulift.{u 0} (fin n) → α) :=
663+
{ to_fun := λ L i, vector.nth L i.down,
664+
inv_fun := λ f, vector.of_fn (λ i, f (ulift.up i)),
665+
left_inv := vector.of_fn_nth,
666+
right_inv := λ f, funext (λ ⟨i⟩, vector.nth_of_fn _ i) }
667+
668+
theorem vector_equiv_fin_fn_length (α : Type u) (n : ℕ) (f : ulift (fin n) → α) :
669+
((vector_equiv_fin_fn α n).symm f).1.length = n :=
670+
((vector_equiv_fin_fn α n).symm f).2
671+
672+
theorem mk_list_eq_sum_pow (α : Type u) : mk (list α) = sum (λ n : ℕ, (mk α)^(n:cardinal.{u})) :=
673+
by conv {to_rhs, congr, funext, rw [← lift_mk_fin, lift_mk, power_def]};
674+
rw [sum_mk]; from
675+
(quotient.sound $ nonempty.intro $
676+
{ to_fun := λ L, ⟨L.length, vector_equiv_fin_fn α L.length ⟨L, rfl⟩⟩,
677+
inv_fun := λ x, ((vector_equiv_fin_fn α x.1).symm x.2).to_list,
678+
left_inv := λ L, by dsimp only; simp only [equiv.inverse_apply_apply]; refl,
679+
right_inv := λ x, sigma.eq (vector_equiv_fin_fn_length _ _ _)
680+
(begin dsimp only, generalize : rfl = H1,
681+
generalize : vector_equiv_fin_fn_length α (x.fst) (x.snd) = H,
682+
let N1 := ((vector_equiv_fin_fn α x.1).symm x.2).1.length,
683+
change N1 = _ at H1,
684+
generalize_hyp : ((vector_equiv_fin_fn α x.1).symm x.2).1.length = N3 at H H1 ⊢,
685+
subst H,
686+
simp only [vector.mk_to_list, equiv.apply_inverse_apply], end) })
687+
688+
theorem mk_union_le_mk_mul_omega {α : Type u} {S : set α} {f : S → set α}
689+
(hf : ∀ s, set.finite (f s)) : mk (⋃ s, f s) ≤ mk S * omega :=
690+
⟨⟨λ x, (classical.some (set.mem_Union.1 x.2),
691+
(classical.choice (le_of_lt $ lt_omega_iff_finite.2 $ (hf $ classical.some (set.mem_Union.1 x.2)))).1
692+
⟨x.1, classical.some_spec (set.mem_Union.1 x.2)⟩),
693+
λ x y H, subtype.eq $ begin
694+
cases prod.ext_iff.1 H with H1 H2, clear H,
695+
dsimp only at H1 H2,
696+
generalize_hyp : set.mem_Union.1 x.2 = H3 at H1 H2,
697+
generalize_hyp : hf (classical.some H3) = H5 at H2,
698+
generalize_hyp : classical.some_spec H3 = H7 at H2,
699+
generalize_hyp : classical.some H3 = i at H1 H2 H5 H7,
700+
subst H1,
701+
exact subtype.mk.inj (function.embedding.inj _ H2)
702+
end⟩⟩
703+
704+
theorem mk_le_mk_of_finset_card_to_finset_le {α : Type u} {S T : set α}
705+
{HS : set.finite S} {HT : set.finite T}
706+
(H : finset.card (set.finite.to_finset HS) ≤ finset.card (set.finite.to_finset HT)) :
707+
mk S ≤ mk T :=
708+
begin
709+
tactic.unfreeze_local_instances,
710+
cases HS, cases HT,
711+
rw [fintype_card, fintype_card, nat_cast_le],
712+
rw [← fintype.card_coe, ← fintype.card_coe] at H,
713+
convert H;
714+
{ ext z, rw [finset.mem_coe, set.finite.mem_to_finset] }
715+
end
716+
654717
end cardinal

set_theory/ordinal.lean

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2884,4 +2884,28 @@ lt_of_le_of_lt (add_le_add (le_max_left a b) (le_max_right a b)) $
28842884
(λ h, lt_of_lt_of_le (add_lt_omega h h) hc)
28852885
(λ h, by rw add_eq_self h; exact max_lt h1 h2)
28862886

2887+
theorem pow_le {κ : cardinal.{u}} (H1 : omega ≤ κ) {n : ℕ} : κ^(n:cardinal.{u}) ≤ κ :=
2888+
quotient.induction_on κ (λ α H1, nat.rec_on n
2889+
(le_of_lt $ lt_of_lt_of_le (by rw [nat.cast_zero, power_zero];
2890+
from one_lt_omega) H1)
2891+
(λ n ih, trans_rel_left _
2892+
(by rw [nat.cast_succ, power_add, power_one];
2893+
from mul_le_mul_right _ ih)
2894+
(mul_eq_self H1))) H1
2895+
2896+
theorem mk_list_le_mk_aux {α : Type u} : sum (λ (n : ℕ), mk α) = sum (λ (n : ulift.{u} ℕ), mk α) :=
2897+
by rw [sum_mk, sum_mk]; from
2898+
(quotient.sound $ nonempty.intro $
2899+
⟨λ x, ⟨ulift.up x.1, x.2⟩, λ x, ⟨ulift.down x.1, x.2⟩,
2900+
λ ⟨x1, x2⟩, rfl, λ ⟨⟨x1⟩, x2⟩, rfl⟩)
2901+
2902+
theorem mk_list_le_mk {α : Type u} (H1 : omega ≤ mk α) : mk (list α) ≤ mk α :=
2903+
calc mk (list α)
2904+
= sum (λ n : ℕ, mk α ^ (n : cardinal.{u})) : mk_list_eq_sum_pow α
2905+
... ≤ sum (λ n : ℕ, mk α) : sum_le_sum _ _ $ λ n, pow_le H1
2906+
... = sum (λ n : ulift.{u} ℕ, mk α) : mk_list_le_mk_aux
2907+
... = omega * mk α : sum_const _ _
2908+
... = max (omega) (mk α) : mul_eq_max (le_refl _) H1
2909+
... = mk α : max_eq_right H1
2910+
28872911
end cardinal

0 commit comments

Comments
 (0)