Zulip Chat Archive

Stream: Is there code for X?

Topic: Star-semilinear maps are semilinear when star is trivial


Eric Wieser (May 19 2023 at 06:18):

In #19038 (for #Is there code for X? > Derivative commutes with conjugation), I need docs#starL as a linear equivalence (in the presense of has_trivial_star R), not as a semi-linear equivalence. Do we have any existing machinery to do this conversion? Perhaps a semi-linear version of restrict_scalars?

Eric Wieser (May 19 2023 at 06:19):

Currently I have

@[simps]
def starL' (R : Type*) {A : Type*}
  [comm_semiring R] [star_ring R] [has_trivial_star R] [add_comm_monoid A] [star_add_monoid A]
  [module R A] [star_module R A] [topological_space A] [has_continuous_star A] :
    A L[R] A :=
(starL R : A L[R] A).trans
  ({ map_smul' := λ r a, by simp [star_ring_end_apply],
    continuous_to_fun := continuous_id,
    continuous_inv_fun := continuous_id,
    ..add_equiv.refl A, } : A L[R] A)

but that seems ugly

Heather Macbeth (May 19 2023 at 06:21):

Can you explain what has_trivial_star is and why you aren't using R\mathbb{R}?

Eric Wieser (May 19 2023 at 06:22):

has_trivial_star says star x = x for all x. Using it instead of R\mathbb{R} means that Q\mathbb{Q} is covered too.

Heather Macbeth (May 19 2023 at 06:23):

Hmm, but why do you need a star at all?

Eric Wieser (May 19 2023 at 06:23):

Because we don't have a typeclass that says star (c • x) = c • star x

Eric Wieser (May 19 2023 at 06:23):

We only have one that says star (c • x) = star c • star x (docs#star_module)

Heather Macbeth (May 19 2023 at 06:24):

I think I don't understand why you're not just working with a general division ring? What's the setting?

Eric Wieser (May 19 2023 at 06:24):

do you mean for R or A?

Heather Macbeth (May 19 2023 at 06:25):

RR, I guess, the thing you are describing as a "ring with trivial star"

Eric Wieser (May 19 2023 at 06:26):

So in practice yes,R is a nontrivially_normed_field for everything that comes later in the PR

Eric Wieser (May 19 2023 at 06:26):

But I still need the non-semilinear linear map in order to state the fderiv results

Heather Macbeth (May 19 2023 at 06:26):

Eric Wieser said:

So in practice yes,R is a nontrivially_normed_field for everything that comes later in the PR

So not the quaternions.

Eric Wieser (May 19 2023 at 06:27):

No, but A can be the quaternions

Eric Wieser (May 19 2023 at 06:27):

(and indeed, that's one of the motivations for #19038)

Eric Wieser (May 19 2023 at 06:28):

So to answer your original question again; using R\mathbb{R} would be sufficient for what I'm actually doing, but I would still need starL' in some form

Heather Macbeth (May 19 2023 at 06:28):

I think I am missing some context here, I just don't understand why you are considering this "has trivial star" typeclass at all enough to need its derivative.

Eric Wieser (May 19 2023 at 06:29):

The result I want to state is:

theorem has_fderiv_at.star (h : has_fderiv_at f f' x) :
  has_fderiv_at (λ x, star (f x)) (((starL' 𝕜 : F L[𝕜] F) : F L[𝕜] F) L f') x :=
h.star

Heather Macbeth (May 19 2023 at 06:29):

For what typeclasses?

Eric Wieser (May 19 2023 at 06:29):

(note this is in the PR, if that helps)

Eric Wieser (May 19 2023 at 06:30):

variables {𝕜 : Type*} [nontrivially_normed_field 𝕜] [star_ring 𝕜] [has_trivial_star 𝕜]
variables {E : Type*} [normed_add_comm_group E] [normed_space 𝕜 E]
variables {F : Type*} [normed_add_comm_group F] [star_add_monoid F] [normed_space 𝕜 F]
  [star_module 𝕜 F] [has_continuous_star F]

variables {f : E  F}
variables {f' : E L[𝕜] F}

Heather Macbeth (May 19 2023 at 06:30):

OK, it's just not clear to me that this is a useful generalization. Why don't you just take k\mathbb{k} to be a commutative ring? Or even to be R\mathbb{R} itself?

Eric Wieser (May 19 2023 at 06:31):

Because if you try it, you'll need star as a R\R-linear map, and we don't have a typeclass that lets us do that; docs#star_smul doesn't exist

Eric Wieser (May 19 2023 at 06:35):

(I agree that the generalization to arbitrary 𝕜 for has_fderiv_at.star is pretty useless and would suffice for all the cases I can think of; but I think it's orthogonal to my question)

Heather Macbeth (May 19 2023 at 06:38):

So your situation is that you want to uniformly consider C\mathbb{C} and H\mathbb{H} as R\mathbb{R}-modules, and have a generic way of referring to the conjugation as a R\mathbb{R}-linear map?

Kevin Buzzard (May 19 2023 at 06:39):

(deleted)

Eric Wieser (May 19 2023 at 06:42):

Yes; and the reason I need it as a linear map is because It needs to be usable in the second argument of docs#has_fderiv_at, which does not accept semilinear maps (which I assume is because that wouldn't be mathematically meaningful, but I don't really know for sure)

Eric Wieser (May 19 2023 at 06:45):

and have a generic way of referring to the conjugation as a RR-linear map?

Or a general way to change the σ in a linear map, such as

variables {R₁ R₂ R₁' R₂' M N : Type*}
  [semiring R₁] [semiring R₂] [add_comm_monoid M] [add_comm_monoid N]
  [module R₁ M] [module R₂ N] {σ σ' : R₁ →+* R₂}

/-- Replace the ring morphism in a semilinear map with an equal one.
This has better defeq than `h ▸  f`  and is easier to elaborate. -/
def linear_map.change_scalarsₛₗ (h : σ = σ') (f : M →ₛₗ[σ] N) : M →ₛₗ[σ'] N :=
{ map_smul' := λ c x, h map_smulₛₗ f c x,
  ..f }

-- repeat for `linear_equiv`, `continuous_linear_equiv`, etc

then the answer would be (starL ℝ).change_scalarsₛₗ (star_end_eq_ring_hom_id) or something

Heather Macbeth (May 19 2023 at 06:47):

Eric Wieser said:

Perhaps a semi-linear version of restrict_scalars?

It seems like this would do it. If you have MiM_i a module over RiR_i and RiR_i an algebra over SiS_i, and ring homomorphisms ρ:R1R2\rho:R_1\to R_2 and σ:S1S2\sigma:S_1\to S_2, and a typeclass saying that σalg_hom1=alg_hom2ρ\sigma \circ \operatorname{alg\_hom}_1=\operatorname{alg\_hom}_2\circ \rho, then maybe you can restrict-scalars a ρ\rho-linear map to a σ\sigma-linear map.

Heather Macbeth (May 19 2023 at 06:49):

Specialize to R1=R2{C,H}R_1=R_2\in\{\mathbb{C},\mathbb{H}\} and S1=S2=RS_1=S_2=\mathbb{R} and ρ=conj\rho=\operatorname{conj} and σ=id\sigma=\operatorname{id}.

Heather Macbeth (May 19 2023 at 06:49):

I've thought vaguely about this before, the lack of such a construction prevented @Floris van Doorn and I from doing the Hom\operatorname{Hom} of smooth vector bundles in the right generality.

Heather Macbeth (May 19 2023 at 06:51):

(You want the bundle of conjugate-linear maps between two holomorphic vector bundles to be a real-smooth vector bundle.)

Eric Wieser (May 19 2023 at 06:54):

Here's an adapted version of your suggestion that doesn't need a full algebra:

import algebra.module.linear_map

variables {R₁ R₂ R₁' R₂' M N : Type*}
  [semiring R₁] [semiring R₂] [semiring R₁'] [semiring R₂']
  [add_comm_monoid M] [add_comm_monoid N]
  [module R₁ M] [module R₂ N] [module R₁' M] [module R₂' N]
  [mul_action R₁' R₁] [mul_action R₂' R₂]
  [is_scalar_tower R₁' R₁ M] [is_scalar_tower R₂' R₂ N]
   {σ : R₁ →+* R₂} (σ' : R₁' →+* R₂')

def linear_map.restrict_scalarsₛₗ (f : M →ₛₗ[σ] N) (h :  c, σ (c  1) = σ' c  1) :
  M →ₛₗ[σ'] N :=
{ to_fun := f,
  map_smul' := λ c x, by rw [smul_one_smul R₁ c x, smul_one_smul R₂ (σ' c) (f x),
    map_smulₛₗ f (c  1 : _) x, h],
  ..f }

Eric Wieser (May 19 2023 at 06:55):

(apologies for the different variable names, I'd already started writing it when you posted your comment)

Eric Wieser (May 19 2023 at 06:56):

But restricting semilinear maps might be an #xy problem; perhaps a star_invariant_module typeclass would be the easy way out here

Heather Macbeth (May 19 2023 at 06:57):

Hmm, don't you then have to identify the invariant submodule with R\mathbb{R} itself? That seems ugly. I think restricting semilinear maps is the right choice, at least in my application which I've though about more than yours ....

Eric Wieser (May 19 2023 at 06:59):

I'm happy to take your word for it; I think my application doesn't care

Eric Wieser (May 19 2023 at 07:00):

Though maybe we need both; we could unify docs#clifford_algebra.star_smul and docs#quaternion.star_smul with a star_invariant_module typeclass

Heather Macbeth (May 19 2023 at 07:01):

Actually, maybe Floris and I need something slightly different -- not the fact that the conjugate-linear maps are real-linear themselves, but that the collection they form is a real vector space.

Eric Wieser (May 19 2023 at 07:02):

Doesn't docs#linear_map.module already provide that?

Heather Macbeth (May 19 2023 at 07:03):

Indeed, looks like it!

Eric Wieser (May 19 2023 at 07:06):

Unwinding the stack briefly; is starL' an acceptable hack for the purpose of #19038? It has the advantage of being above the porting tide, while adding a semilinear restrict_scalars would not be

Heather Macbeth (May 19 2023 at 07:18):

Eric Wieser said:

Doesn't docs#linear_map.module already provide that?

Looked at it briefly, this seems correct but the path is then littered with other tasks: a continuous-linear version of this construction, a vector bundle version of is_scalar_tower, and more ...

Eric Wieser (May 19 2023 at 07:19):

docs#continuous_linear_map.module already provides the next task I think?

Eric Wieser (May 19 2023 at 07:19):

It's hard to say for sure without actually asking Lean of course!

Heather Macbeth (May 19 2023 at 07:19):

Ah, very good!

Eric Wieser (May 19 2023 at 07:20):

And maybe docs#continuous_linear_map.is_scalar_tower (added in #10494) is your last task?

Heather Macbeth (May 19 2023 at 07:21):

The latter task should really be a vector bundle construction, so I don't think so. And I think there's also more to do on docs#continuous_linear_map.module: one needs to topologize this and normify it :(

Eric Wieser (May 19 2023 at 07:23):

docs#continuous_linear_map.to_normed_space also already exists

Eric Wieser (May 19 2023 at 07:38):

Heather Macbeth said:

at least in my application which I've though about more than yours ....

Did we conclude then that your application wouldn't benefit from restricting semilinear maps after all?

Heather Macbeth (May 19 2023 at 07:42):

Actually, I just came to the conclusion that it needs that too! But I don't think I will believe it until I've slept on it.

Heather Macbeth (May 19 2023 at 07:42):

Anyway, that has to happen after the port.

Eric Wieser (May 19 2023 at 07:44):

I would claim that #19038 can safely happen during the port :)

Eric Wieser (May 19 2023 at 07:45):

I can add a todo comment referencing the ideas here next to starL'


Last updated: Dec 20 2023 at 11:08 UTC