perf(FieldTheory/PurelyInseparable): golf proof#41664
Conversation
…Char_pow_of_isSeparable proof The old proof transported `Algebra.IsSeparable M L` across the definitional equality between `(inclusion hi).toAlgebra` and the canonical `Algebra` instance on `extendScalars hi`. Checking that single instance defeq costs the kernel ~460ms (~80% of the file's kernel type-checking time), and it is paid twice if the `haveI` there is replaced by `have` (the cause of the 13.6% instruction-count regression radar reported on leanprover-community#41615). The new elementwise proof stays on canonical instances throughout: kernel type-checking of this declaration drops from 580ms to 22ms and the whole file compiles ~20% faster. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
!radar |
|
Benchmark results for 23363c2 against 4694604 are in. No significant results found. @kbuzzard Warning These warnings may indicate that the benchmark results are not directly comparable, for example due to changes in the runner configuration or hardware.
Medium changes (1✅)
Small changes (1✅) 1 hidden |
PR summary 23363c2bd3Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
|
I think the 187G figure must be bogus but the 20% speedup in the file I'm editing is genuine. |
| rintro _ ⟨y, hy, rfl⟩ | ||
| have := expChar_of_injective_algebraMap (algebraMap F M).injective q | ||
| refine le_antisymm (adjoin_le_iff.2 fun x hx ↦ ?_) (adjoin_le_iff.2 ?_) | ||
| · have : Algebra.IsSeparable M (adjoin M {x}) := |
There was a problem hiding this comment.
| · have : Algebra.IsSeparable M (adjoin M {x}) := | |
| · have : Algebra.IsSeparable M M⟮x⟯ := |
Maybe this looks better (untested) Same as two adjoin M {x} below.
|
✌️ kbuzzard can now approve this pull request until 2026-07-27 09:36 UTC (in 2 weeks). To approve and merge, reply with
|
This one proof was taking a huge amount of time to typecheck, presumably because of some defeq abuse. Fixing this up gives a nice speedup in this file.
Claude says: The old proof transported
Algebra.IsSeparable M Lacross the definitional equality between(inclusion hi).toAlgebraand the canonicalAlgebrainstance onextendScalars hi. Checking that single instance defeq costs the kernel ~460ms (~80% of the file's kernel type-checking time), and it is paid twice if thehaveIthere is replaced byhave(the cause of the 13.6% instruction-count regression radar reported on #41615).What Claude says looks reasonable to me.