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

Commit ad3dfac

Browse files
committed
perf(analysis/complex/circle): fix a slow @[simps] (#17504)
This `@[simps]` is really slow on master and caused me a timeout in #17164, and moreover it generated a bad `simp` lemma (it used `↥(metric.sphere 0 1)` instead of `↥circle`), so I just wrote the lemma by hand.
1 parent c749cc9 commit ad3dfac

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/analysis/complex/circle.lean

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ by rw [coe_inv_circle, inv_def, norm_sq_eq_of_mem_circle, inv_one, of_real_one,
6464
circle.subtype.map_div z w
6565

6666
/-- The elements of the circle embed into the units. -/
67-
@[simps apply] def circle.to_units : circle →* units ℂ := unit_sphere_to_units ℂ
67+
def circle.to_units : circle →* units ℂ := unit_sphere_to_units ℂ
68+
69+
-- written manually because `@[simps]` was slow and generated the wrong lemma
70+
@[simp] lemma circle.to_units_apply (z : circle) :
71+
circle.to_units z = units.mk0 z (ne_zero_of_mem_circle z) := rfl
6872

6973
instance : compact_space circle := metric.sphere.compact_space _ _
7074

0 commit comments

Comments
 (0)