Commit ee16c22
committed
perf: de-instance some WithLp norm structures used for type synonyms (#31819)
The recent refactor of `WithLp` into a one-field structure caused an unexpected slowdown in completely unrelated files. Some sleuthing by @kbuzzard revealed that this was caused by Lean performing unification on some new instances which are only intended for type synonyms.
Because these are only intended for synonyms, we de-instance them here, and they can be copied over when a user creates a synonym.
During the investigation, we also uncovered that one of the statements (`normSMulClassSeminormedAddCommGroupToProd`) for the `Prod` synonyms was using the wrong norm, and Lean had secretly elaborated the statement using `Prod.toNorm` instead. We fix this error and prevent stray elaboration by locally disabling the usual `Prod`/`Pi` norm instances.1 parent 6d74fdd commit ee16c22
File tree
3 files changed
+24
-10
lines changed- Mathlib/Analysis
- Matrix
- Normed/Lp
3 files changed
+24
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| 254 | + | |
254 | 255 | | |
255 | 256 | | |
256 | 257 | | |
| |||
259 | 260 | | |
260 | 261 | | |
261 | 262 | | |
| 263 | + | |
262 | 264 | | |
263 | 265 | | |
264 | 266 | | |
| |||
268 | 270 | | |
269 | 271 | | |
270 | 272 | | |
| 273 | + | |
271 | 274 | | |
272 | 275 | | |
273 | 276 | | |
| |||
508 | 511 | | |
509 | 512 | | |
510 | 513 | | |
| 514 | + | |
511 | 515 | | |
512 | 516 | | |
513 | 517 | | |
| |||
516 | 520 | | |
517 | 521 | | |
518 | 522 | | |
| 523 | + | |
519 | 524 | | |
520 | 525 | | |
521 | 526 | | |
| |||
525 | 530 | | |
526 | 531 | | |
527 | 532 | | |
| 533 | + | |
528 | 534 | | |
529 | 535 | | |
530 | 536 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1095 | 1095 | | |
1096 | 1096 | | |
1097 | 1097 | | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
1098 | 1101 | | |
1099 | 1102 | | |
1100 | 1103 | | |
| |||
1127 | 1130 | | |
1128 | 1131 | | |
1129 | 1132 | | |
1130 | | - | |
| 1133 | + | |
1131 | 1134 | | |
1132 | 1135 | | |
1133 | 1136 | | |
| |||
1137 | 1140 | | |
1138 | 1141 | | |
1139 | 1142 | | |
1140 | | - | |
| 1143 | + | |
1141 | 1144 | | |
1142 | 1145 | | |
1143 | 1146 | | |
| |||
1146 | 1149 | | |
1147 | 1150 | | |
1148 | 1151 | | |
1149 | | - | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
1150 | 1155 | | |
1151 | 1156 | | |
1152 | 1157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1004 | 1004 | | |
1005 | 1005 | | |
1006 | 1006 | | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
1007 | 1010 | | |
1008 | 1011 | | |
1009 | 1012 | | |
| |||
1036 | 1039 | | |
1037 | 1040 | | |
1038 | 1041 | | |
1039 | | - | |
| 1042 | + | |
1040 | 1043 | | |
1041 | 1044 | | |
1042 | 1045 | | |
| |||
1046 | 1049 | | |
1047 | 1050 | | |
1048 | 1051 | | |
1049 | | - | |
| 1052 | + | |
1050 | 1053 | | |
1051 | 1054 | | |
1052 | 1055 | | |
1053 | 1056 | | |
1054 | 1057 | | |
1055 | | - | |
1056 | | - | |
| 1058 | + | |
1057 | 1059 | | |
1058 | | - | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
1059 | 1063 | | |
1060 | 1064 | | |
1061 | 1065 | | |
1062 | 1066 | | |
1063 | 1067 | | |
1064 | | - | |
1065 | | - | |
| 1068 | + | |
1066 | 1069 | | |
1067 | 1070 | | |
1068 | 1071 | | |
| |||
0 commit comments