Given two field elements as input of Arithmetic Circuit (consists of adding gates and multiplicating gates only), how could I output the bigger one? Or, how to place the gates in order to distinguish which one is bigger (using Arithmetic Circuit)? Could you please describe the method in picture?
In Zero-knowledge Proof, the statement to be proved would be described in a standard form first, such as Boolean Circuit / Arithmetic Circuits / R1CS. General proof schemes could deal with any kind of statement, so that any type of function could be conveyed by Arithmetic Circuit. Then, if Boolean Circuit can implement the comparison function, I think Arithmetic Circuit would definitely be able to do the same thing. A majority of online materials look like "you can compile any statement into R1CS easily". But when it comes to the specific way to implement a function (I mean, how to place the gates in a circuit), there are few discussions on the Internet. Most results from the search engine are "full-adder" "xor gate" "introduction to zk-SNARKs" "verilog" "circuit complexity" and so on, which is not helpful enough.
I know comparison can be implemented easily on Boolean Circuits, but I still need to implement it on Arithmetic Circuits, which consists of adding gates and multiplicating gates only. I used to think it is an easy target, but I discovered that I probably underestimated its difficulty. My classmate told me that "such an Arithmetic Circuit would be very complex", but even then, I am still wondering how complex (in specific) it would be. There is another Q&A on StackExchange (Boolean Circuits vs Arithmetic Circuits) that has introduced a method to emulate boolean gates on Arithmetic Circuits, which I thought would be helpful to me. However, I could not verify its validity. For example, 2 and 5 = 0010 and 0101 = 0000, but according to the QA, the result would be 2·5=10 (1010).
I want to implement a comparison function described above using Arithmetic Circuit (just ciruit, no need to be zero-knowledge), could you please teach me how to place the adding gates and multiplicating gates? If it would be a very complex circuit, how to analyze that how many gates are exactly enough?