@@ -1137,6 +1137,42 @@ by ext i j; refl
1137
1137
lemma transpose_map {f : α → β} {M : matrix m n α} : Mᵀ.map f = (M.map f)ᵀ :=
1138
1138
by { ext, refl }
1139
1139
1140
+ /-- `matrix.transpose` as an `add_equiv` -/
1141
+ @[simps apply]
1142
+ def transpose_add_equiv [has_add α] : matrix m n α ≃+ matrix n m α :=
1143
+ { to_fun := transpose,
1144
+ inv_fun := transpose,
1145
+ left_inv := transpose_transpose,
1146
+ right_inv := transpose_transpose,
1147
+ map_add' := transpose_add }
1148
+
1149
+ @[simp] lemma transpose_add_equiv_symm [has_add α] :
1150
+ (transpose_add_equiv : matrix m n α ≃+ matrix n m α).symm = transpose_add_equiv := rfl
1151
+
1152
+ lemma transpose_list_sum [add_monoid α] (l : list (matrix m n α)) :
1153
+ l.sumᵀ = (l.map transpose).sum :=
1154
+ (transpose_add_equiv : matrix m n α ≃+ matrix n m α).to_add_monoid_hom.map_list_sum l
1155
+
1156
+ lemma transpose_multiset_sum [add_comm_monoid α] (s : multiset (matrix m n α)) :
1157
+ s.sumᵀ = (s.map transpose).sum :=
1158
+ (transpose_add_equiv : matrix m n α ≃+ matrix n m α).to_add_monoid_hom.map_multiset_sum s
1159
+
1160
+ lemma transpose_sum [add_comm_monoid α] {ι : Type *} (s : finset ι) (M : ι → matrix m n α) :
1161
+ (∑ i in s, M i)ᵀ = ∑ i in s, (M i)ᵀ :=
1162
+ (transpose_add_equiv : matrix m n α ≃+ matrix n m α).to_add_monoid_hom.map_sum _ s
1163
+
1164
+ /-- `matrix.transpose` as a `ring_equiv` to the opposite ring -/
1165
+ @[simps]
1166
+ def transpose_ring_equiv [comm_semiring α] [fintype m] : matrix m m α ≃+* (matrix m m α)ᵒᵖ :=
1167
+ { to_fun := λ M, opposite.op (Mᵀ),
1168
+ inv_fun := λ M, M.unopᵀ,
1169
+ map_mul' := λ M N, (congr_arg opposite.op (transpose_mul M N)).trans (opposite.op_mul _ _),
1170
+ ..transpose_add_equiv.trans opposite.op_add_equiv }
1171
+
1172
+ lemma transpose_list_prod [comm_semiring α] [fintype m] [decidable_eq m] (l : list (matrix m m α)) :
1173
+ l.prodᵀ = (l.map transpose).reverse.prod :=
1174
+ (transpose_ring_equiv : matrix m m α ≃+* (matrix m m α)ᵒᵖ).unop_map_list_prod l
1175
+
1140
1176
end transpose
1141
1177
1142
1178
section conj_transpose
@@ -1162,11 +1198,10 @@ by ext i j; simp
1162
1198
(1 : matrix n n α)ᴴ = 1 :=
1163
1199
by simp [conj_transpose]
1164
1200
1165
- @[simp] lemma conj_transpose_add
1166
- [semiring α] [star_ring α] (M : matrix m n α) (N : matrix m n α) :
1201
+ @[simp] lemma conj_transpose_add [add_monoid α] [star_add_monoid α] (M N : matrix m n α) :
1167
1202
(M + N)ᴴ = Mᴴ + Nᴴ := by ext i j; simp
1168
1203
1169
- @[simp] lemma conj_transpose_sub [ring α] [star_ring α] (M : matrix m n α) ( N : matrix m n α) :
1204
+ @[simp] lemma conj_transpose_sub [add_group α] [star_add_monoid α] (M N : matrix m n α) :
1170
1205
(M - N)ᴴ = Mᴴ - Nᴴ := by ext i j; simp
1171
1206
1172
1207
@[simp] lemma conj_transpose_smul [comm_monoid α] [star_monoid α] (c : α) (M : matrix m n α) :
@@ -1179,6 +1214,46 @@ by ext i j; simp [mul_comm]
1179
1214
@[simp] lemma conj_transpose_neg [ring α] [star_ring α] (M : matrix m n α) :
1180
1215
(- M)ᴴ = - Mᴴ := by ext i j; simp
1181
1216
1217
+ /-- `matrix.conj_transpose` as an `add_equiv` -/
1218
+ @[simps apply]
1219
+ def conj_transpose_add_equiv [add_monoid α] [star_add_monoid α] : matrix m n α ≃+ matrix n m α :=
1220
+ { to_fun := conj_transpose,
1221
+ inv_fun := conj_transpose,
1222
+ left_inv := conj_transpose_conj_transpose,
1223
+ right_inv := conj_transpose_conj_transpose,
1224
+ map_add' := conj_transpose_add }
1225
+
1226
+ @[simp] lemma conj_transpose_add_equiv_symm [add_monoid α] [star_add_monoid α] :
1227
+ (conj_transpose_add_equiv : matrix m n α ≃+ matrix n m α).symm = conj_transpose_add_equiv := rfl
1228
+
1229
+ lemma conj_transpose_list_sum [add_monoid α] [star_add_monoid α] (l : list (matrix m n α)) :
1230
+ l.sumᴴ = (l.map conj_transpose).sum :=
1231
+ (conj_transpose_add_equiv : matrix m n α ≃+ matrix n m α).to_add_monoid_hom.map_list_sum l
1232
+
1233
+ lemma conj_transpose_multiset_sum [add_comm_monoid α] [star_add_monoid α]
1234
+ (s : multiset (matrix m n α)) :
1235
+ s.sumᴴ = (s.map conj_transpose).sum :=
1236
+ (conj_transpose_add_equiv : matrix m n α ≃+ matrix n m α).to_add_monoid_hom.map_multiset_sum s
1237
+
1238
+ lemma conj_transpose_sum [add_comm_monoid α] [star_add_monoid α] {ι : Type *} (s : finset ι)
1239
+ (M : ι → matrix m n α) :
1240
+ (∑ i in s, M i)ᴴ = ∑ i in s, (M i)ᴴ :=
1241
+ (conj_transpose_add_equiv : matrix m n α ≃+ matrix n m α).to_add_monoid_hom.map_sum _ s
1242
+
1243
+ /-- `matrix.conj_transpose` as a `ring_equiv` to the opposite ring -/
1244
+ @[simps]
1245
+ def conj_transpose_ring_equiv [comm_semiring α] [star_ring α] [fintype m] :
1246
+ matrix m m α ≃+* (matrix m m α)ᵒᵖ :=
1247
+ { to_fun := λ M, opposite.op (Mᴴ),
1248
+ inv_fun := λ M, M.unopᴴ,
1249
+ map_mul' := λ M N, (congr_arg opposite.op (conj_transpose_mul M N)).trans (opposite.op_mul _ _),
1250
+ ..conj_transpose_add_equiv.trans opposite.op_add_equiv }
1251
+
1252
+ lemma conj_transpose_list_prod [comm_semiring α] [star_ring α] [fintype m] [decidable_eq m]
1253
+ (l : list (matrix m m α)) :
1254
+ l.prodᴴ = (l.map conj_transpose).reverse.prod :=
1255
+ (conj_transpose_ring_equiv : matrix m m α ≃+* (matrix m m α)ᵒᵖ).unop_map_list_prod l
1256
+
1182
1257
end conj_transpose
1183
1258
1184
1259
section star
@@ -1195,6 +1270,10 @@ lemma star_eq_conj_transpose [has_star α] (M : matrix m m α) : star M = Mᴴ :
1195
1270
instance [has_involutive_star α] : has_involutive_star (matrix n n α) :=
1196
1271
{ star_involutive := conj_transpose_conj_transpose }
1197
1272
1273
+ /-- When `α` is a `*`-additive monoid, `matrix.has_star` is also a `*`-additive monoid. -/
1274
+ instance [add_monoid α] [star_add_monoid α] : star_add_monoid (matrix n n α) :=
1275
+ { star_add := conj_transpose_add }
1276
+
1198
1277
/-- When `α` is a `*`-(semi)ring, `matrix.has_star` is also a `*`-(semi)ring. -/
1199
1278
instance [fintype n] [decidable_eq n] [semiring α] [star_ring α] : star_ring (matrix n n α) :=
1200
1279
{ star_add := conj_transpose_add,
0 commit comments