How coherent light is created for single slit experiment? This is a diagram showing the single slit interference set up:

The pinhole (or 'peep hole') is said to 'produce a parallel beam of coherent light, because the time interval between light passing through the pinhole and single slit is constant, producing a constant phase difference'.
However, how would this create coherent light, because the filament lamp is an incoherent source, meaning it emits light at random, so wouldn't rays emerging from the peep-hole also emerge at random?
Also is the peephole even necessary? Because the slit by itself would be narrow enough to create coherent light?
 A: Just as it a choppy (incoherent) sea there are clear wavecrests  the light emmited from the incandescent lamp has locally  clear wavecrests (although on a much shorter scale). We  say that the incoherent light has short range coherence.   The   pinhole samples only a small part of the wavefront from the light emitted from the lamp, and as  long as the pinhole, is smaller than the short coherence length of the light the wavefronts that spread out from the hole will be spatially coherent and good for demonstraing interference due to different path lengths like Young's slits when both slits are at same distance from the pinole.   The light from a pinhole will not have good temporal coherence because the period of waves beating on the pinhole will not be strictly periodic so neither will the light emitted from the pinhole. A Mach-Zender interferometer that interferes light against  a time delayed verion of itself will not work well therefore.  
There is a nice picture that illustrates this distinction  at https://en.wikipedia.org/wiki/Coherence_(physics)#Temporal_coherence
under the heading 
"Examples of spatial coherence"
A: The slit does not make the light beam coherent.  The beam's coherence is primarily a function of the source.  You are right that light from a filament is incoherent.  It is temporally incoherent (multi-wavelength) and spatially incoherent (spread out in space).  A slit does increase the spatial coherence of the light: if you consider the slit to be a source, it can be much smaller than the filament.  Interference is possible using light that is only spatially coherent, but if you want easily observed interference fringes, you need light that is both spatially and temporally coherent- like a laser.
A: 
Is the peephole even necessary? Because the slit by itself would be narrow enough to create coherent light?

To see interference effects reliably, the phase of the light should be in step everywhere across the hole. In other words, the spatial coherence length should be larger than than the width of the hole.
In general, passing light through a small hole and then letting it expand back out increases the spatial coherence length. To see why, note that for an infinitely small hole, the phase of the light is automatically the same everywhere across the hole (since it's just one point), so it automatically puts out coherent light. So if you use finite-sized holes, you increase the coherence. In fact, in principle you can repeat it, with multiple layers of pinholes, with the light getting more coherent every time. It's just not very useful in practice because this also makes the final light very dim. 
The diagram is showing a situation where the slit's size and the lamp's coherence length are so that you need one layer of pinholes in between to reliably see interference effects. But this depends on the parameters. In other situations you could need zero, or two. 
A: Coherency is a very important property of waves, whether they are light, sound or water waves.  It is a complex subject especially as physicists have tended to apply the wave properties of water to light ever since the time of Huygen.  But there are important differences, for example water waves through a pinhole do diffract but there is no interference pattern, whereas for light we do get diffraction and interference for the single slit or pinhole. Interference is another complex area, many physicists say light interferes and we see dark spots and brights spots but this is a violation of conservation of energy, even in water 2 waves will "cancel" or "superimpose" but this is only temporary as the water waves reemerge and eventually dissipate their energy by crashing on the beach for example.
Surprisingly even sunlight and incandescent light do have some level of coherence, there is no such thing as perfectly incoherent light!  Why? In order to observe coherence we scientists do need some kind of apparatus and the apparatus effects the light we measure or observe.  The apparatus places geometric constraints on the possible light paths and according to Feynman (who made a determined effort to understand the double slit) we must look at many possible path and compute the ones that are most probable, eventually this was shortened to the fact that light will travel the shortest path that is a multiple of the light wavelength.  A laser is a good example of this phenomenon, mis-align the mirrors and the laser ceases to lase.  
So historically (and somewhat inaccurately) for light we tend to think of coherency as waves arriving in phase (to "interfere") and in many cases this model seems to work .... but for light coherency is more about light of similar wavelengths being emitting from well localized sources that are highly constrained (laser) or less constrained (slit), these light waves are only able to travel certain paths. 
A certain light path or constrained path that light chooses is one where the light arrives or is absorbed at its maximum EM field (of Maxwell's plane wave), thus we can say that the light is arriving in phase, that is its most probable path. It is not that many photons are arriving at a certain point that happen to be in phase.
