Lean4
/-- The inductively defined smallest ring congruence relation containing a given binary
relation. -/
inductive Rel [Add R] [Mul R] (r : R → R → Prop) : R → R → Prop
| of : ∀ x y, r x y → RingConGen.Rel r x y
| refl : ∀ x, RingConGen.Rel r x x
| symm : ∀ {x y}, RingConGen.Rel r x y → RingConGen.Rel r y x
| trans : ∀ {x y z}, RingConGen.Rel r x y → RingConGen.Rel r y z → RingConGen.Rel r x z
| add : ∀ {w x y z}, RingConGen.Rel r w x → RingConGen.Rel r y z → RingConGen.Rel r (w + y) (x + z)
| mul : ∀ {w x y z}, RingConGen.Rel r w x → RingConGen.Rel r y z → RingConGen.Rel r (w * y) (x * z)