You asked
Which leica m 50mm lens is best if I can only spend about 4000 euros?
For a Leica M 50mm on a full-frame body, the guide's pick for most people is the Leica Summicron-M 50mm f/2. It is the classic small 50mm and is listed as cheaper than the APO version, so it leaves room in a budget for a body or a second lens. It is a sensible all-round choice for street, portraits and everyday shooting.
If you shoot in dim light or want the shallowest depth of field, the Leica Noctilux-M 50mm f/1 is the fastest of the three. It was made from 1976 to 2008, so you would be buying used. A fast lens matters more than stabilisation for dim light and moving subjects, so this is the one to choose if low light is your main problem. It is also the heaviest and most expensive way to get there.
If you want the smallest and lightest option, the Leica Elmar-M 50mm f/2.8 is collapsible and easy to carry. It is slower, and it was made until 2007, so it is also a used purchase. It suits daylight shooting and travel rather than low light.
The guide's pages do not give prices for these lenses in what I can see, so I can't say which of them fits 4000 euros. Check each lens page's price section for the current figures, as prices change. Each lens needs a Leica M body, and the guide's first-camera advice is to spend roughly as much on lenses as on the body.
Written by Claude from this site's pages.
From these pages
This answer is for the question above. Each answer is written for the exact question in its address, so a question with its details in it (a budget, what you shoot, what you already have) gets an answer about those details. An answer draws on all 15 pages of the guide and its catalogue of 320 cameras and 1050 lenses. Another question gets its own answer at its own address, as words after /ask/. Or fill in your own: /ask/which-camera-for-{what-you-shoot}-under-{budget}-euros or /ask/which-lens-for-{what-you-shoot}-on-{your-camera}.