@@ -106,7 +106,7 @@ begin
106
106
exact false.elim (not_nonempty_iff_imp_false.1 h i)
107
107
end
108
108
109
- lemma ne_zero_of_linear_independent
109
+ lemma linear_independent.ne_zero
110
110
{i : ι} (ne : 0 ≠ (1 :R)) (hv : linear_independent R v) : v i ≠ 0 :=
111
111
λ h, ne $ eq.symm begin
112
112
suffices : (finsupp.single i 1 : ι →₀ R) i = 0 , {simpa},
@@ -301,7 +301,7 @@ begin
301
301
exact (disjoint.mono_left (finsupp.supported_mono h))
302
302
end
303
303
304
- lemma linear_independent_union {s t : set M}
304
+ lemma linear_independent.union {s t : set M}
305
305
(hs : linear_independent R (λ x, x : s → M)) (ht : linear_independent R (λ x, x : t → M))
306
306
(hst : disjoint (span R s) (span R t)) :
307
307
linear_independent R (λ x, x : (s ∪ t) → M) :=
@@ -346,7 +346,6 @@ lemma linear_independent_Union_of_directed {η : Type*}
346
346
(h : ∀ i, linear_independent R (λ x, x : s i → M)) :
347
347
linear_independent R (λ x, x : (⋃ i, s i) → M) :=
348
348
begin
349
- haveI := classical.dec (nonempty η),
350
349
by_cases hη : nonempty η,
351
350
{ refine linear_independent_of_finite (⋃ i, s i) (λ t ht ft, _),
352
351
rcases finite_subset_Union ft ht with ⟨I, fi, hI⟩,
@@ -389,9 +388,7 @@ begin
389
388
exact λ x, set.not_mem_empty x (subtype.mem x) },
390
389
{ rintros ⟨i⟩ s his ih,
391
390
rw [finset.sup_insert],
392
- apply linear_independent_union,
393
- { apply hl },
394
- { apply ih },
391
+ refine (hl _).union ih _,
395
392
rw [finset.sup_eq_supr],
396
393
refine (hd i _ _ his).mono_right _,
397
394
{ simp only [(span_Union _).symm],
@@ -424,7 +421,7 @@ begin
424
421
simp only [] at hxy,
425
422
rw hxy,
426
423
exact (subset_span (mem_range_self y₂)) },
427
- exact false.elim (ne_zero_of_linear_independent zero_eq_one (hindep x₁) h0) } },
424
+ exact false.elim ((hindep x₁).ne_zero zero_eq_one h0) } },
428
425
rw range_sigma_eq_Union_range,
429
426
apply linear_independent_Union_finite_subtype (λ j, (hindep j).to_subtype_range) hd,
430
427
end
@@ -592,16 +589,14 @@ begin
592
589
{ simp }
593
590
end
594
591
595
- lemma linear_independent_inl_union_inr {s : set M} {t : set M'}
592
+ lemma linear_independent.inl_union_inr {s : set M} {t : set M'}
596
593
(hs : linear_independent R (λ x, x : s → M))
597
594
(ht : linear_independent R (λ x, x : t → M')) :
598
595
linear_independent R (λ x, x : inl R M M' ' ' s ∪ inr R M M' ' ' t → M × M') :=
599
596
begin
600
- apply linear_independent_union,
601
- exact (hs.image_subtype $ by simp),
602
- exact (ht.image_subtype $ by simp),
603
- rw [span_image, span_image];
604
- simp [disjoint_iff, prod_inf_prod]
597
+ refine (hs.image_subtype _).union (ht.image_subtype _) _; [simp, simp, skip],
598
+ simp only [span_image],
599
+ simp [disjoint_iff, prod_inf_prod]
605
600
end
606
601
607
602
lemma linear_independent_inl_union_inr' {v : ι → M} {v' : ι' → M'}
@@ -616,20 +611,12 @@ begin
616
611
{ apply sum.elim_injective,
617
612
{ exact injective_comp prod.injective_inl inj_v },
618
613
{ exact injective_comp prod.injective_inr inj_v' },
619
- { intros, simp [ne_zero_of_linear_independent zero_eq_one hv ] } },
614
+ { intros, simp [hv.ne_zero zero_eq_one] } },
620
615
{ rw sum.elim_range,
621
- apply linear_independent_union,
622
- { apply linear_independent.to_subtype_range,
623
- apply linear_independent.image hv,
624
- simp [ker_inl] },
625
- { apply linear_independent.to_subtype_range,
626
- apply linear_independent.image hv',
627
- simp [ker_inr] },
628
- { apply disjoint_inl_inr.mono _ _,
629
- { rw [set.range_comp, span_image],
630
- apply linear_map.map_le_range },
631
- { rw [set.range_comp, span_image],
632
- apply linear_map.map_le_range } } }
616
+ refine (hv.image _).to_subtype_range.union (hv'.image _).to_subtype_range _;
617
+ [simp, simp, skip],
618
+ apply disjoint_inl_inr.mono _ _;
619
+ simp only [set.range_comp, span_image, linear_map.map_le_range] }
633
620
end
634
621
635
622
/-- Dedekind's linear independence of characters -/
@@ -781,7 +768,7 @@ begin
781
768
exact (λ y hy, exists.elim (set.mem_range.1 hy) (λ i hi, by rw ←hi; exact h i))
782
769
end
783
770
784
- lemma constr_basis {f : ι → M'} {i : ι} (hv : is_basis R v) :
771
+ @[simp] lemma constr_basis {f : ι → M'} {i : ι} (hv : is_basis R v) :
785
772
(hv.constr f : M → M') (v i) = f i :=
786
773
by simp [is_basis.constr_apply, hv.repr_eq_single, finsupp.sum_single_index]
787
774
@@ -797,10 +784,10 @@ constr_eq hv $ λ x, rfl
797
784
798
785
lemma constr_add {g f : ι → M'} (hv : is_basis R v) :
799
786
hv.constr (λi, f i + g i) = hv.constr f + hv.constr g :=
800
- constr_eq hv $ by simp [constr_basis hv] {contextual := tt}
787
+ constr_eq hv $ λ b, by simp
801
788
802
789
lemma constr_neg {f : ι → M'} (hv : is_basis R v) : hv.constr (λi, - f i) = - hv.constr f :=
803
- constr_eq hv $ by simp [constr_basis hv] {contextual := tt}
790
+ constr_eq hv $ λ b, by simp
804
791
805
792
lemma constr_sub {g f : ι → M'} (hs : is_basis R v) :
806
793
hv.constr (λi, f i - g i) = hs.constr f - hs.constr g :=
@@ -1022,7 +1009,7 @@ lemma linear_independent.insert (hs : linear_independent K (λ b, b : s → V))
1022
1009
begin
1023
1010
rw ← union_singleton,
1024
1011
have x0 : x ≠ 0 := mt (by rintro rfl; apply zero_mem _) hx,
1025
- apply linear_independent_union hs (linear_independent_singleton x0),
1012
+ apply hs.union (linear_independent_singleton x0),
1026
1013
rwa [disjoint_span_singleton x0]
1027
1014
end
1028
1015
@@ -1032,7 +1019,6 @@ begin
1032
1019
rcases zorn.zorn_subset₀ {b | b ⊆ t ∧ linear_independent K (λ x, x : b → V)} _ _
1033
1020
⟨hst, hs⟩ with ⟨b, ⟨bt, bi⟩, sb, h⟩,
1034
1021
{ refine ⟨b, bt, sb, λ x xt, _, bi⟩,
1035
- haveI := classical.dec (x ∈ span K b),
1036
1022
by_contra hn,
1037
1023
apply hn,
1038
1024
rw ← h _ ⟨insert_subset.2 ⟨xt, bt⟩, bi.insert hn⟩ (subset_insert _ _),
@@ -1044,14 +1030,14 @@ begin
1044
1030
end
1045
1031
1046
1032
lemma exists_subset_is_basis (hs : linear_independent K (λ x, x : s → V)) :
1047
- ∃b, s ⊆ b ∧ is_basis K (λ i : b, i.val ) :=
1033
+ ∃b, s ⊆ b ∧ is_basis K (coe : b → V ) :=
1048
1034
let ⟨b, hb₀, hx, hb₂, hb₃⟩ := exists_linear_independent hs (@subset_univ _ _) in
1049
1035
⟨ b, hx,
1050
1036
@linear_independent.restrict_of_comp_subtype _ _ _ id _ _ _ _ hb₃,
1051
1037
by simp; exact eq_top_iff.2 hb₂⟩
1052
1038
1053
1039
variables (K V)
1054
- lemma exists_is_basis : ∃b : set V, is_basis K (λ i : b, i.val ) :=
1040
+ lemma exists_is_basis : ∃b : set V, is_basis K (λ i, i : b → V ) :=
1055
1041
let ⟨b, _, hb⟩ := exists_subset_is_basis linear_independent_empty in ⟨b, hb⟩
1056
1042
1057
1043
variables {K V}
@@ -1101,11 +1087,10 @@ assume t, finset.induction_on t
1101
1087
⟨u, subset.trans hust $ union_subset_union (subset.refl _) (by simp [subset_insert]),
1102
1088
hsu, by simp [eq, hb₂t', hb₁t, hb₁s']⟩)),
1103
1089
begin
1104
- letI := classical.dec_pred (λx, x ∈ s),
1105
1090
have eq : t.filter (λx, x ∈ s) ∪ t.filter (λx, x ∉ s) = t,
1106
1091
{ apply finset.ext.mpr,
1107
1092
intro x,
1108
- by_cases x ∈ s; simp *, finish },
1093
+ by_cases x ∈ s; simp * },
1109
1094
apply exists.elim (this (t.filter (λx, x ∉ s)) (t.filter (λx, x ∈ s))
1110
1095
(by simp [set.subset_def]) (by simp [set.ext_iff] {contextual := tt}) (by rwa [eq])),
1111
1096
intros u h,
@@ -1121,50 +1106,42 @@ let ⟨u, hust, hsu, eq⟩ := exists_of_linear_independent_of_finite_span hs thi
1121
1106
have finite s, from finite_subset u.finite_to_set hsu,
1122
1107
⟨this , by rw [←eq]; exact (finset.card_le_of_subset $ finset.coe_subset.mp $ by simp [hsu])⟩
1123
1108
1124
- lemma exists_left_inverse_linear_map_of_injective { f : V →ₗ[K] V'}
1109
+ lemma linear_map.exists_left_inverse_of_injective ( f : V →ₗ[K] V')
1125
1110
(hf_inj : f.ker = ⊥) : ∃g:V' →ₗ V, g.comp f = linear_map.id :=
1126
1111
begin
1127
1112
rcases exists_is_basis K V with ⟨B, hB⟩,
1128
1113
have hB₀ : _ := hB.1 .to_subtype_range,
1129
1114
have : linear_independent K (λ x, x : f '' B → V'),
1130
1115
{ have h₁ := hB₀.image_subtype
1131
1116
(show disjoint (span K (range (λ i : B, i.val))) (linear_map.ker f), by simp [hf_inj]),
1132
- have h₂ : range (λ (i : B), i.val) = B := subtype.range_val B,
1133
- rwa h₂ at h₁ },
1117
+ rwa B.range_coe_subtype at h₁ },
1134
1118
rcases exists_subset_is_basis this with ⟨C, BC, hC⟩,
1135
1119
haveI : inhabited V := ⟨0 ⟩,
1136
1120
use hC.constr (C.restrict (inv_fun f)),
1137
- apply @is_basis.ext _ _ _ _ _ _ _ _ _ _ _ _ hB,
1138
- intros b,
1121
+ refine hB.ext (λ b, _),
1139
1122
rw image_subset_iff at BC,
1140
- simp,
1141
- have := BC (subtype.mem b),
1142
- rw mem_preimage at this ,
1143
- have : f (b.val) = (subtype.mk (f ↑b) (begin rw ←mem_preimage, exact BC (subtype.mem b) end ) : C).val,
1144
- by simp; unfold_coes,
1145
- rw this ,
1146
- rw [constr_basis hC],
1147
- exact left_inverse_inv_fun (linear_map.ker_eq_bot.1 hf_inj) _,
1123
+ have : f b = (⟨f b, BC b.2 ⟩ : C) := rfl,
1124
+ dsimp,
1125
+ rw [this , constr_basis hC],
1126
+ exact left_inverse_inv_fun (linear_map.ker_eq_bot.1 hf_inj) _
1148
1127
end
1149
1128
1150
- lemma exists_right_inverse_linear_map_of_surjective { f : V →ₗ[K] V'}
1129
+ lemma linear_map.exists_right_inverse_of_surjective ( f : V →ₗ[K] V')
1151
1130
(hf_surj : f.range = ⊤) : ∃g:V' →ₗ V, f.comp g = linear_map.id :=
1152
1131
begin
1153
1132
rcases exists_is_basis K V' with ⟨C, hC⟩,
1154
1133
haveI : inhabited V := ⟨0 ⟩,
1155
1134
use hC.constr (C.restrict (inv_fun f)),
1156
- apply @is_basis.ext _ _ _ _ _ _ _ _ _ _ _ _ hC,
1157
- intros c,
1158
- simp [constr_basis hC],
1159
- exact right_inverse_inv_fun (linear_map.range_eq_top.1 hf_surj) _
1135
+ refine hC.ext (λ c, _),
1136
+ simp [constr_basis hC, right_inverse_inv_fun (linear_map.range_eq_top.1 hf_surj) c]
1160
1137
end
1161
1138
1162
1139
open submodule linear_map
1140
+
1163
1141
theorem quotient_prod_linear_equiv (p : submodule K V) :
1164
1142
nonempty ((p.quotient × p) ≃ₗ[K] V) :=
1165
1143
begin
1166
- haveI := classical.dec_eq (quotient p),
1167
- rcases exists_right_inverse_linear_map_of_surjective p.range_mkq with ⟨f, hf⟩,
1144
+ rcases p.mkq.exists_right_inverse_of_surjective p.range_mkq with ⟨f, hf⟩,
1168
1145
have mkf : ∀ x, submodule.quotient.mk (f x) = x := linear_map.ext_iff.1 hf,
1169
1146
have fp : ∀ x, x - f (p.mkq x) ∈ p :=
1170
1147
λ x, (submodule.quotient.eq p).1 (mkf (p.mkq x)).symm,
@@ -1182,13 +1159,7 @@ open fintype
1182
1159
1183
1160
theorem vector_space.card_fintype [fintype K] [fintype V] :
1184
1161
∃ n : ℕ, card V = (card K) ^ n :=
1185
- begin
1186
- apply exists.elim (exists_is_basis K V),
1187
- intros b hb,
1188
- haveI := classical.dec_pred (λ x, x ∈ b),
1189
- use card b,
1190
- exact module.card_fintype hb,
1191
- end
1162
+ exists.elim (exists_is_basis K V) $ λ b hb, ⟨card b, module.card_fintype hb⟩
1192
1163
1193
1164
end vector_space
1194
1165
@@ -1255,22 +1226,19 @@ section
1255
1226
variables (R η)
1256
1227
1257
1228
lemma is_basis_fun₀ : is_basis R
1258
- (λ (ji : Σ (j : η), (λ _, unit) j ),
1229
+ (λ (ji : Σ (j : η), unit),
1259
1230
(std_basis R (λ (i : η), R) (ji.fst)) 1 ) :=
1260
- begin
1261
- haveI := classical.dec_eq,
1262
- apply @is_basis_std_basis R η (λi:η, unit) (λi:η, R) _ _ _ _ (λ _ _, (1 : R))
1263
- (assume i, @is_basis_singleton_one _ _ _ _),
1264
- end
1231
+ @is_basis_std_basis R η (λi:η, unit) (λi:η, R) _ _ _ _ (λ _ _, (1 : R))
1232
+ (assume i, @is_basis_singleton_one _ _ _ _)
1265
1233
1266
1234
lemma is_basis_fun : is_basis R (λ i, std_basis R (λi:η, R) i 1 ) :=
1267
1235
begin
1268
- apply is_basis.comp (is_basis_fun₀ R η) (λ i, ⟨i, punit.star⟩),
1236
+ apply (is_basis_fun₀ R η).comp (λ i, ⟨i, punit.star⟩),
1269
1237
apply bijective_iff_has_inverse.2 ,
1270
- use (λ x, x. 1 ) ,
1271
- simp [function.left_inverse, function.right_inverse] ,
1272
- intros _ b ,
1273
- rw [unique.eq_default b, unique.eq_default punit.star]
1238
+ use sigma.fst ,
1239
+ suffices : ∀ (a : η) (b : unit), punit.star = b ,
1240
+ { simpa [function.left_inverse, function.right_inverse] } ,
1241
+ exact λ _, punit_eq _
1274
1242
end
1275
1243
1276
1244
end
0 commit comments