chars
int64
40
24k
content_type
stringclasses
9 values
id
stringlengths
13
64
source
stringclasses
5 values
subset
stringclasses
31 values
text
stringlengths
40
24k
281
leanexplore_declaration
leanexplore:384293
leanexplore_sqlite
leanexplore_declarations
/-- A number $n$ comes from a prime quadruple $(p, p+2, p+6, p+8)$ if $n = p(p+8)$ for some prime $p$ where $p$, $p+2$, $p+6$, $p+8$ are all prime. -/ def ComesFromPrimeQuadruple (n : ℕ) : Prop := ∃ p : ℕ, p.Prime ∧ (p + 2).Prime ∧ (p + 6).Prime ∧ (p + 8).Prime ∧ n = p * (p + 8)
254
leanexplore_declaration
leanexplore:384294
leanexplore_sqlite
leanexplore_declarations
/-- A composite number $n$ is in the sequence A56777 if it satisfies both $\varphi(n+12) = \varphi(n) + 12$ and $\sigma(n+12) = \sigma(n) + 12$. -/ def a (n : ℕ) : Prop := ¬n.Prime ∧ 1 < n ∧ totient (n + 12) = totient n + 12 ∧ σ 1 (n + 12) = σ 1 n + 12
290
leanexplore_declaration
leanexplore:384295
leanexplore_sqlite
leanexplore_declarations
/-- Non-primitive terms have the form $m \cdot s$ where $m$ is primitive and $s$ is squarefree with $\gcd(m, s) = 1$. -/ @[category research solved, AMS 11] theorem exists_primitive_of_a {n : ℕ} (h : a n) : ∃ m s, isPrimitiveTerm m ∧ Squarefree s ∧ m.Coprime s ∧ n = m * s := by sorry
297
leanexplore_declaration
leanexplore:384296
leanexplore_sqlite
leanexplore_declarations
/-- If $m$ is a primitive term and $s$ is squarefree with $\gcd(m, s) = 1$, then $m \cdot s$ is in the sequence. -/ @[category undergraduate, AMS 11] theorem a_of_primitive_mul_squarefree (m s : ℕ) (hm : isPrimitiveTerm m) (hs : Squarefree s) (hcoprime : m.Coprime s) : a (m * s) := by sorry
159
leanexplore_declaration
leanexplore:384297
leanexplore_sqlite
leanexplore_declarations
/-- $108$ is the only primitive term. -/ @[category research open, AMS 11] theorem unique_primitive_108 {n : ℕ} (h : isPrimitiveTerm n) : n = 108 := by sorry
177
leanexplore_declaration
leanexplore:384298
leanexplore_sqlite
leanexplore_declarations
/-- All primitive terms are powerful numbers. -/ @[category undergraduate, AMS 11] theorem powerful_of_isPrimitiveTerm {n : ℕ} (h : isPrimitiveTerm n) : n.Powerful := by sorry
172
leanexplore_declaration
leanexplore:384299
leanexplore_sqlite
leanexplore_declarations
/-- All members of the sequence satisfy $n \equiv 108 \pmod{216}$. -/ @[category research open, AMS 11] theorem mod_216_of_a {n : ℕ} (h : a n) : n % 216 = 108 := by sorry
293
leanexplore_declaration
leanexplore:384300
leanexplore_sqlite
leanexplore_declarations
/-- $108$ is a primitive term. -/ @[category test, AMS 11] theorem isPrimitiveTerm_108 : isPrimitiveTerm 108 := by rw [isPrimitiveTerm, Set.isPrimitive_iff] refine ⟨a_108, ?_⟩ intro d hd have ⟨hdvd, hlt⟩ := Nat.mem_properDivisors.mp hd interval_cases d <;> simp_all [A, a] <;> decide
129
leanexplore_declaration
leanexplore:384301
leanexplore_sqlite
leanexplore_declarations
/-- $756$ is in the sequence A063880. -/ @[category test, AMS 11] theorem a_756 : a 756 := by refine ⟨by norm_num, ?_⟩ decide
129
leanexplore_declaration
leanexplore:384302
leanexplore_sqlite
leanexplore_declarations
/-- $540$ is in the sequence A063880. -/ @[category test, AMS 11] theorem a_540 : a 540 := by refine ⟨by norm_num, ?_⟩ decide
129
leanexplore_declaration
leanexplore:384303
leanexplore_sqlite
leanexplore_declarations
/-- $108$ is in the sequence A063880. -/ @[category test, AMS 11] theorem a_108 : a 108 := by refine ⟨by norm_num, ?_⟩ decide
135
leanexplore_declaration
leanexplore:384304
leanexplore_sqlite
leanexplore_declarations
/-- A term $n$ is primitive if no proper divisor of $n$ is in the sequence. -/ abbrev isPrimitiveTerm (n : ℕ) : Prop := A.IsPrimitive n
77
leanexplore_declaration
leanexplore:384305
leanexplore_sqlite
leanexplore_declarations
/-- The set of numbers in the sequence A063880. -/ def A : Set ℕ := {n | a n}
144
leanexplore_declaration
leanexplore:384306
leanexplore_sqlite
leanexplore_declarations
/-- A number $n$ is in the sequence A063880 if $\sigma(n) = 2 \cdot \text{usigma}(n)$. -/ def a (n : ℕ) : Prop := 0 < n ∧ σ 1 n = 2 * usigma n
125
leanexplore_declaration
leanexplore:384307
leanexplore_sqlite
leanexplore_declarations
/-- The sum of unitary divisors of $n$, denoted $\text{usigma}(n)$. -/ def usigma (n : ℕ) : ℕ := ∑ d ∈ unitaryDivisors n, d
166
leanexplore_declaration
leanexplore:384308
leanexplore_sqlite
leanexplore_declarations
/-- The set of unitary divisors of $n$: divisors $d$ such that $\gcd(d, n/d) = 1$. -/ def unitaryDivisors (n : ℕ) : Finset ℕ := {d ∈ n.divisors | d.Coprime (n / d)}
1,334
leanexplore_declaration
leanexplore:384309
leanexplore_sqlite
leanexplore_declarations
/-- **Conjecture (A6697)**: The generating function for the number of subwords of length $n$ in the infinite word generated by $a \mapsto aab, b \mapsto b$ is $$\sum_{n \geq 0} a_n x^n = 1 + \frac{1}{1-x} + \frac{1}{(1-x)^2}\left(\frac{1}{1-x} - \sum_{k \geq 0} x^{2^{k+1} + k}\right).$$ Equivalently, a(n) equals the...
154
leanexplore_declaration
leanexplore:384310
leanexplore_sqlite
leanexplore_declarations
/-- The subword complexity function: a(n) is the number of distinct subwords of length n. -/ noncomputable def a (n : ℕ) : ℕ := (subwordsOfLength n).ncard
154
leanexplore_declaration
leanexplore:384311
leanexplore_sqlite
leanexplore_declarations
/-- The set of all distinct subwords of length n in the infinite word. -/ def subwordsOfLength (n : ℕ) : Set (List Bool) := {w | ∃ i, w = subwordAt i n}
165
leanexplore_declaration
leanexplore:384312
leanexplore_sqlite
leanexplore_declarations
/-- A subword (factor) of length n starting at position i. -/ noncomputable def subwordAt (i n : ℕ) : List Bool := (List.range n).map fun j => infiniteWord (i + j)
318
leanexplore_declaration
leanexplore:384313
leanexplore_sqlite
leanexplore_declarations
/-- The infinite word w is the fixed point of the morphism starting from 'a'. We define it as the limit: w(i) is the i-th symbol, which stabilizes after sufficiently many iterations. -/ noncomputable def infiniteWord (i : ℕ) : Bool := (finiteWord (i + 1))[i]'(by grw [length_finiteWord, ← Nat.lt_two_pow_self]; simp)
187
leanexplore_declaration
leanexplore:384314
leanexplore_sqlite
leanexplore_declarations
@[simp, category API, AMS 68] lemma length_finiteWord (n : ℕ) : (finiteWord n).length = 2 ^ (n + 1) - 1 := by simp [← count_true_add_count_false, count_true_finiteWord, pow_succ]; omega
379
leanexplore_declaration
leanexplore:384315
leanexplore_sqlite
leanexplore_declarations
@[simp, category API, AMS 68] lemma count_true_finiteWord : ∀ n, (finiteWord n).count true = 2 ^ n - 1 | 0 => rfl | n + 1 => by simp [finiteWord, List.count_flatMap, Function.comp_def, ← count_true_add_count_false, count_true_finiteWord, pow_succ]; omega @[simp, category API, AMS 68] lemma length_finiteW...
682
leanexplore_declaration
leanexplore:384316
leanexplore_sqlite
leanexplore_declarations
@[simp, category API, AMS 68] lemma count_false_finiteWord : ∀ n, (finiteWord n).count false = 2 ^ n | 0 => rfl | n + 1 => by simp [finiteWord, count_flatMap, Function.comp_def, sum_map_ite, ← Bool.beq_eq_decide_eq, -beq_false, ← count_eq_length_filter, count_false_finiteWord, pow_succ] @[simp, category ...
132
leanexplore_declaration
leanexplore:384317
leanexplore_sqlite
leanexplore_declarations
@[simp, category API, AMS 68] lemma count_true_morphism (b : Bool) : count true (morphism b) = 1 := by cases b <;> simp [morphism]
151
leanexplore_declaration
leanexplore:384318
leanexplore_sqlite
leanexplore_declarations
@[simp, category API, AMS 68] lemma count_false_morphism (b : Bool) : count false (morphism b) = if b then 0 else 2 := by cases b <;> simp [morphism]
148
leanexplore_declaration
leanexplore:384319
leanexplore_sqlite
leanexplore_declarations
/-- The n-th iterate of the morphism applied to [a]. -/ def finiteWord : ℕ → List Bool | 0 => [false] | n + 1 => (finiteWord n).flatMap morphism
233
leanexplore_declaration
leanexplore:384320
leanexplore_sqlite
leanexplore_declarations
/-- The morphism σ on {a, b} defined by a ↦ aab, b ↦ b, represented on Bool where `false` = a and `true` = b. -/ def morphism : Bool → List Bool | false => [false, false, true] -- a ↦ aab | true => [true] -- b ↦ b
199
leanexplore_declaration
leanexplore:384321
leanexplore_sqlite
leanexplore_declarations
/-- For members of the sequence other than $8$, we have $k + 1$ is prime. -/ @[category research open, AMS 11] theorem prime_add_one_of_a {k : ℕ} (h : a k) (hne : k ≠ 8) : (k + 1).Prime := by sorry
287
leanexplore_declaration
leanexplore:384322
leanexplore_sqlite
leanexplore_declarations
/-- If $k + 1$ and $k^2 + 1$ are both prime, then $k$ is in the sequence. -/ @[category undergraduate, AMS 11] theorem a_of_primes {k : ℕ} (hk : (k + 1).Prime) (hk' : (k ^ 2 + 1).Prime) : a k := by rw [a, totient_prime hk', totient_prime hk, Nat.add_sub_cancel, Nat.add_sub_cancel, sq]
114
leanexplore_declaration
leanexplore:384323
leanexplore_sqlite
leanexplore_declarations
/-- $10$ is in the sequence A067720. -/ @[category test, AMS 11] theorem a_10 : a 10 := by simp +decide only [a]
111
leanexplore_declaration
leanexplore:384324
leanexplore_sqlite
leanexplore_declarations
/-- $8$ is in the sequence A067720. -/ @[category test, AMS 11] theorem a_8 : a 8 := by simp +decide only [a]
111
leanexplore_declaration
leanexplore:384325
leanexplore_sqlite
leanexplore_declarations
/-- $6$ is in the sequence A067720. -/ @[category test, AMS 11] theorem a_6 : a 6 := by simp +decide only [a]
111
leanexplore_declaration
leanexplore:384326
leanexplore_sqlite
leanexplore_declarations
/-- $4$ is in the sequence A067720. -/ @[category test, AMS 11] theorem a_4 : a 4 := by simp +decide only [a]
111
leanexplore_declaration
leanexplore:384327
leanexplore_sqlite
leanexplore_declarations
/-- $2$ is in the sequence A067720. -/ @[category test, AMS 11] theorem a_2 : a 2 := by simp +decide only [a]
100
leanexplore_declaration
leanexplore:384328
leanexplore_sqlite
leanexplore_declarations
/-- $1$ is in the sequence A067720. -/ @[category test, AMS 11] theorem a_1 : a 1 := by norm_num [a]
150
leanexplore_declaration
leanexplore:384329
leanexplore_sqlite
leanexplore_declarations
/-- A number $k$ is in the sequence A067720 if $\varphi(k^2 + 1) = k \cdot \varphi(k + 1)$. -/ def a (k : ℕ) : Prop := φ (k ^ 2 + 1) = k * φ (k + 1)
245
leanexplore_declaration
leanexplore:384330
leanexplore_sqlite
leanexplore_declarations
/-- Conjecture: The gcd condition is equivalent to the prime power condition. -/ @[category research open, AMS 11] theorem gcdCondition_iff_primePowerCondition (k : ℕ) (hk : 2 ≤ k) : GCDCondition k ↔ PrimePowerCondition (k - 1) := by sorry
184
leanexplore_declaration
leanexplore:384331
leanexplore_sqlite
leanexplore_declarations
/-- Let P be the largest prime power dividing `k`. Then $k / P > P$. -/ def PrimePowerCondition (k : ℕ) : Prop := let P := ((Nat.divisors k).filter IsPrimePow).max.getD 0 k / P > P
205
leanexplore_declaration
leanexplore:384332
leanexplore_sqlite
leanexplore_declarations
/-- The gcd of the binomial coefficients $\binom{2k}{k}, \binom{3k}{k}, \dots, \binom{(k+1)k}{k} = 1$. -/ def GCDCondition (k : ℕ) : Prop := (Finset.range k).gcd (fun i => Nat.choose ((i + 2) * k) k) = 1
241
leanexplore_declaration
leanexplore:384333
leanexplore_sqlite
leanexplore_declarations
/-- **Conjecture (A81091)**: There are infinite primes of the form $2^n + 2^i + 1$, with $0 < i < n$. -/ @[category research open, AMS 11] theorem conjectureA81091 : answer(sorry) ↔ Set.Infinite {p : ℕ | isPrimeBitsSet 3 p} := by sorry
136
leanexplore_declaration
leanexplore:384334
leanexplore_sqlite
leanexplore_declarations
/-- Primes with $m$ one bits in their binary representation. -/ def isPrimeBitsSet (m p : ℕ) : Prop := p.Prime ∧ p.bits.count true = m
330
leanexplore_declaration
leanexplore:384335
leanexplore_sqlite
leanexplore_declarations
/-- Conjecture: a(n) = 3^n + 3 * 2^n + 6 for n ≥ 1. -/ @[category research solved, AMS 11, formal_proof using formal_conjectures at "https://github.com/google-deepmind/formal-conjectures/pull/1894/commits/7a286754f623759d69a3dd18f482c53c1d70959b"] theorem a_formula {n : ℕ} (hn : n ≥ 1) : a n = 3 ^ n + 3 * 2 ^ n + 6 := ...
185
leanexplore_declaration
leanexplore:384336
leanexplore_sqlite
leanexplore_declarations
/-- a(3) = 57. -/ @[category test, AMS 11] theorem a_three : a 3 = 57 := by rw [a, Nat.find_eq_iff] refine ⟨by decide +native, ?_⟩ intro m hm interval_cases m <;> decide +native
183
leanexplore_declaration
leanexplore:384337
leanexplore_sqlite
leanexplore_declarations
/-- a(2) = 27. -/ @[category test, AMS 11] theorem a_two : a 2 = 27 := by rw [a, Nat.find_eq_iff] refine ⟨by decide +native, ?_⟩ intro m hm interval_cases m <;> decide +native
183
leanexplore_declaration
leanexplore:384338
leanexplore_sqlite
leanexplore_declarations
/-- a(1) = 15. -/ @[category test, AMS 11] theorem a_one : a 1 = 15 := by rw [a, Nat.find_eq_iff] refine ⟨by decide +native, ?_⟩ intro m hm interval_cases m <;> decide +native
146
leanexplore_declaration
leanexplore:384339
leanexplore_sqlite
leanexplore_declarations
/-- The sequence a(n): least m such that countExceeding n m > countNotExceeding n m. -/ noncomputable def a (n : ℕ) : ℕ := Nat.find (a_exists n)
200
leanexplore_declaration
leanexplore:384340
leanexplore_sqlite
leanexplore_declarations
/-- There exists m such that countExceeding n m > countNotExceeding n m. -/ @[category undergraduate, AMS 11] theorem a_exists (n : ℕ) : ∃ m, countExceeding n m > countNotExceeding n m := by sorry
165
leanexplore_declaration
leanexplore:384341
leanexplore_sqlite
leanexplore_declarations
/-- Count of numbers k in {1, ..., m} where k ≤ (minFac k)^n. -/ def countNotExceeding (n m : ℕ) : ℕ := (Finset.Icc 1 m).filter (fun k => k ≤ k.minFac ^ n) |>.card
162
leanexplore_declaration
leanexplore:384342
leanexplore_sqlite
leanexplore_declarations
/-- Count of numbers k in {1, ..., m} where k > (minFac k)^n. -/ def countExceeding (n m : ℕ) : ℕ := (Finset.Icc 1 m).filter (fun k => k > k.minFac ^ n) |>.card
289
leanexplore_declaration
leanexplore:384343
leanexplore_sqlite
leanexplore_declarations
/-- Open Quantum Problem 13: determine the maximal number of mutually unbiased orthonormal bases in $\mathbb{C}^d$ for $d \ge 2$. -/ @[category research open, AMS 5 15 81 94] theorem mutuallyUnbiasedBases (d : ℕ) (hd : 2 ≤ d) : IsMaxMUBCount d ((answer(sorry) : ℕ → ℕ) d) := by sorry
279
leanexplore_declaration
leanexplore:384344
leanexplore_sqlite
leanexplore_declarations
/-- Special case in dimension $15$ (not a prime power): determine the maximal number of mutually unbiased orthonormal bases in $\mathbb{C}^{15}$. -/ @[category research open, AMS 5 15 81 94] theorem mutuallyUnbiasedBases_dim15 : IsMaxMUBCount 15 (answer(sorry)) := by sorry
279
leanexplore_declaration
leanexplore:384345
leanexplore_sqlite
leanexplore_declarations
/-- Special case in dimension $14$ (not a prime power): determine the maximal number of mutually unbiased orthonormal bases in $\mathbb{C}^{14}$. -/ @[category research open, AMS 5 15 81 94] theorem mutuallyUnbiasedBases_dim14 : IsMaxMUBCount 14 (answer(sorry)) := by sorry
279
leanexplore_declaration
leanexplore:384346
leanexplore_sqlite
leanexplore_declarations
/-- Special case in dimension $12$ (not a prime power): determine the maximal number of mutually unbiased orthonormal bases in $\mathbb{C}^{12}$. -/ @[category research open, AMS 5 15 81 94] theorem mutuallyUnbiasedBases_dim12 : IsMaxMUBCount 12 (answer(sorry)) := by sorry
279
leanexplore_declaration
leanexplore:384347
leanexplore_sqlite
leanexplore_declarations
/-- Special case in dimension $10$ (not a prime power): determine the maximal number of mutually unbiased orthonormal bases in $\mathbb{C}^{10}$. -/ @[category research open, AMS 5 15 81 94] theorem mutuallyUnbiasedBases_dim10 : IsMaxMUBCount 10 (answer(sorry)) := by sorry
253
leanexplore_declaration
leanexplore:384348
leanexplore_sqlite
leanexplore_declarations
/-- Special case in dimension $6$: determine the maximal number of mutually unbiased orthonormal bases in $\mathbb{C}^6$. -/ @[category research open, AMS 5 15 81 94] theorem mutuallyUnbiasedBases_dim6 : IsMaxMUBCount 6 (answer(sorry)) := by sorry
457
leanexplore_declaration
leanexplore:384349
leanexplore_sqlite
leanexplore_declarations
/-- Known general bounds in dimension $6$: the maximal number of mutually unbiased bases satisfies $3 \le \mu(6) \le 7$. -/ @[category research solved, AMS 5 15 81 94, formal_proof using formal_conjectures at "https://github.com/XC0R/formal-conjectures/blob/c8733543568e8011288a9fa7ef33375f5e5907d3/FormalConjectures/Ope...
229
leanexplore_declaration
leanexplore:384350
leanexplore_sqlite
leanexplore_declarations
/-- In dimension $2$, the maximum number of mutually unbiased orthonormal bases is $3$. -/ @[category research solved, AMS 5 15 81 94] theorem mutuallyUnbiasedBases_dim2 : IsMaxMUBCount 2 3 := by simpa using Qubit.qubit_maximal
222
leanexplore_declaration
leanexplore:384351
leanexplore_sqlite
leanexplore_declarations
/-- The maximum number of mutually unbiased bases in dimension $2$ is $3$. -/ @[category API, AMS 5 15 81 94] theorem qubit_maximal : IsMaxMUBCount 2 3 := by exact ⟨qubit_hasThreeMUBs, fun m hm => qubit_upper_bound m hm⟩
745
leanexplore_declaration
leanexplore:384352
leanexplore_sqlite
leanexplore_declarations
/-- No family of mutually unbiased bases in dimension $2$ has size greater than $3$. -/ @[category API, AMS 5 15 81 94] lemma qubit_upper_bound (m : ℕ) : HasMUBs 2 m → m ≤ 3 := by rintro ⟨B, hB⟩ let v : Fin m → BlochVec := fun i => bloch (B i) have hv_ne : ∀ i, v i ≠ 0 := by intro i simpa [v] using bloch_...
568
leanexplore_declaration
leanexplore:384353
leanexplore_sqlite
leanexplore_declarations
/-- Mutually unbiased qubit bases have orthogonal Bloch vectors. -/ @[category API, AMS 5 15 81 94] lemma bloch_inner_eq_zero_of_isUnbiased {U V : UMat 2} (hUV : IsUnbiased U V) : inner ℝ (bloch U) (bloch V) = 0 := by rw [bloch_inner_eq_two_normSq_sub_one] have h00 : Complex.normSq (relativeUnitary U V 0 0) = (...
241
leanexplore_declaration
leanexplore:384354
leanexplore_sqlite
leanexplore_declarations
/-- A qubit Bloch vector is never the zero vector. -/ @[category API, AMS 5 15 81 94] lemma bloch_ne_zero (U : UMat 2) : bloch U ≠ 0 := by intro h have h0 : (0 : ℝ) = 1 := by simpa [h] using (bloch_inner_self U).symm norm_num at h0
245
leanexplore_declaration
leanexplore:384355
leanexplore_sqlite
leanexplore_declarations
/-- Every qubit Bloch vector has squared Euclidean norm $1$. -/ @[category API, AMS 5 15 81 94] lemma bloch_inner_self (U : UMat 2) : inner ℝ (bloch U) (bloch U) = 1 := by rw [bloch_inner_eq_two_normSq_sub_one, relativeUnitary_self] norm_num
245
leanexplore_declaration
leanexplore:384356
leanexplore_sqlite
leanexplore_declarations
/-- The relative unitary of a basis with itself is the identity matrix. -/ @[category API, AMS 5 15 81 94] lemma relativeUnitary_self (U : UMat 2) : relativeUnitary U U = 1 := by rw [relativeUnitary] exact Matrix.UnitaryGroup.star_mul_self U
2,183
leanexplore_declaration
leanexplore:384357
leanexplore_sqlite
leanexplore_declarations
/-- The Bloch inner product is determined by the $(0,0)$ entry of the relative unitary. -/ @[category API, AMS 5 15 81 94] lemma bloch_inner_eq_two_normSq_sub_one (U V : UMat 2) : inner ℝ (bloch U) (bloch V) = 2 * Complex.normSq (relativeUnitary U V 0 0) - 1 := by let a : ℂ := u0 U let b : ℂ := u1 U let c : ℂ...
289
leanexplore_declaration
leanexplore:384358
leanexplore_sqlite
leanexplore_declarations
/-- The real part of $z \overline{w}$ is the Euclidean dot product of the coordinate pairs of `z` and `w`. -/ @[category API, AMS 5 15 81 94] lemma re_mul_conj (z w : ℂ) : Complex.re (z * star w) = Complex.re z * Complex.re w + Complex.im z * Complex.im w := by simp [Complex.mul_re]
572
leanexplore_declaration
leanexplore:384359
leanexplore_sqlite
leanexplore_declarations
/-- The first column of a unitary matrix has squared norm $1$. -/ @[category API, AMS 5 15 81 94] lemma firstCol_normSq (U : UMat 2) : Complex.normSq (u0 U) + Complex.normSq (u1 U) = 1 := by have hu : star (U : Matrix (Fin 2) (Fin 2) ℂ) * (U : Matrix (Fin 2) (Fin 2) ℂ) = 1 := by exact (Matrix.mem_unitaryGroup...
317
leanexplore_declaration
leanexplore:384360
leanexplore_sqlite
leanexplore_declarations
/-- The $(0,0)$ entry of the relative unitary is the overlap of the first columns. -/ @[category API, AMS 5 15 81 94] lemma relativeUnitary_apply_zero_zero (U V : UMat 2) : relativeUnitary U V 0 0 = star (u0 U) * u0 V + star (u1 U) * u1 V := by simp [relativeUnitary, u0, u1, Matrix.mul_apply, Fin.sum_univ_two]
286
leanexplore_declaration
leanexplore:384361
leanexplore_sqlite
leanexplore_declarations
/-- The Bloch vector associated to the first column of a qubit basis matrix. -/ @[category API, AMS 5 15 81 94] def bloch (U : UMat 2) : BlochVec := !₂[ 2 * Complex.re (star (u0 U) * u1 U) , 2 * Complex.im (star (u0 U) * u1 U) , Complex.normSq (u0 U) - Complex.normSq (u1 U) ]
90
leanexplore_declaration
leanexplore:384362
leanexplore_sqlite
leanexplore_declarations
/-- The real Bloch-vector space for qubits. -/ abbrev BlochVec := EuclideanSpace ℝ (Fin 3)
172
leanexplore_declaration
leanexplore:384363
leanexplore_sqlite
leanexplore_declarations
/-- The second entry of the first column of a qubit unitary basis matrix. -/ @[category API, AMS 5 15 81 94] def u1 (U : UMat 2) : ℂ := (U : Matrix (Fin 2) (Fin 2) ℂ) 1 0
171
leanexplore_declaration
leanexplore:384364
leanexplore_sqlite
leanexplore_declarations
/-- The first entry of the first column of a qubit unitary basis matrix. -/ @[category API, AMS 5 15 81 94] def u0 (U : UMat 2) : ℂ := (U : Matrix (Fin 2) (Fin 2) ℂ) 0 0
184
leanexplore_declaration
leanexplore:384365
leanexplore_sqlite
leanexplore_declarations
/-- There exist three mutually unbiased bases in dimension $2$. -/ @[category API, AMS 5 15 81 94] lemma qubit_hasThreeMUBs : HasMUBs 2 3 := by exact ⟨qubitFamily, qubitFamily_isMUB⟩
911
leanexplore_declaration
leanexplore:384366
leanexplore_sqlite
leanexplore_declarations
/-- The standard qubit family is a family of mutually unbiased bases. -/ @[category API, AMS 5 15 81 94] lemma qubitFamily_isMUB : IsMUBFamily qubitFamily := by intro i j hij fin_cases i <;> fin_cases j <;> try contradiction · simpa [qubitFamily, XU] using isUnbiased_Z_phaseU (ζ := 1) (by simp) · simpa [qubitFa...
127
leanexplore_declaration
leanexplore:384367
leanexplore_sqlite
leanexplore_declarations
/-- The three standard qubit mutually unbiased bases: $Z$, $X$, and $Y$. -/ def qubitFamily : Fin 3 → UMat 2 := ![ZU, XU, YU]
431
leanexplore_declaration
leanexplore:384368
leanexplore_sqlite
leanexplore_declarations
/-- If $\overline{\zeta}\,\eta = i$, then the corresponding phase bases are mutually unbiased. -/ @[category API, AMS 5 15 81 94] lemma isUnbiased_phaseU_phaseU_of_mul_eq_I {ζ η : ℂ} (hζ : star ζ * ζ = 1) (hη : star η * η = 1) (hζη : star ζ * η = Complex.I) : IsUnbiased (phaseU ζ hζ) (phaseU η hη) := by intro...
1,186
leanexplore_declaration
leanexplore:384369
leanexplore_sqlite
leanexplore_declarations
/-- If $\overline{\zeta}\,\eta = i$, then the relative unitary between the corresponding phase bases is the qubit mutually unbiased overlap matrix. -/ @[category API, AMS 5 15 81 94] lemma relative_phaseU_phaseU_of_mul_eq_I {ζ η : ℂ} (hζ : star ζ * ζ = 1) (hη : star η * η = 1) (hζη : star ζ * η = Complex.I) : r...
511
leanexplore_declaration
leanexplore:384370
leanexplore_sqlite
leanexplore_declarations
/-- The standard basis is mutually unbiased with any phase basis of unit-modulus phase. -/ @[category API, AMS 5 15 81 94] lemma isUnbiased_Z_phaseU (ζ : ℂ) (hζ : star ζ * ζ = 1) : IsUnbiased ZU (phaseU ζ hζ) := by intro i j fin_cases i <;> fin_cases j · simp [relativeUnitary, ZU, phaseU, phaseMatrix, omega_n...
101
leanexplore_declaration
leanexplore:384371
leanexplore_sqlite
leanexplore_declarations
/-- The qubit $Y$ basis as a bundled unitary matrix. -/ def YU : UMat 2 := phaseU Complex.I (by simp)
93
leanexplore_declaration
leanexplore:384372
leanexplore_sqlite
leanexplore_declarations
/-- The qubit $X$ basis as a bundled unitary matrix. -/ def XU : UMat 2 := phaseU 1 (by simp)
53
leanexplore_declaration
leanexplore:384373
leanexplore_sqlite
leanexplore_declarations
/-- The standard qubit basis. -/ def ZU : UMat 2 := 1
294
leanexplore_declaration
leanexplore:384374
leanexplore_sqlite
leanexplore_declarations
/-- Multiplying $\omega$ by a unit-modulus phase preserves the squared norm $1/2$. -/ @[category API, AMS 5 15 81 94] lemma omega_mul_phase_norm_sq {ζ : ℂ} (hζ : star ζ * ζ = 1) : ‖ω * ζ‖ ^ (2 : ℕ) = (2 : ℝ)⁻¹ := by rw [norm_mul, mul_pow, omega_norm_sq, phase_norm_sq_eq_one hζ]; norm_num
386
leanexplore_declaration
leanexplore:384375
leanexplore_sqlite
leanexplore_declarations
/-- A complex number with $\overline{\zeta}\,\zeta = 1$ has squared norm $1$. -/ @[category API, AMS 5 15 81 94] lemma phase_norm_sq_eq_one {ζ : ℂ} (hζ : star ζ * ζ = 1) : ‖ζ‖ ^ (2 : ℕ) = 1 := by have hzC : ((‖ζ‖ : ℂ) ^ (2 : ℕ)) = 1 := by calc ((‖ζ‖ : ℂ) ^ (2 : ℕ)) = star ζ * ζ := by simpa using...
184
leanexplore_declaration
leanexplore:384376
leanexplore_sqlite
leanexplore_declarations
/-- The bundled qubit basis associated to a unit-modulus phase $\zeta$. -/ def phaseU (ζ : ℂ) (hζ : star ζ * ζ = 1) : UMat 2 := ⟨ω • phaseMatrix ζ, scaled_phaseMatrix_mem_unitary hζ⟩
445
leanexplore_declaration
leanexplore:384377
leanexplore_sqlite
leanexplore_declarations
/-- The relative product of two scaled phase matrices is obtained by scaling the corresponding relative product of phase matrices. -/ @[category API, AMS 5 15 81 94] lemma star_phaseBasis_mul_phaseBasis (ζ η : ℂ) : star (ω • phaseMatrix ζ) * (ω • phaseMatrix η) = (star ω * ω) • !![1 + star ζ * η, 1 - star ζ *...
720
leanexplore_declaration
leanexplore:384378
leanexplore_sqlite
leanexplore_declarations
/-- Scaling a phase matrix by $\omega$ produces a unitary matrix whenever the phase has unit modulus. -/ @[category API, AMS 5 15 81 94] lemma scaled_phaseMatrix_mem_unitary {ζ : ℂ} (hζ : star ζ * ζ = 1) : (ω • phaseMatrix ζ) ∈ Matrix.unitaryGroup (Fin 2) ℂ := by rw [Matrix.mem_unitaryGroup_iff'] calc star ...
405
leanexplore_declaration
leanexplore:384379
leanexplore_sqlite
leanexplore_declarations
/-- If $\zeta$ has unit modulus, then the phase matrix is orthogonal up to the scalar factor $2$. -/ @[category API, AMS 5 15 81 94] lemma star_phaseMatrix_mul_self_of_unit_phase {ζ : ℂ} (hζ : star ζ * ζ = 1) : star (phaseMatrix ζ) * phaseMatrix ζ = (2 : ℂ) • (1 : Matrix (Fin 2) (Fin 2) ℂ) := by rw [star_phaseMat...
418
leanexplore_declaration
leanexplore:384380
leanexplore_sqlite
leanexplore_declarations
/-- The relative product of two phase matrices has the expected $2 \times 2$ form. -/ @[category API, AMS 5 15 81 94] lemma star_phaseMatrix_mul_phaseMatrix (ζ η : ℂ) : star (phaseMatrix ζ) * phaseMatrix η = !![1 + star ζ * η, 1 - star ζ * η; 1 - star ζ * η, 1 + star ζ * η] := by ext i j fin_case...
411
leanexplore_declaration
leanexplore:384381
leanexplore_sqlite
leanexplore_declarations
/-- Taking the star of a scalar multiple on the left and multiplying by another scalar multiple collects the scalar factor as $\overline{a} a$. -/ @[category API, AMS 5 15 81 94] lemma star_smul_mul_smul (a : ℂ) (A B : Matrix (Fin 2) (Fin 2) ℂ) : star (a • A) * (a • B) = (star a * a) • (star A * B) := by ext i j ...
309
leanexplore_declaration
leanexplore:384382
leanexplore_sqlite
leanexplore_declarations
/-- The product $\overline{\omega}\,\omega$ is $1/2$. -/ @[category API, AMS 5 15 81 94] lemma conj_omega_mul_omega : star ω * ω = ((2 : ℝ)⁻¹ : ℂ) := by calc star ω * ω = ((‖ω‖ : ℂ) ^ (2 : ℕ)) := by simpa using (Complex.conj_mul' ω) _ = ((2 : ℝ)⁻¹ : ℂ) := by exact_mod_cast omega_norm_sq
177
leanexplore_declaration
leanexplore:384383
leanexplore_sqlite
leanexplore_declarations
/-- The squared norm of `ω` is $1/2$. -/ @[category API, AMS 5 15 81 94] lemma omega_norm_sq : ‖ω‖ ^ (2 : ℕ) = (2 : ℝ)⁻¹ := by rw [RCLike.norm_sq_eq_def] simp [ω] norm_num
192
leanexplore_declaration
leanexplore:384384
leanexplore_sqlite
leanexplore_declarations
/-- The raw phase-parametrized Hadamard matrix. The cases $\zeta = 1$ and $\zeta = i$ give the $X$ and $Y$ bases. -/ def phaseMatrix (ζ : ℂ) : Matrix (Fin 2) (Fin 2) ℂ := !![1, 1; ζ, -ζ]
129
leanexplore_declaration
leanexplore:384385
leanexplore_sqlite
leanexplore_declarations
/-- A convenient phase with squared norm $1/2$. Using $\omega = (1+i)/2$ avoids square roots. -/ def ω : ℂ := (1 + Complex.I) / 2
225
leanexplore_declaration
leanexplore:384386
leanexplore_sqlite
leanexplore_declarations
/-- Every dimension admits a family of one mutually unbiased basis. -/ @[category test, AMS 5 15 81 94] theorem hasMUBs_one (d : ℕ) : HasMUBs d 1 := by exact ⟨fun _ => 1, fun {i j} hij => absurd (Subsingleton.elim i j) hij⟩
194
leanexplore_declaration
leanexplore:384387
leanexplore_sqlite
leanexplore_declarations
/-- Every dimension admits the empty family of mutually unbiased bases. -/ @[category test, AMS 5 15 81 94] theorem hasMUBs_zero (d : ℕ) : HasMUBs d 0 := by exact ⟨Fin.elim0, fun i => i.elim0⟩
170
leanexplore_declaration
leanexplore:384388
leanexplore_sqlite
leanexplore_declarations
/-- $k$ is the maximal size of a family of mutually unbiased bases in dimension $d$. -/ def IsMaxMUBCount (d k : ℕ) : Prop := HasMUBs d k ∧ ∀ m : ℕ, HasMUBs d m → m ≤ k
146
leanexplore_declaration
leanexplore:384389
leanexplore_sqlite
leanexplore_declarations
/-- There exists a complete set of $d + 1$ mutually unbiased bases in $\mathbb{C}^d$. -/ def HasCompleteMUBs (d : ℕ) : Prop := HasMUBs d (d + 1)
135
leanexplore_declaration
leanexplore:384390
leanexplore_sqlite
leanexplore_declarations
/-- There exist $k$ mutually unbiased bases in $\mathbb{C}^d$. -/ def HasMUBs (d k : ℕ) : Prop := ∃ B : Fin k → UMat d, IsMUBFamily B
220
leanexplore_declaration
leanexplore:384391
leanexplore_sqlite
leanexplore_declarations
/-- A family of unitary matrices is a family of mutually unbiased bases if every two distinct members are unbiased. -/ def IsMUBFamily {d k : ℕ} (B : Fin k → UMat d) : Prop := Pairwise fun m n => IsUnbiased (B m) (B n)
496
leanexplore_declaration
leanexplore:384392
leanexplore_sqlite
leanexplore_declarations
/-- Mutual unbiasedness is symmetric. -/ @[category API, AMS 5 15 81 94] lemma IsUnbiased.symm {d : ℕ} {U V : UMat d} (hUV : IsUnbiased U V) : IsUnbiased V U := by intro i j have hstar : relativeUnitary V U = star (relativeUnitary U V) := by simp [relativeUnitary, Matrix.star_mul] calc ‖relativeUnitar...