Given several sets containing equal relations ( in “=” or “==” relations) such as
seit1={a1=a2=a3}
or {a1==a2==a3},
set2={a2=b1=b2, b3=b4},or {a2==b1==b2, b3==b4},
How to get all expressions in the equal relation (including its transitive relations), like a1,a2,a3,b1,b2? when input any one of expressions in the relation (any one among a1,a2,a3,b1,b2)?
eqs = {a2 == b1 == b2, b3 == b4};
head = Head[eqs[[1]]];
eqs /. head -> List;
It outputs {{a2 , b1 , b2}, {b3, b4}}.
But now it is needed to print a2 , b1 , b2 when input any one of a2 , b1 , b2; or print b3 and b4 when input any one among b3 and b4.
I tried to write these sentences :
SList=eqs /. head -> List;
SList[[1]];
If [Containing[SList[[1]],Input[] , Print[SList[[1]]],F]
Here hope printing a2 , b1 , b2 when input any one of a2 , b1 , b2 by justifying the input is contained in { a2 , b1 , b2} . But it does not run.Why?
Should there be a better approach to print the items in the “==” relationship like a2 , b1 , b2 when input any one of them?