/- Copyright 2026 The Formal Conjectures Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ module public import Mathlib.Data.Nat.Log public import Mathlib.Order.Antichain public import Mathlib.Algebra.Order.BigOperators.Group.Finset public import Mathlib.Algebra.BigOperators.Ring.Finset public import Mathlib.Tactic.NormNum public import Mathlib.Tactic.Positivity public import Mathlib.Tactic.Ring

Divisibility antichains of products of powers of two and three

The inductive construction used in the classical two-generator d-completeness result.

@[expose] public section

Every natural number is the sum of a finite divisibility antichain of numbers of the form $2^a 3^b$. The construction proceeds by strong induction, separating the even and odd cases.

m:ℕih:∀ m_1 < 2 * m + 1, ∃ s, (∀ x ∈ s, ∃ a b, x = 2 ^ a * 3 ^ b) ∧ IsAntichain (fun x1 x2 ↦ x1 ∣ x2) ↑s ∧ s.sum id = m_1hn:2 * m + 1 > 0k:ℕh1:3 ^ k ≤ 2 * m + 1h2:2 * m + 1 < 3 ^ k * 3j:ℕhj:3 ^ k = 2 * j + 1s:Finset ℕhs:∀ x ∈ s, ∃ a b, x = 2 ^ a * 3 ^ bhanti:IsAntichain (fun x1 x2 ↦ x1 ∣ x2) ↑shsum:s.sum id = m - jhle:∀ y ∈ s, y ≤ m - jhpos:∀ y ∈ s, 0 < yhnot:3 ^ k ∉ Finset.image (fun x ↦ 2 * x) s⊢ id (3 ^ k) + ∑ x ∈ s, id (2 * x) = 2 * m + 1 m:ℕih:∀ m_1 < 2 * m + 1, ∃ s, (∀ x ∈ s, ∃ a b, x = 2 ^ a * 3 ^ b) ∧ IsAntichain (fun x1 x2 ↦ x1 ∣ x2) ↑s ∧ s.sum id = m_1hn:2 * m + 1 > 0k:ℕh1:3 ^ k ≤ 2 * m + 1h2:2 * m + 1 < 3 ^ k * 3j:ℕhj:3 ^ k = 2 * j + 1s:Finset ℕhs:∀ x ∈ s, ∃ a b, x = 2 ^ a * 3 ^ bhanti:IsAntichain (fun x1 x2 ↦ x1 ∣ x2) ↑shsum:s.sum id = m - jhle:∀ y ∈ s, y ≤ m - jhpos:∀ y ∈ s, 0 < yhnot:3 ^ k ∉ Finset.image (fun x ↦ 2 * x) sthis:∑ x ∈ s, id (2 * x) = 2 * s.sum id⊢ id (3 ^ k) + ∑ x ∈ s, id (2 * x) = 2 * m + 1 m:ℕih:∀ m_1 < 2 * m + 1, ∃ s, (∀ x ∈ s, ∃ a b, x = 2 ^ a * 3 ^ b) ∧ IsAntichain (fun x1 x2 ↦ x1 ∣ x2) ↑s ∧ s.sum id = m_1hn:2 * m + 1 > 0k:ℕh1:3 ^ k ≤ 2 * m + 1h2:2 * m + 1 < 3 ^ k * 3j:ℕhj:3 ^ k = 2 * j + 1s:Finset ℕhs:∀ x ∈ s, ∃ a b, x = 2 ^ a * 3 ^ bhanti:IsAntichain (fun x1 x2 ↦ x1 ∣ x2) ↑shle:∀ y ∈ s, y ≤ m - jhpos:∀ y ∈ s, 0 < yhnot:3 ^ k ∉ Finset.image (fun x ↦ 2 * x) sthis:∑ x ∈ s, 2 * x = 2 * ∑ x ∈ s, xhsum:∑ x ∈ s, x = m - j⊢ 3 ^ k + ∑ x ∈ s, 2 * x = 2 * m + 1 All goals completed! 🐙