# Inserting entrywise

I have a list

m={a,b,c,d};


How can I insert $$==0$$ to get list of equations so that the function Solve can take it as an argument?

m={a==0,b==0,c==0,d==0}


How to remove curly brackets to get?

m=a==0,b==0,c==0,d==0

• eqs = Thread[Equal[m, 0]]
– Syed
Dec 19, 2022 at 12:45
• eqs = # == 0 & /@ m
– Syed
Dec 19, 2022 at 13:06
• The OP could have received many more answers by waiting a bit before accepting an answer. Its a good idea to wait until you have tested answers befor voting them, and wait further 24hours for other answers before accepting the best one, giving time to other people to contribute. Dec 19, 2022 at 13:32
• Replace[m, a_ -> a == 0, 1]
– Syed
Dec 19, 2022 at 13:41
• m /. {List -> List, a_Symbol -> a == 0}
– Syed
Dec 19, 2022 at 13:50

The following

Thread[Flatten /@ (m == Table[0, Length@m])]

Inner[Equal, m, Table[0, Length@m], List]

Equal @@@ Transpose[{m, Table[0, Length@m]}]

InternalInheritedBlock[{Equal}, SetAttributes[Equal, Listable];
m == Table[0, Length@m]]


Edit:

About the second part of the question... I don't really understand what you mean. Perhaps the following?

Extract[1]@{a == 0, b == 0, c == 0, d == 0}


• Very nice, InheritedBlock is also a resource function from Wolfram research. The possible issues section can be interesting. Dec 20, 2022 at 5:45
eqns = Table[lhs == 0, {lhs, m}]

eqns = Map[EqualTo[0],m]

eqns = Thread[Equal[m, 0]] (* Credit Syed *)


To use as arguments you can do

f[1,2,Sequence@@eqns]

• @bmf just updated to address that. Dec 19, 2022 at 13:26
• yes, just saw that :-)
– bmf
Dec 19, 2022 at 13:28
m = {a, b, c, d};


Using Cases

Cases[m, x_ :> x == 0]


Using MapAt

MapAt[# == 0 &, All] @ m


Using ReplaceAt (new in 13.1)

ReplaceAt[x_ :> x == 0, All] @ m


All return

{a == 0, b == 0, c == 0, d == 0}

m = {a, b, c, d};


Using Outer and MapApply:

# == 0 & @@@ Outer[List, m]


{a == 0, b == 0, c == 0, d == 0}`