Check if the address keys under a given chain key in a tree comply with the BIP 44 wallet structure.
This is obtained by existentially quantifying the address index limit in bip44-compliant-addresses-for-limit-p. See the documentation of that function for details.
[BIP44] states that the address keys are not hardened,
so we require the limit to be at most
Theorem:
(defthm bip44-compliant-addresses-p-suff (implies (and (natp address-index-limit) (<= address-index-limit (expt 2 31)) (bip44-compliant-addresses-for-limit-p tree coin-index account-index chain-index address-index-limit)) (bip44-compliant-addresses-p tree coin-index account-index chain-index)))
Theorem:
(defthm booleanp-of-bip44-compliant-addresses-p (b* ((yes/no (bip44-compliant-addresses-p tree coin-index account-index chain-index))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm bip44-compliant-addresses-p-of-bip32-key-tree-fix-tree (equal (bip44-compliant-addresses-p (bip32-key-tree-fix tree) coin-index account-index chain-index) (bip44-compliant-addresses-p tree coin-index account-index chain-index)))
Theorem:
(defthm bip44-compliant-addresses-p-bip32-key-tree-equiv-congruence-on-tree (implies (bip32-key-tree-equiv tree tree-equiv) (equal (bip44-compliant-addresses-p tree coin-index account-index chain-index) (bip44-compliant-addresses-p tree-equiv coin-index account-index chain-index))) :rule-classes :congruence)
Theorem:
(defthm bip44-compliant-addresses-p-of-ubyte32-fix-coin-index (equal (bip44-compliant-addresses-p tree (ubyte32-fix coin-index) account-index chain-index) (bip44-compliant-addresses-p tree coin-index account-index chain-index)))
Theorem:
(defthm bip44-compliant-addresses-p-ubyte32-equiv-congruence-on-coin-index (implies (acl2::ubyte32-equiv coin-index coin-index-equiv) (equal (bip44-compliant-addresses-p tree coin-index account-index chain-index) (bip44-compliant-addresses-p tree coin-index-equiv account-index chain-index))) :rule-classes :congruence)
Theorem:
(defthm bip44-compliant-addresses-p-of-ubyte32-fix-account-index (equal (bip44-compliant-addresses-p tree coin-index (ubyte32-fix account-index) chain-index) (bip44-compliant-addresses-p tree coin-index account-index chain-index)))
Theorem:
(defthm bip44-compliant-addresses-p-ubyte32-equiv-congruence-on-account-index (implies (acl2::ubyte32-equiv account-index account-index-equiv) (equal (bip44-compliant-addresses-p tree coin-index account-index chain-index) (bip44-compliant-addresses-p tree coin-index account-index-equiv chain-index))) :rule-classes :congruence)
Theorem:
(defthm bip44-compliant-addresses-p-of-ubyte32-fix-chain-index (equal (bip44-compliant-addresses-p tree coin-index account-index (ubyte32-fix chain-index)) (bip44-compliant-addresses-p tree coin-index account-index chain-index)))
Theorem:
(defthm bip44-compliant-addresses-p-ubyte32-equiv-congruence-on-chain-index (implies (acl2::ubyte32-equiv chain-index chain-index-equiv) (equal (bip44-compliant-addresses-p tree coin-index account-index chain-index) (bip44-compliant-addresses-p tree coin-index account-index chain-index-equiv))) :rule-classes :congruence)