Huge thanks to Lúcás Meier @cronokirby for asking this question.
UPDATE: Weikeng Chen has suggested an even simpler version of this approach, which is relative to it in a similar way to how Pinoccio is related to Groth16.
This largely deprecates the "Pinoccio" approach. Brief explanation: instead of just separating private and public inputs as in normal Groth16, lets make a more refined separation of witness, by using few elements
So, more precisely, the question asked was "can R1CS support lookups". There is, indeed, a very simple and natural extension of the R1CS language which can support lookups and all sorts of other interesting things.
Here, I will describe it, and suggest possible Groth16-style proof system for this language.
The instance of SR1CS (sequential rank 1 constraint system) is defined as follows:
It is a R1CS circuit, together with the splitting - the set of wires
Morally, it should be thought of as a sequential process: some constraint system is created, and then the verifier is asked for some challenges. In the next round, we add additional constraints (and additional wires), and maybe use challenges, and repeat the process.
I will not define witness here (because it encodes an interactive process), but knowledge of SR1CS means that we are able to respond to random challenges in this sequential process with overwhelming probability.
There are, probably, few different ways of doing it (I could imagine staightforward one exposing KZG-commitment as public input IC, and then interfacing between them using this).
I will suggest a simple method based on KoE. I wonder if it can be improved.
UPD: yes, it can be improved, as suggested by Weikeng Chen.
Namely, lets assume that with each element
Now, the following data is produced:
Here,
The following conditions need to be checked:
For example, normal lookup argument will then require 3 more group elements and 1 additional pairing check (because it only involves 1 challenge round).
I am not sure, but I think yes.
The overhead of doing this is few more MSMs, but the crucial O(nlog(n)) part of producing the witness is completely unchanged.
I will try to compare R1CS to KZG-PlonK here.
It also potentially allows different kinds of useful arguments using challenges - Liam Eagan's MSM comes to mind.