section ‹K-dimensional Region Trees - Version 2› (* This version does not move quadrants by +2^n but by 2*. Is internally consistent but not the image one expects. Advantages: no need for 2^n, very concise, eg "even" test instead of ≥ 2^n. Maybe reverse bits to get the desired image? *) theory KD_Region_Tree2 imports "HOL-Library.NList" "HOL-Library.Tree" (* only for ‹height› *) begin (* TODO: In Isabelle after 2023 - remove *) lemma nlists_Suc: "nlists (Suc n) A = (⋃a∈A. (#) a ` nlists n A)" by(auto simp: set_eq_iff image_iff in_nlists_Suc_iff) lemma in_nlists_UNIV: "xs ∈ nlists k UNIV ⟷ length xs = k" unfolding nlists_def by(auto)