Does Bayer demosaicing from RGB-filter sensors work *because* the color filters are imprecise? I have an ongoing friendly dispute with another member over on Photo Stack Exchange about the fundamentals of how RAW works, and I'm hoping you can settle it.
My understanding is that Bayer demosaicing works basically entirely on the assumption that one can deduce likely color information from monochromatic pixels. That is, for a pixel with a blue filter, you can assume that the correct green value is close to the average of neighboring green-filtered pixels, and the red value close to the average of neighboring red-filtered pixels — even if those filters were to be theoretically perfect.
My site-colleague argues that, as shown in this graph:

the filters have a lot of overlap, and describes the demosiacing algorithms as working because they recover that overlap.
Who is correct here? Would Bayer demosaicing work if the filters had no overlap?
(Bonus questions: would this be an improvement, or actually a downside? Presumably you'd be letting in less light overall; would you get more accurate color for that price? I know that simple averaging "works" for demosiacing; are there more complicated algorithms which do take overlap into effect explicitly?)
 A: The demosaicing algorithm which you describe (there are many more complex algorithms, but sticking with the simplest for the moment) is a linear operation - the resultant RGB values for each pixel are a linear combination of the raw pixel values.
To subsiquently correct the demosaiced pixels to reflect a colour primary standard (sRGB or rec709) is also, most commonly, a linear operation.
To start off with RGB filters which are purer, that is which better reflect a colour standard, would be equivalent to being able to perform the colour correction step first. As both of these steps are linear then it should make no difference in which order you perform them therefore there would be no difference in the output image.
So IF the demosaicing is linear and IF you will be colour correcting to the same standard in the output THEN there will be no difference.
In practice (we work with RAW data and use custom non-linear demosaicing and substantially linear colour correction) this also seems to more generally hold true for less linear steps.  You do get a smoother result due to pixel correlation in the RAW image but the colour correction step then magnifies those differences so that additional correlation then disappears.
BTW the Bayer demosaicing algorithms generally rely on the fact that hue variations are 'slower' in an image than lightness variations (and indeed less visible due to our own image processing) so there will be a longer-range correlation between the relative R, G and B values.  So in other words they are not relying on spectral correlations between R, G and B, rather they rely on the R, G and B signals to correlate in their reflections from a particuar object or surface.
A: Most situations, you would probably not notice the difference if there was no overlap. There are a few situations where we see monochromatic light in the real world. Rainbows, lasers, polarized reflections among other things. A rainbow is good example because you have the whole visible spectrum in one shot. If there was not overlap in the detectors sensitivity bands, you would have weak sensitivity zones in the colors in between the sensitivity peaks since the yellow and cyan in the rainbow are not actually made from a composition of either neighboring color. It's just pure yellow and there is no yellow detector.
