induction j using json.json_rect with (P_list := fun l =>
forall l', loop_arr l l' = true -> l = l')
(P_list' := fun l =>
forall l', loop_obj l l' = true -> l = l');
unfold json_eqb.
- intros.
destruct l'.
+ reflexivity.
+ simpl in H. congruence.
- intros.
destruct l'.
+ simpl in H. congruence.
+ simpl in H.
apply Bool.andb_true_iff in H.
assert (j = t).
* apply IHj. apply H.
* assert (l = l').
-- apply IHj0. apply H.
-- now rewrite H0, H1.
- intros.
destruct l'.
* reflexivity.
* simpl in H. congruence.
- intros.
destruct l'; simpl in H.
+ congruence.
+ destruct p.
apply Bool.andb_true_iff in H. destruct H.
apply Bool.andb_true_iff in H0. destruct H0.
assert (s = s0). now apply string_eqb_true in H.
assert (j = t). apply (IHj t H0).
assert (l = l'). apply (IHj0 _ H1).
now rewrite H2, H3, H4.
- destruct j'; try congruence.
- destruct j'; try congruence.
intros.
apply Bool.eqb_prop in H.
now rewrite H.
- destruct j'; try congruence.
intros.
apply EqNat.beq_nat_true in H.
now rewrite H.
- destruct j'; try congruence.
intros.
apply string_eqb_true in H.
now rewrite H.
- fold json_eqb.
fold loop_arr.
destruct j'; try congruence.
intros.
apply IHj in H.
now rewrite H.
- fold json_eqb.
fold loop_obj.
destruct j'; try congruence.
intros.
apply IHj in H.
now rewrite H.
Qed.

Lemma json_eq_eqb : forall j j', j = j' -> json_eqb j j' = true.
Proof using.