Zulip Chat Archive

Stream: general

Topic: extending an instance


Chris Birkbeck (Nov 02 2022 at 11:42):

This is probably a very basic question, but I'm wondering about the best way to extend instances. I have a slash_invariant_form structure and a modular_form which extends it. I now want to prove an instance of has_add for each. Is there a way to make use of the extends? Specifically, I have:

variables (F : Type*) (Γ : subgroup SL(2, )) (k : )

structure slash_invariant_form :=
(to_fun :   )
(slash_action_eq' :  γ : Γ, to_fun [k, γ] = to_fun)

instance has_add : has_add (slash_invariant_form Γ k) := sorry --Say I have this

--Can I use this to make the following easier (i.e. only prove that `mdifferentible` and `bdd_` behaves well?

structure modular_form extends slash_invariant_form Γ k :=
(hol' : mdifferentiable 𝓘() 𝓘() (to_fun :   ))
(bdd_at_infty' :  (A : SL(2, )), is_bounded_at_im_infty (to_fun [k, A]))

instance modular_form.has_add : has_add (modular_form Γ k) := sorry

It feels that I should be able to use the fact that modular_form extends slash_invariant_form to make it so that, if I define the add the same way, then I only need to check that hol' and bdd_at_infty' are additive, but I'm not sure how to do this.

Eric Wieser (Nov 02 2022 at 12:20):

Have a look at how docs#continuous_linear_map.has_add is defined

Eric Wieser (Nov 02 2022 at 12:22):

In general, you define the addition as λ x y, { new_field := _, .. x.to_foo + y.to_foo } for old-style structures, or λ x y, { new_field := _, to_foo := x.to_foo + y.to_foo } for new-style structures.

Chris Birkbeck (Nov 02 2022 at 12:23):

perfect thats what I was looking for!

Eric Wieser (Nov 02 2022 at 12:24):

Note that for things with to_fun we tend to prefer "old" style (set_option old_structure_cmd true)


Last updated: Dec 20 2023 at 11:08 UTC