1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-12-26 18:40:29 +01:00
PropertyT.jl/AutF4.jl

121 lines
3.2 KiB
Julia
Raw Normal View History

2017-01-13 18:42:43 +01:00
using Combinatorics
using JuMP
import SCS: SCSSolver
import Mosek: MosekSolver
push!(LOAD_PATH, "./")
using SemiDirectProduct
using GroupAlgebras
include("property(T).jl")
const N = 4
const VERBOSE = true
function permutation_matrix(p::Vector{Int})
n = length(p)
sort(p) == collect(1:n) || throw(ArgumentError("Input array must be a permutation of 1:n"))
A = eye(n)
return A[p,:]
end
SymmetricGroup(n) = [nthperm(collect(1:n), k) for k in 1:factorial(n)]
2017-01-13 18:42:43 +01:00
# const SymmetricGroup = [permutation_matrix(x) for x in SymmetricGroup_perms]
function E(i, j; dim::Int=N)
2017-01-13 18:42:43 +01:00
@assert i≠j
k = eye(dim)
k[i,j] = 1
return k
end
function eltary_basis_vector(i; dim::Int=N)
2017-01-13 18:42:43 +01:00
result = zeros(dim)
if 0 < i dim
result[i] = 1
end
return result
end
v(i; dim=N) = eltary_basis_vector(i,dim=dim)
2017-01-13 18:42:43 +01:00
ϱ(i,j::Int,n=N) = SemiDirectProductElement(E(i,j,dim=n), v(j,dim=n))
λ(i,j::Int,n=N) = SemiDirectProductElement(E(i,j,dim=n), -v(j,dim=n))
2017-01-13 18:42:43 +01:00
function ɛ(i, n::Int=N)
2017-01-13 18:42:43 +01:00
result = eye(n)
result[i,i] = -1
return SemiDirectProductElement(result)
end
σ(permutation::Vector{Int}) =
SemiDirectProductElement(permutation_matrix(permutation))
# Standard generating set: 103 elements
function generatingset_ofAutF(n::Int=N)
2017-01-13 18:42:43 +01:00
indexing = [[i,j] for i in 1:n for j in 1:n if i≠j]
ϱs = [ϱ(ij...) for ij in indexing]
λs = [λ(ij...) for ij in indexing]
ɛs = [ɛ(i) for i in 1:N]
σs = [σ(perm) for perm in SymmetricGroup(n)]
S = vcat(ϱs, λs, ɛs, σs);
S = unique(vcat(S, [inv(x) for x in S]));
return S
end
#=
Note that the element
α(i,j,k) = ϱ(i,j)*ϱ(i,k)*inv(ϱ(i,j))*inv(ϱ(i,k)),
which surely belongs to ball of radius 4 in Aut(F₄) becomes trivial under the representation
Aut(F₄) GL₄()ℤ⁴ GL₅().
Moreover, due to work of Potapchik and Rapinchuk [1] every real representation of Aut(Fₙ) into GLₘ() (for m 2n-2) factors through GLₙ()ℤⁿ, so will have the same problem.
We need a different approach!
=#
2017-01-13 18:42:43 +01:00
const ID = eye(N+1)
const S₁ = generatingset_ofAutF(N)
2017-01-13 18:42:43 +01:00
matrix_S₁ = [matrix_repr(x) for x in S₁]
const TOL=10.0^-7
matrix_S₁[1:10,:][:,1]
Δ, cm = prepare_Laplacian_and_constraints(matrix_S₁)
#solver = SCSSolver(eps=TOL, max_iters=ITERATIONS, verbose=true);
solver = MosekSolver(MSK_DPAR_INTPNT_CO_TOL_REL_GAP=TOL,
# MSK_DPAR_INTPNT_CO_TOL_PFEAS=1e-15,
# MSK_DPAR_INTPNT_CO_TOL_DFEAS=1e-15,
# MSK_IPAR_PRESOLVE_USE=0,
QUIET=!VERBOSE)
# κ, A = solve_for_property_T(S₁, solver, verbose=VERBOSE)
product_matrix = readdlm("SL₃Z.product_matrix", Int)
L = readdlm("SL₃Z.Δ.coefficients")[:, 1]
Δ = GroupAlgebraElement(L, product_matrix)
A = readdlm("matrix.A.Mosek")
κ = readdlm("kappa.Mosek")[1]
# @show eigvals(A)
@assert isapprox(eigvals(A), abs(eigvals(A)), atol=TOL)
@assert A == Symmetric(A)
const A_sqrt = real(sqrtm(A))
SOS_EOI_fp_L₁, Ω_fp_dist = check_solution(κ, A_sqrt, Δ)
κ_rational = rationalize(BigInt, κ;)
A_sqrt_rational = rationalize(BigInt, A_sqrt)
Δ_rational = rationalize(BigInt, Δ)
SOS_EOI_rat_L₁, Ω_rat_dist = check_solution(κ_rational, A_sqrt_rational, Δ_rational)