section ‹K-dimensional Region Trees - Nested Trees› (* Nested trees: Each level of the k-d tree (kdt) is encapsulated in a separate splitting tree (tree1). Experimental. *) theory KD_Region_Nested imports "HOL-Library.NList" 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 nlists_singleton: "nlists n {a} = {replicate n a}" unfolding nlists_def by(auto simp: replicate_length_same dest!: subset_singletonD) fun cube :: "nat ⇒ nat ⇒ nat list set" where "cube k n = nlists k {0..<2^n}"